Hello Carsten,

On 30.03.2014 11:22, Carsten Neumann wrote:
>
> - would it be possible to derive UniformBufferObjStd140Chunk from
> UniformBufferObjChunk to share some code (perhaps by adding a virtual
> updateBuffer() function that gets called from handleGL)? Not sure if
> it's worth the effort.

No, I think that this is not worth the effort. IMHO it also seems not 
quite correct to me. Both classes do not share that much of their 
interfaces. The introduction of a common ancestor is not a free launch 
either.

> - in OSGGLEXT.h the #defines osgMaxUniformBlockSize etc. should be
> outside #ifndef GL_ARB_uniform_buffer_object, otherwise if you have a GL
> header on your system that already knows about the extension you don't
> get the OpenSG defines. [1]

Good catch...

> - it might be convenient to have a templated add and set function in
> UniformBufferObjChunk to avoid having to repeat the type in the function
> name.

At first I have also thought into this direction. But I came to the 
conclusion that this is the wrong approach. The types in the function 
names are not the C++ types but they represent the GLSL types. I think 
that it is better to state this fact in the function names than to hide 
it in a templated interface. Additionally, the addXXX methods do 
correspond to setXXX methods. I could have bring the FundamentalTypes 
and MainType as parameters into one 'add' and one 'set' method. But this 
is much more harder to understand for the user.

However, I could have templated the setXXX methods with respect to the 
Vec3f, Pnt3f, Color3f parameter types but would I have gained that much 
here?

So, in conclusion if I could decide, I would do it the same way again, 
sorry :-(.


> Thanks for working on the UBO support!

I would really like to see more modern GL approaches represented in 
OpenSG. I have learned a lot in this undertaking and I hope that I get 
the chance for further enhancements.

How do we proceed now with the UBO? I.e. what should I do to get them 
finally into the OpenSG repository?

Best,
Johannes





------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to