Local texture change

Started by
-1 comments, last by yuanxy 10 years, 2 months ago

I want to achieve the model of local scaling, and now want to use the zoom partial transparent textures to achieve, but to change the transparency map texture coordinates is not, I think scaling algorithm for digital image processing, do not know how to write effects algorithms

HLSL?

//Composite Pass Vertex Shader
v2f VS_Composite(a2v In)
{
v2f Out = (v2f)0;

Out.texCoord = In.texCoord; //pass through texture coordinates from channel 1
Out.position = mul(In.position, wvp);//transform vert position to homogeneous clip space
Out.vNormal = In.vNormal;
return Out;
}

//Composite Pass Pixel Shader
float4 PS_Composite(v2f In) : COLOR
{
float4 diffuse = tex2D(diffuseMapSampler, In.texCoord.xy);
In.texCoord.y *= 0.2;
In.texCoord.x *= 0.2;
float alphaValue = tex2D(eyeMapAlphaSampler, In.texCoord.xy).r;
float colorValue = tex2D(eyeMapColorSampler, In.texCoord.xy);

return diffuse * (1 - alphaValue) + colorValue * alphaValue;
}

This topic is closed to new replies.

Advertisement