Introduced new shader composition approach that utilizes #pragma requires(), #pragma import_defines() and #ifdef in GLSL to enable multiple different versions of shaders based

on defines passed in from osg::StateSet::setDefine(..).



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14681 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2015-02-10 17:04:02 +00:00
parent bb637e73f3
commit b90503fdf5
14 changed files with 910 additions and 175 deletions

View File

@@ -389,6 +389,7 @@ class DrawElements : public PrimitiveSet
/** Get the const ElementBufferObject. If no EBO is assigned returns NULL*/
inline const osg::ElementBufferObject* getElementBufferObject() const { return dynamic_cast<const osg::ElementBufferObject*>(_bufferObject.get()); }
virtual GLenum getDataType() = 0;
virtual void resizeElements(unsigned int numIndices) = 0;
virtual void reserveElements(unsigned int numIndices) = 0;
virtual void setElement(unsigned int, unsigned int) = 0;
@@ -446,6 +447,7 @@ class OSG_EXPORT DrawElementsUByte : public DrawElements, public VectorGLubyte
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
virtual void offsetIndices(int offset);
virtual GLenum getDataType() { return GL_UNSIGNED_BYTE; }
virtual void resizeElements(unsigned int numIndices) { resize(numIndices); }
virtual void reserveElements(unsigned int numIndices) { reserve(numIndices); }
virtual void setElement(unsigned int i, unsigned int v) { (*this)[i] = v; }
@@ -509,6 +511,7 @@ class OSG_EXPORT DrawElementsUShort : public DrawElements, public VectorGLushort
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
virtual void offsetIndices(int offset);
virtual GLenum getDataType() { return GL_UNSIGNED_SHORT; }
virtual void resizeElements(unsigned int numIndices) { resize(numIndices); }
virtual void reserveElements(unsigned int numIndices) { reserve(numIndices); }
virtual void setElement(unsigned int i, unsigned int v) { (*this)[i] = v; }
@@ -572,6 +575,7 @@ class OSG_EXPORT DrawElementsUInt : public DrawElements, public VectorGLuint
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
virtual void offsetIndices(int offset);
virtual GLenum getDataType() { return GL_UNSIGNED_INT; }
virtual void resizeElements(unsigned int numIndices) { resize(numIndices); }
virtual void reserveElements(unsigned int numIndices) { reserve(numIndices); }
virtual void setElement(unsigned int i, unsigned int v) { (*this)[i] = v; }