Jump to content

  • Log In with Google      Sign In   
  • Create Account


Local texture change


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 yuanxy   Members   -  Reputation: 103

Like
0Likes
Like

Posted 07 February 2014 - 01:29 AM

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;



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS