Hello Vincenzo,

Vincenzo Marafioti wrote:
> Hello to all,
> I am trying to port some methods of a pure openGL/Glsl  project in a 
> OpenSG one.

does that mean you are ok with replacing the pure OpenGL code with 
OpenSG code?

> In the OpenGL part, i will write some texture usign Multi 
> Render Target and GLSL. Those textures have been created and used in the 
> following way:
> 
[SNIP - code]
> 
> The OpenSG shader has been correctly attached.
> Is this a correct way for passing texture from openGL to OpenSG if it is 
> supposed to be possible? (i read that is not a good idea to mix them...).

the "not a good idea to mix" probably was referring to making calls to 
glGenTextures, but that is probably not such a problem any more (OpenSG 
used to have its own way of coming up with OpenGL ids, instead of 
allocating them from the GL).
However, since OpenSG does not know about the textures you created 
yourself (meaning there are no OpenSG objects representing them), the 
state handling can not manage them. In other words you can not really 
pass state from pure OpenGL to OpenSG, the other way around is possible 
though.

> The problem is that the OpenSG shader do not "always" seems to  read the 
> correct value from the texture and so it do not work properly.

I suspect that is because your textures may or may not be enabled 
depending on what else is happening in your scene and what other 
materials/state is being changed.

> The OpenGL context and the OpenSG one are the same.
> Any clue about it?

It seems you are using OpenSG 1.8, where you'd create an FBOViewport and 
some TextureChunks to write the multiple render targets. You then add 
the same TextureChunks to the material that also holds your SHLChunk and 
set the uniform variables as above.
Let us know if you need more details on any of these steps.

        Cheers,
                Carsten

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to