#Rotate Texture2D in shaders

4 messages · Page 1 of 1 (latest)

dawn stratus
#

I have a visual shader where Texture2D is a custom parameter. What methods I can use to rotate this texture with shader 90/180/270 degrees?

hollow sparrow
# dawn stratus I have a visual shader where Texture2D is a custom parameter. What methods I can...

rotation is usually done using a matrix multiplication. for rotation a 2x2 matrix should be enough.
you can look here how you can generate the entries based on rotation.

#

rotating the UV inside the vertex shader should be enough, you don't have to calculate it for each pixel. it will also then automatically use the changed uv on sampling the texture, so you don't have to do it a second time.

dawn stratus