Hi Hui,

I am not sure but try to use same gl_TexCoord[0].st for all texture2D
operation. I mean use gl_TexCoord[0].st again instead of gl_TexCoord[1].st

Or try to put 0.5 instead of basetexel.r. Maybe basetexel.r value always
approximates to 1.0 and then you can't see the mixed texture.

HTH

Umit Uzun

2008/10/24 hui <[EMAIL PROTECTED]>

> 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
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to