24#include <util/coExport.h>
30#include <osg/Drawable>
56 std::string textureFile;
57 std::string cubeMapFiles[6];
153 coVRAttribute(
const std::string &name,
const std::string &type,
const std::string &value);
161 std::list<osg::ref_ptr<osg::Uniform> > uniforms;
162 osg::Drawable *myDrawable;
181 std::string fileName;
184 std::list<coVRUniform *> uniforms;
185 std::list<coVRAttribute *> attributes;
186 std::list<coVRShaderInstance *> instances;
187 osg::ref_ptr<osg::Shader> fragmentShader;
188 osg::ref_ptr<osg::Shader> geometryShader;
189 osg::ref_ptr<osg::Shader> vertexShader;
190 osg::ref_ptr<osg::Shader> tessControlShader;
191 osg::ref_ptr<osg::Shader> tessEvalShader;
192 osg::ref_ptr<osg::Program> program;
214 return fragmentShader;
218 return geometryShader;
226 return tessControlShader;
230 return tessEvalShader;
238 return geomParams[0];
242 return geomParams[1];
246 return geomParams[2];
282 void loadMaterials();
283 std::vector<osg::ref_ptr<osg::Uniform>> lightEnabled;
284 osg::ref_ptr<osg::Uniform> timeUniform;
285 osg::ref_ptr<osg::Uniform> timeStepUniform;
286 osg::ref_ptr<osg::Uniform> lightMatrix;
287 osg::ref_ptr<osg::Uniform> projectionMatrix;
288 osg::ref_ptr<osg::Uniform> viewMatrix;
289 osg::ref_ptr<osg::Uniform> durationUniform;
290 osg::ref_ptr<osg::Uniform> viewportWidthUniform;
291 osg::ref_ptr<osg::Uniform> viewportHeightUniform;
292 osg::ref_ptr<osg::Uniform> stereoUniform;
293 void applyParams(
coVRShader *shader, std::map<std::string, std::string> *params);
296 coVRShader *
get(
const std::string &name, std::map<std::string, std::string> *params = NULL);
336 virtual osg::Object *
clone(
const osg::CopyOp &)
const;
382 const osg::Array *vx,
383 const osg::Array *nx,
384 int iA,
int iB,
int iC);
386 osg::ref_ptr<osg::Vec4Array>
T_;
387 osg::ref_ptr<osg::Vec4Array>
B_;
388 osg::ref_ptr<osg::Vec4Array>
N_;
Definition: ARToolKit.h:33
@ Right
Definition: MultiChannelDrawer.h:31
@ Left
Definition: MultiChannelDrawer.h:30
Definition: coClusterStat.h:29
Definition: coTabletUI.h:51
Definition: coVRShader.h:47
coVRUniform(const coVRShader *shader, const std::string &name, const std::string &type, const std::string &value)
void setValue(osg::Vec4 v)
osg::ref_ptr< osg::Texture > texture
Definition: coVRShader.h:126
void setValue(osg::Vec3 v)
const std::string & getMin() const
Definition: coVRShader.h:76
osg::ref_ptr< osg::Uniform > uniform
Definition: coVRShader.h:125
void setMin(const std::string &m)
Definition: coVRShader.h:92
bool doOverwrite() const
Definition: coVRShader.h:117
void setOverwrite(bool o)
Definition: coVRShader.h:100
const std::string & getValue() const
Definition: coVRShader.h:72
void setUnique(bool u)
Definition: coVRShader.h:104
void setValue(osg::Matrixd m)
void setValue(const char *value)
osg::Texture::WrapMode getWrapMode() const
void setValue(osg::Matrixf m)
const std::string & getTextureFileName() const
Definition: coVRShader.h:84
void setWrapMode(std::string wm)
const std::string & getType() const
Definition: coVRShader.h:68
const std::string * getCubeMapFiles() const
Definition: coVRShader.h:88
const std::string & getMax() const
Definition: coVRShader.h:80
void setTexture(const char *textureFile, int texNum=0)
const std::string & getName() const
Definition: coVRShader.h:63
void setMax(const std::string &m)
Definition: coVRShader.h:96
bool isUnique() const
Definition: coVRShader.h:121
Definition: coVRShader.h:133
const std::string & getName()
Definition: coVRShader.h:141
coVRAttribute(const std::string &name, const std::string &type, const std::string &value)
const std::string & getType()
Definition: coVRShader.h:145
const std::string & getValue()
Definition: coVRShader.h:149
Definition: coVRShader.h:158
void addUniform(const osg::Uniform &u)
virtual ~coVRShaderInstance()
std::list< osg::ref_ptr< osg::Uniform > > & getUniforms()
Definition: coVRShader.h:168
osg::Uniform * getUniform(const std::string &name)
coVRShaderInstance(osg::Drawable *d)
Definition: coVRShader.h:176
coVRShaderInstance * apply(osg::Geode *geode, osg::Drawable *drawable)
void setVec3Uniform(const std::string &name, osg::Vec3 v)
void setBoolUniform(const std::string &name, bool b)
osg::ref_ptr< osg::Shader > & getTessEvalShader()
Definition: coVRShader.h:228
void setMatrixUniform(const std::string &name, osg::Matrixd m)
coVRShaderInstance * apply(osg::Node *)
int getNumVertices()
Definition: coVRShader.h:236
osg::ref_ptr< osg::Shader > & getGeometryShader()
Definition: coVRShader.h:216
void setMatrixUniform(const std::string &name, osg::Matrixf m)
std::string findAsset(const std::string &path) const
int getInputType()
Definition: coVRShader.h:240
osg::ref_ptr< osg::Program > & getProgram()
Definition: coVRShader.h:232
bool isTransparent()
Definition: coVRShader.h:204
void setVec4Uniform(const std::string &name, osg::Vec4 v)
std::list< coVRUniform * > & getUniforms()
Definition: coVRShader.h:208
osg::Uniform * getUniform(const std::string &name)
void setData(covise::TokenBuffer &tb)
const std::string & getName()
Definition: coVRShader.h:200
osg::ref_ptr< osg::Shader > & getVertexShader()
Definition: coVRShader.h:220
void setFloatUniform(const std::string &name, float f)
coVRShader(const coVRShader &other)
bool isClone()
Definition: coVRShader.h:248
void apply(osg::StateSet *)
coVRShader(const std::string &name, const std::string &d)
int getOutputType()
Definition: coVRShader.h:244
osg::ref_ptr< osg::Shader > & getTessControlShader()
Definition: coVRShader.h:224
void setUniformesFromAttribute(const char *uniformValues)
osg::ref_ptr< osg::Shader > & getFragmentShader()
Definition: coVRShader.h:212
Definition: coVRShader.h:278
coVRShader * getUnique(const std::string &n, std::map< std::string, std::string > *params=NULL)
osg::Uniform * getTimeStep()
osg::Uniform * getLightEnabled(size_t lightnum)
osg::Uniform * getStereo()
osg::Uniform * getProjection()
coVRShader * add(const std::string &name, std::string &dirName)
osg::Uniform * getViewportWidth()
static coVRShaderList * instance()
void setData(covise::TokenBuffer &tb)
osg::Uniform * getDuration()
coVRShader * get(const std::string &name, std::map< std::string, std::string > *params=NULL)
osg::Uniform * getViewportHeight()
osg::Uniform * getLight()
Definition: coVRShader.h:318
virtual osg::Object * cloneType() const
static ShaderNode * theNode
Definition: coVRShader.h:328
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
StereoView
Definition: coVRShader.h:322
virtual osg::Object * clone(const osg::CopyOp &) const
StereoView view
Definition: coVRShader.h:337
Definition: coVRShader.h:355
void generate(osg::Geometry *geo)
void setNormalArray(osg::Vec4Array *array)
Definition: coVRShader.h:368
const osg::Vec4Array * getBinormalArray() const
Definition: coVRShader.h:371
const osg::Vec4Array * getTangentArray() const
Definition: coVRShader.h:363
coTangentSpaceGenerator()
osg::Vec4Array * getTangentArray()
Definition: coVRShader.h:362
osg::Vec4Array * getNormalArray()
Definition: coVRShader.h:366
void setBinormalArray(osg::Vec4Array *array)
Definition: coVRShader.h:372
osg::ref_ptr< osg::Vec4Array > T_
Definition: coVRShader.h:386
const osg::Vec4Array * getNormalArray() const
Definition: coVRShader.h:367
void compute(osg::PrimitiveSet *pset, const osg::Array *vx, const osg::Array *nx, int iA, int iB, int iC)
osg::IndexArray * getIndices()
Definition: coVRShader.h:374
osg::ref_ptr< osg::Vec4Array > B_
Definition: coVRShader.h:387
void setTangentArray(osg::Vec4Array *array)
Definition: coVRShader.h:364
coTangentSpaceGenerator & operator=(const coTangentSpaceGenerator &)
Definition: coVRShader.h:379
osg::ref_ptr< osg::Vec4Array > N_
Definition: coVRShader.h:388
coTangentSpaceGenerator(const coTangentSpaceGenerator ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
virtual ~coTangentSpaceGenerator()
Definition: coVRShader.h:378
osg::ref_ptr< osg::UIntArray > indices_
Definition: coVRShader.h:389
osg::Vec4Array * getBinormalArray()
Definition: coVRShader.h:370