Re: [osg-users] Texturing with GLBeginEndAdapter

2016-12-29 Thread tianzjyh
Hi, I checked again about the function "State::setActiveTextureUnit()", and it seems like it's designed to be called inside the class "State" but not for users's calling. So to enable the GL_TEXTURE_2D mode, and to make a specified unit to be the current, you can use

Re: [osg-users] [build] x86_64, cmd line, built OK - but warning in Xcode

2016-12-29 Thread Hartwig Wiesmann
Hi, I know that these compiler warnings are not critical but I find them still annoying and I think it is also not a good programming style to use the "wrong" integer type. I also know that a simple modification might break some code (especially for virtual methods). But wouldn't it be in

Re: [osg-users] Tearing hair out over simple GLSL instancing

2016-12-29 Thread Andrew Cunningham
Hi guys, Can you help me out with this one more time:) As I said, I am now able to draw my geometry ( a simple square) using hardware instancing. It works perfectly with excellent performance for millions of squares- except for one thing. Now I want to light the squares. I have turned on

Re: [osg-users] Check if sampler2D is valid in fragment shader

2016-12-29 Thread Sebastian Messerschmidt
Am 29.12.2016 um 17:07 schrieb Rômulo Cerqueira: Hi Christian, You could traverse the scene graph and check the state sets to see if they bind a texture to a texture unit. Then depending on these findings, choose the correct shader code. I appreciated it. Can you give me some example?

Re: [osg-users] Check if sampler2D is valid in fragment shader

2016-12-29 Thread Rômulo Cerqueira
Hi Christian, > You could traverse the scene graph and check the state sets to see if they > bind a texture to a texture unit. > > Then depending on these findings, choose the correct shader code. I appreciated it. Can you give me some example? ... Thank you! Cheers, Rômulo

Re: [osg-users] Texturing with GLBeginEndAdapter

2016-12-29 Thread Aaron Andersen
Hello TanZJ, Thank you for the information. I don't think I quite understood your intention though. I apologize if this is obvious but as I said my OpenGL skills are lacking... Here is my code after applying your suggestion about applying the texture to the state: class MyDrawable {

Re: [osg-users] Check if sampler2D is valid in fragment shader

2016-12-29 Thread Christian Buchner
> I will receive the final scene with or without textures You could traverse the scene graph and check the state sets to see if they bind a texture to a texture unit. Then depending on these findings, choose the correct shader code. Christian ___

Re: [osg-users] Texturing with GLBeginEndAdapter

2016-12-29 Thread tianzjyh
Hi, Andersen, Let's say you have three images, then you can wrap them using osg::Texture2D, something like this: > >osg::Image* image0 = osgDB::readImageFile("filename0.xxx"); >osg::Texture2D* tex0 = new osg::Texture2D(image0); >tex1->setWrap(..., ...); >tex1->setFilter(..., ...); > And

Re: [osg-users] Capture image on iOS get black image

2016-12-29 Thread duc nguyen
Dear Raymond, Yes, your right. But I am mentioning about glReadPixels, not glReadBuffer() I've tested using SnapImageDrawCallback class on Windows OS and it done to create a screenshot of osgviewer, but on iOS it still return black image reedev wrote: > Dear Duc, > > If you read your own

Re: [osg-users] Texturing with GLBeginEndAdapter

2016-12-29 Thread Alberto Luaces
Aaron Andersen writes: > I've created a subclass to the Drawable class called "MyDrawable". In > the drawImplementation function I'm have a couple > gl.Begin(GL_QUADS)/gl.End() calls to draw 3 simple rectangles. I'm > unsure of how to apply 3 separate textures to these 3 rectangles. From >