Search Unity

Question ByteAdressBuffer unity_MeshIndexBuffer_RT not set in SRP rendering.

Discussion in 'General Graphics' started by xiorcalSMPX, Jul 16, 2020.

  1. xiorcalSMPX

    xiorcalSMPX

    Joined:
    Sep 5, 2019
    Posts:
    1
    Context: I'm trying to get vertex attribute data from a raycasting shader in a custom SRP (tried in 2019.3.15, 2019.4.4 and 2020.1.0b11).

    I've looked into HDRP library and I thought found what I was searching for with UnityRayTracingMeshUtils.cginc (found in CGIncludes), except that I get this error :
    Ray Tracing Shader "ProbeTrace": Buffer "unity_MeshIndexBuffer_RT" is not set. Dispatching ray generation shader "RayGen" failed!

    (
    unity_MeshIndexBuffer_RT
    is a
    ByteAddressBuffer
    in UnityRayTracingMeshUtils.cginc)

    I searched on the HDRP package where I could have missed something but did not find anything that could match so I should have missed something in my command buffer setup ?

    My setup is as follow :
    Code (CSharp):
    1.  // Textures Setup
    2. ...
    3.  
    4. // RayTracing Params setup
    5. CMD.SetRayTracingShaderPass(rtShader, "RayTracing");
    6. CMD.SetRayTracingAccelerationStructure(rtShader, s_AccelerationStructureId,  context.RTAccelerationStructure);
    7. CMD.SetRayTracingTextureParam(rtShader, "outputRW", outputTarget.Identifier());
    8.  
    9. // Execution
    10. CMD.DispatchRays(rtShader, "RayGen", (uint)raysSize.x, (uint)raysSize.y, 32);
    11. context.ExecuteCommandBuffer(CMD);
    12.  
    Anyone encountered a similar issue, or with knowledge of what I did wrong ?
     
  2. okluckej_unity

    okluckej_unity

    Joined:
    Aug 30, 2020
    Posts:
    11
    Same issue here. When trying to fetch data from vertices

    Unity version
    2020.1.1f1
    2020.1.3f1
     
    Last edited: Aug 30, 2020