Hi, 

I assign two geometry (same vertex) with two texture and want to blend them by 
glsl. The problem is even I get the texture sampler and use function mix to mix 
them, Then still cannot be blended together.
as: 
"uniform sampler2D baseTexture;\n"
    "uniform sampler2D shadowTexture;\n"
    "void main(void)\n"
    "{\n"
    "    vec3 ct;\n"
    "    vec3 basetexel, texel, color;\n"
    "    basetexel = vec3(texture2D(baseTexture,gl_TexCoord[0].st).r);\n"
    "    texel = texture2D(shadowTexture,gl_TexCoord[1].st).rgb;\n"
    "    color = mix(texel, basetexel, basetexel.r);\n"
    "    gl_FragColor = vec4(color, 1.0);\n"
    "}\n"

Thanks for any help. 

Hui


      
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to