texture sPicTexture; texture sMaskTexture; float2 gUVPrePosition = float2(0, 0); float2 gUVScale = float2(1, 1); // ESCALA DA TELA float2 gUVScaleCenter = float2(0.5, 0.5); // CENTRO DA ESCALA (NAO MEXER SE NAO FOR NECESSÁRIO) float gUVRotAngle = 0; // ROTACAO DA TEXTURA float2 gUVRotCenter = float2(0.5, 0.5); // CENTRO DA ROTACAO DA TESXTURA float2 gUVPosition = float2(0, 0); // POSICAO FINAL (DRAW SECTION) float3x3 computeTextureTransform() { float s = sin(gUVRotAngle); float c = cos(gUVRotAngle); float3x3 translationMatrix = float3x3( 1, 0, 0, 0, 1, 0, gUVPosition.x + gUVPrePosition.x, gUVPosition.y + gUVPrePosition.y, 1 ); float3x3 rotationMatrix = float3x3( c, s, 0, -s, c, 0, gUVRotCenter.x * (1 - c) + gUVRotCenter.y * s, gUVRotCenter.y * (1 - c) - gUVRotCenter.x * s, 1 ); float3x3 scaleMatrix = float3x3( gUVScale.x, 0, 0, 0, gUVScale.y, 0, gUVScaleCenter.x * (1 - gUVScale.x), gUVScaleCenter.y * (1 - gUVScale.y), 1 ); return mul(translationMatrix, mul(rotationMatrix, scaleMatrix)); } technique HudMaskTechnique { pass P0 { Texture[0] = sPicTexture; TextureTransform[0] = computeTextureTransform(); TextureTransformFlags[0] = Count2; AddressU[0] = Clamp; AddressV[0] = Clamp; ColorOp[0] = Modulate; ColorArg1[0] = Texture; ColorArg2[0] = Diffuse; AlphaOp[0] = Modulate; AlphaArg1[0] = Texture; AlphaArg2[0] = Diffuse; Texture[1] = sMaskTexture; TexCoordIndex[1] = 0; AddressU[1] = Clamp; AddressV[1] = Clamp; ColorOp[1] = SelectArg1; ColorArg1[1] = Current; AlphaOp[1] = Modulate; AlphaArg1[1] = Current; AlphaArg2[1] = Texture; ColorOp[2] = Disable; AlphaOp[2] = Disable; } }