Re: [osg-users] TexGen limitations

2013-12-16 Thread Robert Osfield
Hi Daniel,


On 16 December 2013 09:50, Daniel Schmid wrote:

> Interesting. So could this be a bug in osg?
>

The fact that driver is reporting crappy values?  No this isn't an OSG bug,
it's an driver peculiarity/bug.

There was a workaround checked into src/osg/State.cpp that when setting the
checks GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS for GL version >=2.0 and
GL_MAX_TEXTURE_UNITS  on GL versions less than 2.0.  Perhaps you are using
an older OSG version that doesn't have this workaround.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexGen limitations

2013-12-16 Thread Wojciech Lewandowski
I think this anwers your question:

http://www.gamedev.net/topic/544990-gl_max_texture_units-is-wrong/

Cheers,
WL


2013/12/16 Daniel Schmid 

> Interesting. So could this be a bug in osg?
>
> Did you try to query GL_MAX_TEXTURE_UNITS and check if it says 4 ? I
> wonder if this value does not only mean maximum number of multitexture
> units, but also that only the lowest 4 units are capable of beeing used for
> multitexturing! This would kind of be an answer...
>
>
>
> Wojtek wrote:
> > Hi Daniel,
> >
> > I confirm your observation. I, however, do not agree that its a TexGen
> problem. Frankly I do not know what it is, and I had no time to
> investigate, but I think its maybe relate to TexEnv settings. I only made a
> following test: I zeroed a spotlight texture (memset( image->data(), 0,
> image->getTotalSizeInBytes() );). In this case no light should be cast on
> terrain no matter if texgen is set or not, because texcoords should not
> matter if texture is black everywhere. Yet the problem is the same. For
> stages above 3 terrain is brightly lit. So it looks to me like an issue
> with applying or blending the texture on stage 4 and more... Its not a
> problem of coord generation its the problem of texture not used correctly...
> >
> >
> > Cheers,
> > Wojtek
> >
> >
> >
> > 2013/12/16 Daniel Schmid < ()>
> >
> > > Hi Wojtek, would you mind doing the simple test with the sample
> program osgspotlight and the modifications I documented? I wonder if you
> get the same different results as soon as you use texture units from 4 and
> above.
> > >
> > > Cheers,
> > > Daniel
> > >
> > > --
> > > Read this topic online here:
> > >
> > > http://forum.openscenegraph.org/viewtopic.php?p=57677#57677 (
> http://forum.openscenegraph.org/viewtopic.php?p=57677#57677)
> > >
> > >
> > >
> > >
> > >
> > > ___
> > > osg-users mailing list
> > >  ()
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org(
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > >
> > >
> > >
> >
> >
> >  --
> > Post generated by Mail2Forum
>
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=57679#57679
>
>
>
>
>
> ___
> 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


Re: [osg-users] TexGen limitations

2013-12-16 Thread Daniel Schmid
Interesting. So could this be a bug in osg? 

Did you try to query GL_MAX_TEXTURE_UNITS and check if it says 4 ? I wonder if 
this value does not only mean maximum number of multitexture units, but also 
that only the lowest 4 units are capable of beeing used for multitexturing! 
This would kind of be an answer...



Wojtek wrote:
> Hi Daniel, 
> 
> I confirm your observation. I, however, do not agree that its a TexGen 
> problem. Frankly I do not know what it is, and I had no time to investigate, 
> but I think its maybe relate to TexEnv settings. I only made a following 
> test: I zeroed a spotlight texture (memset( image->data(), 0, 
> image->getTotalSizeInBytes() );). In this case no light should be cast on 
> terrain no matter if texgen is set or not, because texcoords should not 
> matter if texture is black everywhere. Yet the problem is the same. For 
> stages above 3 terrain is brightly lit. So it looks to me like an issue with 
> applying or blending the texture on stage 4 and more... Its not a problem of 
> coord generation its the problem of texture not used correctly...
> 
> 
> Cheers,
> Wojtek 
> 
> 
> 
> 2013/12/16 Daniel Schmid < ()>
> 
> > Hi Wojtek, would you mind doing the simple test with the sample program 
> > osgspotlight and the modifications I documented? I wonder if you get the 
> > same different results as soon as you use texture units from 4 and above.
> > 
> > Cheers,
> > Daniel
> > 
> > --
> > Read this topic online here:
> > 
> > http://forum.openscenegraph.org/viewtopic.php?p=57677#57677 
> > (http://forum.openscenegraph.org/viewtopic.php?p=57677#57677)
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> > 
> > 
> 
> 
>  --
> Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=57679#57679





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexGen limitations

2013-12-16 Thread Wojciech Lewandowski
Hi Daniel,

I confirm your observation. I, however, do not agree that its a TexGen
problem. Frankly I do not know what it is, and I had no time to
investigate, but I think its maybe relate to TexEnv settings. I only made a
following test: I zeroed a spotlight texture (memset( image->data(), 0,
image->getTotalSizeInBytes() );). In this case no light should be cast on
terrain no matter if texgen is set or not, because texcoords should not
matter if texture is black everywhere. Yet the problem is the same. For
stages above 3 terrain is brightly lit. So it looks to me like an issue
with applying or blending the texture on stage 4 and more... Its not a
problem of coord generation its the problem of texture not used correctly...

Cheers,
Wojtek


2013/12/16 Daniel Schmid 

> Hi Wojtek, would you mind doing the simple test with the sample program
> osgspotlight and the modifications I documented? I wonder if you get the
> same different results as soon as you use texture units from 4 and above.
>
> Cheers,
> Daniel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=57677#57677
>
>
>
>
>
> ___
> 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


Re: [osg-users] TexGen limitations

2013-12-16 Thread Daniel Schmid
Hi Wojtek, would you mind doing the simple test with the sample program 
osgspotlight and the modifications I documented? I wonder if you get the same 
different results as soon as you use texture units from 4 and above.

Cheers,
Daniel

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=57677#57677





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexGen limitations

2013-12-16 Thread Wojciech Lewandowski
Hi Daniel,

I doubt your test methodology is correct. For recent years I've beeen often
using TexGen on stage 6 and 7. On many GeForces and some Radeons and even
Intel HD 3000. I think TexGen used at 0-7 is very common and thus your
observation must be wrong...
Perhaps you read the Microsoft default ICD caps instead of NVidias ? I must
however say that I have not checked most recent drivers though. I am still
on 314.22. So maybe you right... but only if thats something what got
broken in drivers. But I can asssure you that generally throughout recent
years (5 yrs or more) TexGen was okay on stages 0..7.

Cheers,
Wojtek



2013/12/16 Daniel Schmid 

> The mistery is solved. On Nvidia cards, a maximum of 4 Multitexture Units
> are allowed. you can simply query this value by calling
>
> glGetIntegerv(GL_MAX_TEXTURE_UNITS, &iUnits);
>
> So it looks like using TexGen is therefore limited to the lowest 4
> Textureunits, which is not very logical. Actually if 4 units are allowed,
> they should be able to come from any of the available texture units...
>
> Cheers,
> Daniel
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=57675#57675
>
>
>
>
>
> ___
> 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


Re: [osg-users] TexGen limitations

2013-12-16 Thread Daniel Schmid
The mistery is solved. On Nvidia cards, a maximum of 4 Multitexture Units are 
allowed. you can simply query this value by calling 

glGetIntegerv(GL_MAX_TEXTURE_UNITS, &iUnits);

So it looks like using TexGen is therefore limited to the lowest 4 
Textureunits, which is not very logical. Actually if 4 units are allowed, they 
should be able to come from any of the available texture units...

Cheers,
Daniel

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=57675#57675





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexGen limitations

2013-12-13 Thread Daniel Schmid
I made the test now with a GTX 580 and a different driver version, and I still 
have the same issues!

Daniel

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexGen limitations

2013-12-13 Thread Daniel Schmid
I have an Nvidia GTX TITAN with current drivers. Sure this could be a driver 
issue... but I doubt it with such current hardware.
I would be curious if you Robert or anybody could quickly make the test 
according to my previous post and just tell your results.
I know it sounds silly for such a basic issue, but this is what community is 
for... :)

Daniel

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] TexGen limitations

