I am learning the basic HLSL coding rightnow and i found couple video from youtube
here is my code
struct texDistort
{
float2 texScale(float2 uv, float2 scale)
{
float2 texScale = ( uv - 0.5) * scale + 0.5;
return texScale;
}
float2 texRotate(float2 uv, float angle)
{
float2x2 rotationMatrix = float2x2(cos(angle),sin(angle),
-sin(angle),cos(angle));
return mul(uv - 0.5, rotationMatrix) + 0.5;
}
};
texDistort ted;
float4 color = Texture2DSample(texObject, texObjectSampler, ted.texRotate(uv,radians(45));
return(color);
in the last vesrion i use ted.texScale instead of texRotate but they are diffrent function, Scale is for Scaling and rotate is for Roatation. But when i use Rotate it shows complier crashed
i wondering know why and how its happended how can i fix it