[osg-users] Help:why does renderbin affect the display of textures ?
Hello, I have two drawable nodes A and B under the same main group node. I mapped two different textures on the drawables respectively. Those two drawables do not have any overlappings in terms of pixels on the screen. Drawable A is described using open scene graph library while drawable B is described using openGL terms. Depth test is disabled by Drawable A and enabled by drawable B. Texture display on A uses a shader while B does not. When the renderbin of drawable A is set to be -1 and that of drawable B is 1, the two textures cannot show at the same time. That is to say, when I toggle on both drawable A and drawable B and make them both seen on the screen, the texture on drawable B doesn't show, but the color of B is correct. Under such circumstance, when I manipulate the view in a way such that drawable A is out of sight, then the texture on drawable B will appear. If I reverse the renderbins of those two drawables, then the textures can show at the same time. I just cannot figure out why this happens. If it is due to depth test, why should such conflicts happen, since they have no overlapped pixels on the screen? Even it is due to depth test, why is the color correct? Would someone please be so kind enough as to explain that to me? Thanks millions in advance! Best regards Shuiying ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help:why does renderbin affect the display of textures ?
Is nobody interested in this question?:-( Hello, I have two drawable nodes A and B under the same main group node. I mapped two different textures on the drawables respectively. Those two drawables do not have any overlappings in terms of pixels on the screen. Drawable A is described using open scene graph library while drawable B is described using openGL terms. Depth test is disabled by Drawable A and enabled by drawable B. Texture display on A uses a shader while B does not. When the renderbin of drawable A is set to be -1 and that of drawable B is 1, the two textures cannot show at the same time. That is to say, when I toggle on both drawable A and drawable B and make them both seen on the screen, the texture on drawable B doesn't show, but the color of B is correct. Under such circumstance, when I manipulate the view in a way such that drawable A is out of sight, then the texture on drawable B will appear. If I reverse the renderbins of those two drawables, then the textures can show at the same time. I just cannot figure out why this happens. If it is due to depth test, why should such conflicts happen, since they have no overlapped pixels on the screen? Even it is due to depth test, why is the color correct? Would someone please be so kind enough as to explain that to me? Thanks millions in advance! Best regards Shuiying ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Help:why does renderbin affect the display of textures ?
Hi Shuiying, I guess that there may be something wrong in the draw implementation of drawable B. Although OpenGL calls can be executable in custom drawables, it is still suggested that you apply all kinds of rendering states to the drawable using StateAttribute derivatives. But without looking at some detailed code, I can hardly find out the actual reason inside. Wang Rui 2012/10/8 wang shuiying : > Is nobody interested in this question?:-( > > Hello, > > I have two drawable nodes A and B under the same main group node. I > mapped two different textures on the drawables respectively. Those two > drawables do not have any overlappings in terms of pixels on the screen. > Drawable A is described using open scene graph library while drawable B > is described using openGL terms. Depth test is disabled by Drawable A > and enabled by drawable B. Texture display on A uses a shader while B > does not. > > When the renderbin of drawable A is set to be -1 and that of drawable B > is 1, the two textures cannot show at the same time. That is to say, > when I toggle on both drawable A and drawable B and make them both seen > on the screen, the texture on drawable B doesn't show, but the color of > B is correct. Under such circumstance, when I manipulate the view in a > way such that drawable A is out of sight, then the texture on drawable B > will appear. > > If I reverse the renderbins of those two drawables, then the textures > can show at the same time. > > I just cannot figure out why this happens. > > If it is due to depth test, why should such conflicts happen, since > they have no overlapped pixels on the screen? Even it is due to depth > test, why is the color correct? > > Would someone please be so kind enough as to explain that to me? > > Thanks millions in advance! > > Best regards > Shuiying > > > > > ___ > 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] Help:why does renderbin affect the display of textures ?
Hi Seems like you are messing with opengl state, and osg dont know about it. You should either: a) when you draw something with pure gl - after you finished, return all state you modified to values being before you started drawing b) use osg::State interface members to let osg know what state you are changed, or use osg wrappers in osg::State to make this state changes. c) call osg::State's dirty*() methods (like dirtyAllModes() and dirtyAllAttributes()) for state you've changed, after you finished with pure gl, but i dont recommend using this. Cheers. 08.10.2012, 12:14, "wang shuiying" : > Is nobody interested in this question?:-( > > Hello, > > I have two drawable nodes A and B under the same main group node. I > mapped two different textures on the drawables respectively. Those two > drawables do not have any overlappings in terms of pixels on the screen. > Drawable A is described using open scene graph library while drawable B > is described using openGL terms. Depth test is disabled by Drawable A > and enabled by drawable B. Texture display on A uses a shader while B > does not. > > When the renderbin of drawable A is set to be -1 and that of drawable B > is 1, the two textures cannot show at the same time. That is to say, > when I toggle on both drawable A and drawable B and make them both seen > on the screen, the texture on drawable B doesn't show, but the color of > B is correct. Under such circumstance, when I manipulate the view in a > way such that drawable A is out of sight, then the texture on drawable B > will appear. > > If I reverse the renderbins of those two drawables, then the textures > can show at the same time. > > I just cannot figure out why this happens. > > If it is due to depth test, why should such conflicts happen, since > they have no overlapped pixels on the screen? Even it is due to depth > test, why is the color correct? > > Would someone please be so kind enough as to explain that to me? > > Thanks millions in advance! > > Best regards > Shuiying > > ___ > 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