Receiving error in Material after enabling Ray Tracing

Hi, I’m receiving the following error message in a material which was previously working before I turned on Raytracing. I know I could just turn it off again, but I would quite like to build this function set to support Raytracing, as I am intending to sell it on the marketplace. This is the error:

[SM5] error: validation errors

[SM5] error: /Engine/Private/GemoetryCacheVertexFactory.ush:437:75 @[ /Engine/Private/RayTracingMaterialHitShaders.usf:234:18 @[ /Engine/Private/RayTracingMaterialHitShaders.usf:288:2 ] ]: at ‘%252 = fmul fast float %233, undef’ in block ‘#7’ of function ‘*A?MaterialCHS@@YAXUFPackedMaterialClosestHitPayload@@UFDefaultAttributes@@@Z’ : Instructions should not read uninitialized value

[SM5] Validation failed

[SM5] D3DCompileToDxil failed

[SM5] error: /Engine/Private/GemoetryCacheVertexFactory.ush:437:75 @[ /Engine/Private/RayTracingMaterialHitShaders.usf:234:18 @[ /Engine/Private/RayTracingMaterialHitShaders.usf:288:2 ] ]: at ‘%252 = fmul fast float %233, undef’ in block ‘#7’ of function ‘*A?MaterialCHS@@YAXUFPackedMaterialClosestHitPayload@@UFDefaultAttributes@@@Z’ : Instructions should not read uninitialized value

*A Not Sure what this symbol is, but it shows an A inside a box.

I also wondered, I only have a GeForce 1060 at the moment, which obviously doesn’t actually have raytracing hardware, but if I’m trying to develop tools that will also support ray tracing (since I am desperate to upgrade my graphics card and want the system I’m developing to be future proof), am I right in assuming that it will just be done by the processor in the absence of dedicated hardware and run way slower, or could this actually be causing the error to occur. Thanks a lot for any help you can offer.

Long story short, something in your material is trying to do something, that is not available in raytracing shader.

There is a switch material expression, that switches between raytracing and normal shader, pretty sure you can find and use it isolate your monstrous material function.

1 Like