- Home /
Question by
herruber · Aug 18, 2017 at 11:37 AM ·
shadersimage effectsconversionhlsl
How to get picked worldposition to clipspace, in fragment shader? (Image effect shader)
So this is all happening in an image effect shader. I have converted each pixel from clipspace to world space. Applied an offset to this in world space and now I need the new world space coordinates in clipspace coords. I have ran out of things to try, I always get a result close to what id expect but.
Comment
So, you want to know how to convert WorldSpace coordinates to Clip Space coordinates?
Yes except not from a coordinate given to me from the vertex shader. If I pick ANY coordinate in world space in the frag shader as a float3:
float3 worldPos = float3(0, 0, 0);
where is this in clip space? If it is in clip space at all
i think its: clipSpacePos = mul(worldPos, UNITY_$$anonymous$$ATRIX_VP)