Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2017-01-30 Thread Sebastian Messerschmidt
Hello Ekaterinam, Thank you very much for your answers! Sebastian, according to your last answer, does it mean that it is also possible to project a texture on top of an object which has some other textures in it? Which unit for a texture should then I use? What I want to realize, is to

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2017-01-30 Thread Ekaterina Fokina
Thank you very much for your answers! Sebastian, according to your last answer, does it mean that it is also possible to project a texture on top of an object which has some other textures in it? Which unit for a texture should then I use? What I want to realize, is to mark on the terrain a

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-23 Thread Sebastian Messerschmidt
Hi Ekaterina: Hello, after checking more the forum, I have found another topic http://forum.openscenegraph.org/viewtopic.php?t=9182=jotschi with the following code, which I have slightly modified. I would be very grateful, if someone can explain to me why the basic model is black and how

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-23 Thread Ekaterina Fokina
Hello, after checking more the forum, I have found another topic http://forum.openscenegraph.org/viewtopic.php?t=9182=jotschi with the following code, which I have slightly modified. I would be very grateful, if someone can explain to me why the basic model is black and how to avoid it? Or

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-22 Thread Glenn Waldron
Ekaterina, The model you are loading has a lot of state in it, like blending, textures, etc. When you use a shader to render it, your shader needs to support all the things that OSG would otherwise render using the GL fixed-function pipeline. For example, the texture does not show up because your

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-22 Thread Trajce Nikolov NICK
Hi Ekaterina, post your code ... We can fix it when time permits ;-) On Thu, Dec 22, 2016 at 4:27 PM, Christian Buchner < christian.buch...@gmail.com> wrote: > Just some wild guesses: > > You might have to enable blending in the state set, and set an appropriate > blend function as (depending

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-22 Thread Christian Buchner
Just some wild guesses: You might have to enable blending in the state set, and set an appropriate blend function as (depending on whether your projective texturing is done in a 2nd render pass or not) On hardware that does not support opengl border colors (ARB_texture_border_clamp) in hardware,

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-22 Thread Ekaterina Fokina
Thank you your answers! Attached there is a printscreen what I get. For the terrain I am using lz.osgt and the image for the texture file is osg128.png. I set the border to transparent, but unfortunatelly it didnĀ“t help... Guys, could you please give me a hint how is it possible to relocate

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-21 Thread Voerman, L.
Hi Ekaterina, seems to me it is working properly, although it does not give you the result you want. The black surrounding is just a combination of the texture coordinates going out of range combined with a CLAMP_TO_BORDER wrapping. the numbers in gl_TextureMatrix[1] are the texture units - the

Re: [osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-21 Thread Glenn Waldron
Ekaterina, You might try setting your texture border color to transparent. texture->setBorderColor(osg::Vec4(0,0,0,0)); The index in gl_TextureMatrix[1] is the texture image unit; it should match the slot you specified in your call to stateset->setTextureAttributeAndModes(1, texMat,

[osg-users] Texture projection on terrain and gl_TextureMatrix[0...7]

2016-12-21 Thread Ekaterina Fokina
Hello, I am trying to understand how to project a texture on a specific part of the terrain. There are many examples how to project a texture on a whole object, but not to a part of the oblect. That means the question is how to specify texture coordinates (using the shader) on order to project