- Home /
 
 
               Question by 
               Raul_MadGoat · Nov 27, 2015 at 10:25 AM · 
                shadertextureoffsetsurface shaderdisplacement  
              
 
              Is using texture offset with displacement shader possible?
Hello, I am working on a surface shader, and I am wondering if it is possible to use offset on the displacement texture, because as it is now, it changes nothing. This is the displacement function of the shader.
     void disp(inout appdata v)
     {
         float horizontal = tex2Dlod(_Displacement, float4(v.texcoord.xy,0,0)).r * _DisplacementPow * 5;
         float vertical = tex2Dlod(_Displacement, float4(v.texcoord.xy, 0, 0)).r * _DisplacementPow * 5;
         v.vertex.x += v.normal * horizontal;
         v.vertex.y += (v.normal * vertical);
         
         v.vertex.y -= 0.5;
     }
 
               I would like to know if it is possible to use texture offset with the height map, and if yes, what needs to be changed.
               Comment
              
 
               
              Your answer