Hello Johannes,

On Sun, Dec 8, 2013 at 10:06 PM, Johannes Scholz <osg-supp...@vtxtech.net>wrote:

> Hi Robert,
>
> thanks for your answer. I agree with you for most applications.
>
> Now the thing is, we are currently adding a simple text-based Shader
> Editor in our application. So while writing the shader the developer will
> change uniform names almost for certain. Now the developer will not
> understand why to create a new uniform having the same values when one
> would expect a rename feature like let's say in RenderMonkey.
>
> But as said, I will work around it, internally copying the data of the
> uniform when "Rename" is requested from our User Interface.
>


In my opinion, if you are building an editor, you shouldn't rely on the
scenegraph that is used to preview your shaders as the primary data storage
solution. You should keep your own internal data structures that allow you
to make an efficient UI and then generate the scenegraph from that for
preview. In that case the entire problem with uniforms wouldn't even arise,
because you would be creating a new object, not renaming an old one.

OSG cannot really rename an uniform, because the OpenGL API doesn't have
that feature neither. You can only create one or delete it. What you are
basically asking for is that OSG internally creates a new object with a new
name for you, copy the data and delete the old one, while pretending that
it is renaming the old one - essentially implementing some logic that makes
sense only for UI, not for OpenGL.

J.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to