Hi All,

May be my former question not much understandable. I want to try express my
problem again.
I have a 3D model which is created by Blender. As you guess, model has to
many texture on it. After I export my model in standard model type(3ds or
what else), I want to make per pixel shading on my model.

My question do I have to define all my texture in fragment shader as
"uniform sampler2D xxx" and bind this uniform in my related osg::Program one
by one to shade my model per pixel lightening? How can I reach related
pixel's texture value in fragment shader if I doesn't use sampler2D? For
example, now I can access to related pixel's texture value by;

uniform sampler2D diffuseTexture;
vec4 texture = texture2D(diffuseTexture,gl_TexCoord[0].st);


But if I doesn't define my sampler2D to related texture how can I access?

Thanks in advance.
Regards.

Ümit Uzun


2009/10/30 Ümit Uzun <umituzu...@gmail.com>

> Hi Folks,
>
> I am using PerPixel lighting on my some model which has created with
> Blender. My model has lots of textures on it. And my question is, do I have
> to send all textures in uniform variable to shader? That makes all think to
> complex, doesn't that? I have try to send only one texture to shader and saw
> that it can texture all of texture on my model instead of only send one.
>
> Then I realize that declared "uniform sampler2 sampleTexture" definition
> doesn't hold the related texture file. It only hold texture unit, I mean 0,1
> or 7. My question is what is the standart shadering operation when we have
> canned model? Should we send texture's to shader or what else? And sending
> texture is meaningless, because if we have ive or another texture integrated
> model what should we do this time? We haven't related texture separately?
> This time what should we send?
>
> Thanks in advance.
> Regards.
>
> Ümit Uzun
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to