[osg-users] using modern shaders with osg - setting vertex attribute layout

antiro black antiro42 at gmail.com
Sat Sep 2 03:25:49 PDT 2017


Hi,

When using the shaders to render only one of  color/normal/position to a normal viewer/camera (not to a texture) they all seem to work.

I continued to modify a small MRT example which used older shader code which relied on gl_Vertex / gl_Normal etc. The moment I added a setUseVertexAttributeAliasing(true) it stopped working even with changes to the shader which replaced gl_Vertex with osg_Vertex etc.

I could not find any MRT / deferred rendering code online which uses more modern glsl and setUseVertexAttributeAliasing(true).

<b>My main question now is</b>: Do you (or anyone else) happen to have some example code for multi-target rendering which uses setUseVertexAttributeAliasing(true) ?

In response to ckuliukas: Is that really the official advice? My other project was already using modern GLSL and can't be converted back to ancient glsl easily (nor do I want to). Perhaps I'll have a look at your suggestion if all else fails. I'm still hoping I can reuse the existing shaders with minimal changes. 

In general my experience with OSG is that the code is well organized and pretty easy to read, however there is a real lack of documentation, both with regards to comments in the code and in the form of an (up to date) wiki / manual / etc. I don't mind a learning curve, but I have no idea where to start. Reading through the osg quick start guide didn't get me anywhere and the few recipes in the OSG cookbook which touched upon more advanced opengl using shaders were using ancient GLSL code. If anyone has some advice with regards to other learning resources focussed on more advanced usage that would be very helpful.

Thanks in advance!

Cheers,
antiro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71602#71602







More information about the osg-users mailing list