Closed Xiyinyue closed 1 year ago
@Xiyinyue hello! I will try to explain what is happening here.
1) The "[-1,3]" you mentioned. Basically, it is a trick to render a quad (which is a slice of our propagation volume) only with 3 vertices by drawing a bigger triangle which is then "clipped" to a quad. This is efficient and common in full screen passes (we kinda have a fullscreen pass if we think from the "volume" perspective because its our render target). Here is a more detailed explanation: https://stackoverflow.com/questions/2588875/whats-the-best-way-to-draw-a-fullscreen-quad-in-opengl-3-2
2) I am not sure I am following your "there is no change for screenPos". SV_Position semantic which stores our screenPos in shader has to be in normalized coordinates; the pixel shader then receives screenPos which was automatically prepared/converted to pixel coordinates (thus [0,32] range which is the dimension of our volume).
In RenderDoc if you select a slice in the texture view and then debug a pixel from that slice, you should see proper values in shader debug (screenPos in [0,32], depthIndex = slice).
I hope it answers your questions. If you have more, feel free to ask!
Sorry,it's my first time to use github,i don't know what the comment will affect you . but i have some questions about it .In LPVpropagation.hlsl
i don't know why the value of screenPos is [-1,3] and whatever any small counts,and then I open renderdoc,I saw it became [0-32] when i open any pixel's debugging. there is no change for screenPos,the 32 Instance have the same screenpos,how can i identify 323232 volume for only one depthIndex