Quantcast
Viewing all articles
Browse latest Browse all 713

Post processing fragment shader: get a ray through the fragment?,Post processing fragment shader: cast ray through fragment?

Hi, I have little experience with shaders, but I'm trying to set up a post-processing shader. For that, I'm simply calling Graphics.Blit(...) on the Camera's OnRenderImage(...) function. No problem there. However, what I need now is to somehow **get a ray from the camera through the current fragment** (in the fragment shader). I think that the fact that this is not a regular application of the material means that some things don't quite work. I noticed that the vertex position of the vertex shader is confusing, and I suspect the model (and possibly view) matrix are not valid? I can simply use _WorldSpaceCameraPos to get the camera position, and I know how to get the camera forward, right, and up vectors. But I have not been able to figure out how to get the direction of the ray through the fragment. I have been trying it for a while already yesterday, and have been searching, but right now the most efficient way to solve this might be to simply ask :)

Viewing all articles
Browse latest Browse all 713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>