Re: [osg-users] Passing multiple textures in glsl

2011-06-21 Thread Sergey Polischuk
Hi, Linda ss-setTextureAttribute(1, tileImgLay); This line is actually does not do anything because default value for 3rd parameter is osg::StateAttribute::OFF You should use either ss-setTextureAttributeAndModes(1, tileImgLay); or ss-setTextureAttribute(1, tileImgLay,

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Linda Lee
Hi, I tried add these lines into my code: osg::Texture2DArray* tileImgLay; tileImgLay = new osg::Texture2DArray; tileImgLay-setTextureSize(128, 128, 2); tileImgLay-setUseHardwareMipMapGeneration(false); tileImgLay-setImage(0,

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Stephan Huber
Hi, Am 11.06.11 10:47, schrieb Linda Lee: and in the fragment shader: uniform sampler2DArray test; and access it using: gl_FragColor = texture2DArray(test, vec3(0, 0, 0)); Do you get any compile-error for your shader? I had to add these lines to get texure2DArrays

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Linda Lee
Hi, I did not get any compiler error. The application runs successfully. However, the texture did not seem to be loaded into the shader code. The image rendered as black in color. As the lines, Where should I add them? #version 120 #extension GL_EXT_gpu_shader4 : enable #extension

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Philip Taylor
] On Behalf Of Linda Lee Sent: 11 June 2011 09:48 To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Passing multiple textures in glsl Hi, I tried add these lines into my code: osg::Texture2DArray* tileImgLay; tileImgLay = new osg::Texture2DArray; tileImgLay

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Linda Lee
Hi, Nope. The typo is caused when I cut and paste into the posting textbox. I am quite sure the textures were loaded correctly. Any idea what is causing the problem? :( Thank you! Cheers, Linda -- Read this topic online here:

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Linda Lee
Hi, Forgot to mention to I have this msg when I run the application. Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,) Thank you! Cheers, Linda -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40375#40375

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Wojciech Lewandowski
, 2011 11:42 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Passing multiple textures in glsl Hi, Forgot to mention to I have this msg when I run the application. Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,) Thank you! Cheers, Linda

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Chris 'Xenon' Hanson
On 6/10/2011 11:04 PM, Linda Lee wrote: Hi, I need to handle multiple textures in glsl. Any suggestions how do I do it? Should I use sampler2DArray? How do I use it? Any links I could take reference from? Don't use 2DArray unless the textures really are related. Just use multiple

Re: [osg-users] Passing multiple textures in glsl

2011-06-11 Thread Paul Martz
On 6/11/2011 8:14 AM, Chris 'Xenon' Hanson wrote: Also, is there a limit to the amount of textures I could load into GPU. I tried loading 25 4096by4096 textures and it crashes when I tried to load more. Is there any ways to increase the amount that I could load? It's just limited by

[osg-users] Passing multiple textures in glsl

2011-06-10 Thread Linda Lee
Hi, I need to handle multiple textures in glsl. Any suggestions how do I do it? Should I use sampler2DArray? How do I use it? Any links I could take reference from? Also, is there a limit to the amount of textures I could load into GPU. I tried loading 25 4096by4096 textures and it