- Home /
Adding a UV offset to tex2dproj.
I'm trying to create a blur effect that will only be applied to whatever is behind a specific object. For that purpose, i have created a shader that uses GrabPass to get the rest of the scene behind it.
tex2Dproj(_GrabTexture, UNITY_PROJ_COORD(IN.proj));
IN.proj was initialized with float4 proj : TEXCOORD;
The issue is that i don't exactly know how to add an offset to the second argument in order to sample neighbouring pixels (something like tex2D (_GrabTexture, IN.uv_GrabTexture+half2(_GrabTexture_TexelSize*-1, _GrabTexture_TexelSize*-1)
)
Answer by Professor Snake · Nov 06, 2013 at 07:59 PM
Nevermind. Modifying IN.proj.xy seemed to do the trick.
Your answer
Follow this Question
Related Questions
Material offset relative to other game object 0 Answers
UV offset in surface shader. 1 Answer
Simple Shader Syntax ... or so I thought 0 Answers
Modify vertex position using shaders on Windows Phone 8 0 Answers
Unwrap a mesh with a vertex shader 0 Answers