IN.vertex.xy += IN.normal * IN.uv2;```
This is my code right now, it doesn't work, and I don't know why it doesn't work, or how to fix it, and I can't find any resources on the subject.
Honestly trying to learn HLSL Shaderlab shit has been nothing but suffering, pain, anguish. There is not a single good resource anywhere on the net unlike C#, and nothing works logically or rationally compared to C#.
I tried the following, but all that did was cause my mesh to fly away slowly into space, instead of displace according to the noise texture's movement.
```OUT.uv2 = TRANSFORM_TEX(IN.uv2, _Noise) + (_Time * 0.5);
IN.vertex.xy += IN.normal * OUT.uv2;```
TRANSFORM_TEX
does not sample the texture. It merely applies that texture’s scale and offset values to your UV. A simple search of that function would have given you details on that. And there are tons of HLSL resources on the net, of course not as abundant as C# due to the relatively niche level of shader programming, but still almost always results covering a question that can be had. (that one isn’t an HLSL function tho but simply a Unity helper macro found in UnityCG.cginc)
What you want for sampling a texture in the vertex program is tex2Dlod().
So float noise = tex2Dlod(_Noise, float4(OUT.uv2.xy, 0, 0)).r;
gets you the grayscale noise.
Then simply IN.vertex += IN.normal * noise;
to offset based on normal direction and noise intensity.