VR-Forces Developer's Guide
 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvMath/DtCommonTypes.h>
15 
17 
18 #include <osg/StateAttribute>
19 
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;
34 
37  {
38  private:
40  DtOsgShaderUtils() = delete;
41 
43  DtOsgShaderUtils(const DtOsgShaderUtils& rhs) = delete;
44 
46  DtOsgShaderUtils& operator = (const DtOsgShaderUtils& rhs) = delete;
47 
49  virtual ~DtOsgShaderUtils() = delete;
50 
51  public:
52 
58  static bool getVPShaderVector(osg::StateSet *ss, osg::State& state, unsigned int &shaderHash,
59  std::vector<unsigned int> &vertShaderVector, std::vector<unsigned int> &fragShaderVector, bool skipShadowShaders, bool skipMultiViewShaders);
60 
62  static bool addDegenerateShadersIfNeeded(osg::StateSet *ss, osg::State& state,
63  std::vector<unsigned int> &vertShaderVector, std::vector<unsigned int> &fragShaderVector, bool skip_shadow_shaders = false);
64 
65  static void restoreEverything(osg::State& state);
66 
68  static void restoreOpenGLMode(const osg::State& state, int stateToSet);
69 
71  static void restoreOpenGLStateAttribute(osg::State& state, osg::StateAttribute::Type type);
72 
74  static void restoreOpenGLProgram(const osg::State& state);
75 
77  static void restoreOpenGLFBO(const osg::State& state);
78 
80  static void markAllTextureAttributesDirty(osg::State & state);
81 
86  static void generateModelInstanceShaders(osg::Node *node, const std::string& shaderName);
87  };
88 }
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Contains makVrv::DtVirtualBaseClass class.
Miscellaneous shader utilities for osg.
Definition: DtOsgShaderUtils.h:36
Contains DLL export macros.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)