On Sun, Sep 12, 2010 at 10:18 AM, Werner Modenbach <
[email protected]> wrote:

> Hi Robert,
>
> sorry, I didn't explain clearly enough what I ment.
> I have written complex shaders with a lot of functionality. They work
> perfect.
> Jet me give an example:
> In my scene I have objects with and without textures.
> Is there any way for the shader itself to detect this difference?
> If not, I have to make two versions of the shaders just beeing different in
> the one line with the basic texture and load them accordingly?
>
People get around this by binding a default texture -- for example, a 1x1
white pixel -- at the root of the scene graph. That way you don't have to
write two versions of the shaders.

>
> So my question is: can I querry "uniform sampler2D textureMap" inside the
> shader if it was set by my program or not? I couldn'tr find anything like
> thar
> in the docs.
>
> No, you can't.
Tim

> Many thanks in advance
>
> - Werner -
>
>
> On Saturday 11 September 2010 12:15:57 Robert Osfield wrote:
> > Hi Werner,
> >
> > On Fri, Sep 10, 2010 at 1:39 PM, Werner Modenbach
> >
> > <[email protected]> wrote:
> > > Does anybody know if it is possible inside a shader program to querry
> if
> > > a "uniform sampler2D" was set by uniform attribute or if it contains
> > > legal data?
> >
> > The OSG should report a warning when shaders fail to link and don't
> > have the required uniforms.
> >
> > There isn't any way for the OSG or OpenGL to know what "legal data" is
> > for you shaders, this is all down to you - if you put garbage in
> > you'll get garbage out.
> >
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> --
> TEXION Software Solutions
>
> TEXION GmbH -  Rotter Bruch 26a  -  D 52068 Aachen - HRB 14999 Aachen
> Fon: +49 241 475757-0, Fax: +49 241 475757-29, web: http://www.texion.eu
>
> Geschäftsführer/Managing Director: Werner Modenbach
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to