|
|
|
|
|
|
Properties |
|
|
|
{ |
|
|
|
_MainTex ("Main Texture", 2D) = "black" {} |
|
|
|
_TextureRotation ("Texture Rotation (Degrees)", Float) = 0.0 |
|
|
|
} |
|
|
|
SubShader |
|
|
|
{ |
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
real _TextureRotation; |
|
|
|
CBUFFER_START(DisplayRotationPerFrame) |
|
|
|
float4x4 _DisplayRotationPerFrame; |
|
|
|
CBUFFER_END |
|
|
|
|
|
|
|
float angle = radians(_TextureRotation); |
|
|
|
float cosrot = cos(angle); |
|
|
|
float sinrot = sin(angle); |
|
|
|
|
|
|
|
float3x3 textureXformMatrix = float3x3( |
|
|
|
float3(cosrot, -sinrot, 0.5f), |
|
|
|
float3(sinrot, cosrot, 0.5f), |
|
|
|
float3(0.0f, 0.0f, 1.0f) |
|
|
|
); |
|
|
|
|
|
|
|
float3 tmp = float3(v.texcoord.x - 0.5f, 0.5f - v.texcoord.y, 1.0f); |
|
|
|
|
|
|
|
o.texcoord = mul(textureXformMatrix, tmp).xy; |
|
|
|
o.texcoord = mul(float3(v.texcoord, 1.0f), _DisplayRotationPerFrame).xy; |
|
|
|
return o; |
|
|
|
} |
|
|
|
|
|
|
|