Miss Shader

A shader that is invoked when no ray intersections are found or accepted. This is useful for background or sky shading. The miss shader may use CallShader and TraceRay to schedule more work.

The miss shader must include a user-defined structure typed payload parameter matching the one supplied to TraceRay.

Shader Type attribute

[shader("miss")]

Example

[shader("anyhit")]
void miss_main(inout MyPayload payload)
{
    // Use ray system values to compute contributions of background, sky, etc...
    // Combine contributions into ray payload
    CallShader( ... );	// if desired
    TraceRay( ... );	// if desired
    // this ray query is now complete
}