Changeset 11654

Show
Ignore:
Timestamp:
06/24/10 19:15:27 (4 years ago)
Author:
robert
Message:

Added beginnings of shader composition with the shells of the ShaderComposer? and ShaderAttribute? classes. This aren't
functional yet, but a useful placeholders for future fucntionality.

Location:
OpenSceneGraph/trunk
Files:
3 added
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/State

    r11565 r11654  
    2222#include <osg/Observer> 
    2323 
     24#include <osg/ShaderComposer> 
    2425#include <osg/FrameStamp> 
    2526#include <osg/DisplaySettings> 
     
    141142        inline unsigned int getContextID() const { return _contextID; } 
    142143 
     144 
     145        /** Set the ShaderComposor object that implements shader composition.*/ 
     146        void setShaderComposer(ShaderComposer* sc) { _shaderComposer = sc; } 
     147 
     148        /** Get the ShaderComposor object.*/ 
     149        ShaderComposer* getShaderComposer() { return _shaderComposer.get(); } 
     150 
     151        /** Get the const ShaderComposor object.*/ 
     152        const ShaderComposer* getShaderComposer() const { return _shaderComposer.get(); } 
     153 
     154 
    143155        /** Push stateset onto state stack.*/ 
    144156        void pushStateSet(const StateSet* dstate); 
     
    13401352        GraphicsContext*            _graphicsContext; 
    13411353        unsigned int                _contextID; 
     1354        osg::ref_ptr<ShaderComposer> _shaderComposer; 
     1355 
    13421356        ref_ptr<FrameStamp>         _frameStamp; 
    13431357 
  • OpenSceneGraph/trunk/include/osg/StateAttribute

    r10671 r11654  
    3636class NodeVisitor; 
    3737class State; 
     38class ShaderComposer; 
    3839class StateSet; 
    3940class Texture; 
     
    316317        virtual void apply(State&) const {} 
    317318 
     319        /* compose associated shaders via the ShaderComposer. */ 
     320        virtual void compose(ShaderComposer& composer) const {} 
     321 
    318322        /** Default to nothing to compile - all state is applied immediately. */ 
    319323        virtual void compileGLObjects(State&) const {} 
  • OpenSceneGraph/trunk/src/osg/CMakeLists.txt

    r11431 r11654  
    138138    ${HEADER_PATH}/ShadeModel 
    139139    ${HEADER_PATH}/Shader 
     140    ${HEADER_PATH}/ShaderAttribute 
     141    ${HEADER_PATH}/ShaderComposer 
    140142    ${HEADER_PATH}/ShadowVolumeOccluder 
    141143    ${HEADER_PATH}/Shape 
     
    302304    ShadeModel.cpp 
    303305    Shader.cpp 
     306    ShaderAttribute.cpp 
     307    ShaderComposer.cpp 
    304308    ShadowVolumeOccluder.cpp 
    305309    Shape.cpp 
  • OpenSceneGraph/trunk/src/osg/State.cpp

    r11641 r11654  
    4242    _graphicsContext = 0; 
    4343    _contextID = 0; 
     44 
     45    _shaderComposer = new ShaderComposer; 
     46 
    4447    _identity = new osg::RefMatrix(); // default RefMatrix constructs to identity. 
    4548    _initialViewMatrix = _identity;