I want to render to the motion blur effect by making a prism which is rasterized to fragments.
- In the first pass, transfroming vertices with 2 matrices at the previous ( time t0) and the current frame (time t1) in the vertex shader. In the geometry shader, using 2 triangles to make a prism representing a moving triangle, and a side rectangle is subdivied into 2 triangles for rasterization. In the pixel shader, I just store all fragments into a read/write structured buffer.
- Fragment has 6 values, a float4 and an uint2.
- In the second pass, I just load all fragments which belongs to the current pixel, and return a color (ex: green).
- An error occurs when the camera go inside or near an model. But it is okay when the object is far away.
normal
Error (go inside a teapot)
Is there anybody has experienced this problem? Please help me.