parent
02569bf4ae
commit
5c6cec4a62
4 changed files with 3 additions and 3 deletions
|
|
@ -68,8 +68,8 @@ void main()
|
|||
vec3 origin = gl_WorldRayOriginEXT + gl_WorldRayDirectionEXT * gl_HitTEXT;
|
||||
shadowed = true;
|
||||
// Trace shadow ray and offset indices to match shadow hit/miss shader group indices
|
||||
traceRayEXT(topLevelAS, gl_RayFlagsTerminateOnFirstHitEXT | gl_RayFlagsOpaqueEXT | gl_RayFlagsSkipClosestHitShaderEXT, 0xFF, 1, 0, 1, origin, tmin, lightVector, tmax, 2);
|
||||
traceRayEXT(topLevelAS, gl_RayFlagsTerminateOnFirstHitEXT | gl_RayFlagsOpaqueEXT | gl_RayFlagsSkipClosestHitShaderEXT, 0xFF, 0, 0, 1, origin, tmin, lightVector, tmax, 2);
|
||||
if (shadowed) {
|
||||
hitValue *= 0.3;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
|
@ -78,7 +78,7 @@ void main(in InPayload inPayload, inout InOutPayload inOutPayload, in float2 att
|
|||
|
||||
inOutPayload.shadowed = true;
|
||||
// Offset indices to match shadow hit/miss index
|
||||
TraceRay(topLevelAS, RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH | RAY_FLAG_FORCE_OPAQUE | RAY_FLAG_SKIP_CLOSEST_HIT_SHADER, 0xff, 1, 0, 1, rayDesc, inOutPayload);
|
||||
TraceRay(topLevelAS, RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH | RAY_FLAG_FORCE_OPAQUE | RAY_FLAG_SKIP_CLOSEST_HIT_SHADER, 0xff, 0, 0, 1, rayDesc, inOutPayload);
|
||||
if (inOutPayload.shadowed) {
|
||||
inPayload.hitValue *= 0.3;
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue