In the vertex to fragment struct of this image effect shader, I want to add a float3 that represents the direction between the camera and the vertex. But I'm still new to shaders so I don't really know how I would do the semantics for this. Any ideas?
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float3 viewVector; //Kicks out an error saying shader is not supported on this GPU.
};
I guess this is also a question about how to get the world space vertex position into the fragment shader because that's what I was trying to do with this.
↧