#How to Use URP Ray Tracing Shader template.

1 messages · Page 1 of 1 (latest)

shadow depot
#

// Uncomment this pragma for debugging the HLSL code in PIX. GPU performance will be impacted.
//#pragma enable_ray_tracing_shader_debug_symbols

#pragma max_recursion_depth 1

[shader("raygeneration")]
void MyRaygenShader()
{
    uint2 dispatchIdx = DispatchRaysIndex().xy;
   
    RenderTarget[dispatchIdx] = float4(dispatchIdx.x & dispatchIdx.y, (dispatchIdx.x & 15)/15.0, (dispatchIdx.y & 15)/15.0, 0.0);
}

this is the template

#

I want to achieve transparent shadows tho depending on the mesh alpha.

hybrid shadow
#

This is not a URP specific RayTracing shader template, but a generic one, for general purpose raytracing implementation.

If you want a URP/Lit equivalent shader, with raytraced shadows, you are better of to make modifications to the URP source code and change how shadows are sampled to add RT.

GL HF 🙂

shadow depot
#

I didn't think it would be that difficult.
The dithering is not what I want and the thing you said is I think an over engineering way imo.