HLSL compute shader FViewUniformShaderParameters not populated.
Hey, I'm running some hlsl that uses the View.ScreenPositionScaleBias to cast a ray from the camera position, but it seems to be 0.0, 0.0 every time. I'm using the code implemented in Temaran's compute shader plugin example to render out to a texture based on a raycast from the camera into world space, my hlsl looks like
but View.ScreenPositionScaleBias.xy is always (0.0, 0.0) at which point everything messes up. Im using the ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER to add the shader to the render thread, does it just mean that I happen to be rendering before the FViewUniformShaderParameters has been populated, or do I need to bind the data to my pixel shader when it executes somehow within its threaded function, atm that is
the result I am then using in a material to
so that my procedural texture is then projected onto our terrain with the material system. I can see that it is the View structure that doesn't have any data if I debug the shader by outputing different colors for different issues and it all traced back to this structure not having the data I need. Do I need to just populate out some of the data myself, or is this a render order issue (like how the decal system is deferred?)
asked Mar 31 '16 at 01:21 AM in Rendering
Ok nm I figured it all out, shaders have a way of making me feel stupid a lot of the time, all I really needed was the inverse View Projection matrix to do the ray cast so I bound that up in my shader variables (BEGIN_UNIFORM_BUFFER_STRUCT) and passed that through and did my raytrace with a bit of
I did end up poking around trying to figure out why my shader had an empty View object and saw that it was because I was not binding the the FViewUniformShaderParameters with SetUniformBufferParameter to my specific shader.
Follow this question
Once you sign in you will be able to subscribe for any updates here