Show differencesHistory of post edits
Posted 13 January 2013 - 03:54 AM
Interesting, I was not aware we could do preprocessor #if. Is this a GLSL feature or you need to parse your shader and string edit it?
This has the bonus of removing code that is not needed for non skinned objects and may speed up your application a little.
Otherwise you can do it on the CPU during your programs initialization. If you have access to the raw vertex array data before it enters OpenGL then I'd simply change the values there to zero (EDIT : or remove them entirely!)
I agree but unless I’m missing something, while these seems to be valid solutions, it will make the unique shader concept collapse as we might alternate the skinning condition every draw.
Otherwise you would need to access it from OpenGL using a function like "glMapBuffer" and changing the values from there
This seems to be to most logical direction. The shader uses glBufferSubData for the vertex attributes, I’ll have to investigate glMapBuffer… this is puzzling. Thanks again for your inputs Nyssa.