[osg-users] Setting the transform matrices
Robert Osfield
robert.osfield at gmail.com
Mon Oct 9 03:50:39 PDT 2017
Hi Chris,
I have now had an opportunity to try your example, it doesn't compile
against OSG master are some of the osgParticular API has changed, so I
built against the OSG-3.4 branch.
I have run with the various command 1-8 options and get different behaviour
but looking at the code I really don't know what is expected. The black cow
is likely occurring because no shader is being provided that handles texgen
that the cow.osg uses from the fixed function pipeline.
In OSG-3.4.x there isn't good automatic way to mix and match fixed function
and shader, the use of the vertex aliasing etc. also doesn't help matters.
It's an area where OpenGL drops us in it, it's either shaders or fixed
function, OpenGL provides no mapping for us to leverage, particularly when
building GL3/core profile or GLES2 where built ins't like glLight etc. have
no gl_Light uniforms associated with them like there is in GL2.
The OSG tries to walk between there two worlds - fixed function and shader
based, you can mix and match a bit but it's not seamless, and once you
start talking about GL3/core profule and GLES2 there's a whole heap more
things to deal with and you essentially have to build everything with your
own shaders.
So for your example, well you've written an test case that tries to walk
the line between fixed function and shader worlds and area that doesn't
isn't properly supported by OSG-3.4.
In the shader_pipeline branch of the OSG master there is some work that
attempts to bridge the gap between fixed function and shaders by providing
a solution for mapping fixed function state attributes to uniforms and
providing shader composition but it's a bleeding edge work in progress.
Getting a seamless mashup isn't a really tough nut to crack, but
shader_pipeline is our current best attempt at this.
For your own application you'll need to decide what your goals and
constraints are - if you have to support GL3/core profile and/or GLES2+
then you'll need to think about how you provide your own shaders and how
you remap fixed function models into your shader approach. Trying to
maship fixed function with shaders will likely cause problems though as
your test example shows, it's not a "bug" in the OSG that we can fix
though, rather you've stepped no-mans land which can't be properly
supported which different back-end completely i.e. shader_pipeline.
Robert.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20171009/82a75801/attachment-0001.html>
More information about the osg-users
mailing list