Hi JS,

Thanks so much for your detailed explanations. I get your thinking. I have
known same think but I didn't sure very well.
My last question is, I have declared;
uniform sampler2D diffuseTexture;
in my fragment shader, although I didn't bind it to osg::Uniform in my main
application, I can sample my texture from my shader in Unit 0. Do you think
it is weird or not? You have said that; I only need to bind my uniform
sampler2d variable in my application to set to related stateset. I didn't
set to stateset too, but I get the unit 0 texture value from shader and can
see my model textured.

Thanks again.
Regards,

Ümit Uzun


2009/10/30 Jean-Sébastien Guay <jean-sebastien.g...@cm-labs.com>

> Hi Ümit,
>
>
>  How can I reach related pixel's texture value in fragment shader if I
>> doesn't use sampler2D?
>>
>
> I don't understand why you would *not* use sampler2D? You always need a
> sampler to sample the texture in a shader.
>
>
>  But if I doesn't define my sampler2D to related texture how can I access?
>>
>
> You just need to create a uniform and set it correctly. Then you'll have a
> sampler. See my other message.
>
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
> _______________________________________________
> 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