VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgShaderUtils.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
16 
17 #include <boost/unordered_map.hpp>
18 
19 #include <osg/StateAttribute>
20 
21 // forward declarations
22 namespace osg
23 {
24  class State;
25  class StateSet;
26  class Texture;
27  class Node;
28  class Uniform;
29 }
30 
31 namespace makVrv
32 {
33  class DtOsgFileCache;
35  {
37  int location;
38  int modCount;
39  void * uniform;
40  };
41  typedef boost::unordered_map<unsigned int, CachedUniformData > UniformLocationMap;
42  typedef boost::unordered_map<int, UniformLocationMap> ShaderUniLocMap;
43 
45  {
46 
47  public:
52  static void bindAttributes(const osg::GLExtensions * ext, const osg::StateSet *ss, int shader, int contextID);
53 
59  static bool getVPShaderVector(osg::StateSet *ss, osg::State& state, unsigned int &shaderHash,
60  std::vector<unsigned int> &vertShaderVector, std::vector<unsigned int> &fragShaderVector, bool skip_shadow_shaders = false);
61 
63  static bool addDegenerateShadersIfNeeded(osg::StateSet *ss, osg::State& state,
64  std::vector<unsigned int> &vertShaderVector, std::vector<unsigned int> &fragShaderVector, bool skip_shadow_shaders = false);
65 
66  static void restoreEverything(osg::State& state);
67 
68  static void restoreOpenGLMode(osg::State& state, int stateToSet);
69  static void restoreOpenGLStateAttribute(osg::State& state, osg::StateAttribute::Type type);
70  static void restoreOpenGLProgram(osg::State& state);
71  static void restoreOpenGLFBO(osg::State& state);
72  static void markAllTextureAttributesDirty(osg::State & state);
73 
78  static void generateModelInstanceShaders(osg::Node *node, const std::string& shaderName);
79 
81  static unsigned getNumGPUTextureImageUnits();
82 
83 
84  private:
85 
90  };
91 
92 
93 
94 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)