Jump to content
  • Advertisement
Sign in to follow this  

Local texture change

This topic is 2076 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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



//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;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!