mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-15 21:50:59 +01:00
rtx: fix translucent things casting shadows (they shouldn't for now)
This commit is contained in:
parent
b3465ceb30
commit
3f12a42432
@ -298,7 +298,7 @@ void main() {
|
||||
const uint sbt_stride = 0;
|
||||
const uint miss_index = 0;
|
||||
const float L = 10000.;
|
||||
traceRayEXT(tlas, flags, GEOMETRY_BIT_OPAQUE,
|
||||
traceRayEXT(tlas, flags, GEOMETRY_BIT_OPAQUE | GEOMETRY_BIT_REFRACTIVE,
|
||||
sbt_offset, sbt_stride, miss_index,
|
||||
origin, 0., direction, L,
|
||||
PAYLOAD_LOCATION_OPAQUE);
|
||||
|
@ -23,6 +23,7 @@ layout (constant_id = 3) const uint MAX_VISIBLE_SURFACE_LIGHTS = 255;
|
||||
|
||||
#define GEOMETRY_BIT_OPAQUE 0x01
|
||||
#define GEOMETRY_BIT_ADDITIVE 0x02
|
||||
#define GEOMETRY_BIT_REFRACTIVE 0x04
|
||||
|
||||
#define SHADER_OFFSET_MISS_REGULAR 0
|
||||
#define SHADER_OFFSET_MISS_SHADOW 1
|
||||
|
@ -34,6 +34,8 @@ typedef struct {
|
||||
enum {
|
||||
MaterialMode_Opaque,
|
||||
MaterialMode_Opaque_AlphaTest,
|
||||
MaterialMode_Refractive,
|
||||
// TODO MaterialMode_Subtractive,
|
||||
MaterialMode_Additive,
|
||||
} material_mode;
|
||||
} vk_ray_draw_model_t;
|
||||
|
@ -339,7 +339,7 @@ void VK_RayFrameAddModel( vk_ray_model_t *model, const vk_render_model_t *render
|
||||
case kRenderTransColor:
|
||||
case kRenderTransTexture:
|
||||
HACK_reflective = true;
|
||||
draw_model->material_mode = MaterialMode_Opaque_AlphaTest; // FIXME add new translucency mode
|
||||
draw_model->material_mode = MaterialMode_Refractive;
|
||||
break;
|
||||
|
||||
// Additive blending: C = SRC * alpha + DST
|
||||
|
@ -523,6 +523,10 @@ static void prepareTlas( VkCommandBuffer cmdbuf ) {
|
||||
inst[i].instanceShaderBindingTableRecordOffset = SHADER_OFFSET_HIT_ALPHA_TEST,
|
||||
inst[i].flags = VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR;
|
||||
break;
|
||||
case MaterialMode_Refractive:
|
||||
inst[i].mask = GEOMETRY_BIT_REFRACTIVE;
|
||||
inst[i].flags = VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR;
|
||||
break;
|
||||
case MaterialMode_Additive:
|
||||
inst[i].mask = GEOMETRY_BIT_ADDITIVE;
|
||||
inst[i].instanceShaderBindingTableRecordOffset = SHADER_OFFSET_HIT_ADDITIVE,
|
||||
|
Loading…
Reference in New Issue
Block a user