2013-12-13 Thread Robert Osfield
HI Daniel,

It sounds like an OpenGL driver issue. I don't recall any hard limits w.r.t
texture units with texgen but being fixed function state the driver might
not map it all the way up.

Robert.


On 13 December 2013 07:36, Daniel Schmid wrote:

>  Hi there
>
> I noticed a limitation in TexGen. It looks like osg::TexGen can only be
> used up to a texture unit between 0 and 3, starting from texture unit 4 to
> 7, osg::TexGen have no more effect.
>
> You can easily test this with the *osgspotlight.cpp* example by changing
> the following lines:
>
>
>
> Line 249:
>
> xform->addChild(createSpotLightNode(osg::Vec3(0.0f,0.0f,0.0f),
> osg::Vec3(0.0f,1.0f,-1.0f), 60.0f, 0, 1));
>
>
>
> replace the last number (1).
>
>
>
>
>
> Line 275:
>
> root->setStateSet(createSpotLightDecoratorState(0,1));
>
>
>
> replace the last number (1).
>
>
>
> If you use numbers between 0..3, everything works fine, 4 and up doesn’t
> work anymore.
>
>
>
> Where does this limitation come from? Is this OSG or opengl?
>
>
>
> Regards
>
> Daniel
>
>
>
> ___
> 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