VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProjected2DFlatEffect.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 <vrvGraphics/Dt2DEffect.h>
13 
14 namespace makVrv
15 {
16 
20  {
21  public:
22 
24  DtProjected2DFlatEffect(const std::string& dataPath, const std::string& defines);
25 
27  virtual ~DtProjected2DFlatEffect();
28 
30  virtual void releaseResources() override;
31 
34  virtual void setCamera( bool geocentric, float occluded,
35  const double position[3]
36  , const double positionMatrix[16]
37  , const double projectionMatrix[16]
38  , const int viewport[4]) override;
39 
40  //Set the number of groups.
41  virtual void setGroupCount( unsigned int count ) override;
42 
43  // Enables or disables the stipple pattern.
44  // \param enable - enables or disables the use of stipple
45  // \param stipplePattern - an array of 32 unsigned int values representing the stipple bit pattern
46  // \param tileRate - (0.0 - 1.0) the rate to tile the stipple pattern (min/max in shader)
47  virtual void setStipple(bool enable,
48  const unsigned int* stipplePattern, float tileRate);
49 
50  // Sets the given attributes to the OpenGL context.
51  virtual void setVertexAttribPointers( size_t stride,
52  const VertexAttribPtrInfo& positionAddress,
53  const VertexAttribPtrInfo& colorAddress,
54  const VertexAttribPtrInfo& offsetAddress,
55  const VertexAttribPtrInfo& rotationAddress );
56 
58  virtual void unsetVertexAttribPointers();
59 
60  protected:
61 
63  virtual void updateUniformLocations() override;
64 
66  virtual void updateUniforms() override;
67 
69  virtual void initializeShaderSource() override;
70 
71  virtual void updateOtherUniforms();
72 
73  protected:
74 
83 
84  unsigned int myUnit;
85  unsigned int myGroupCount;
86  double myCameraPos[3];
87  double myMatrix[16];
88  double myProjectionMatrix[16];
91 
92  struct StippleKey
93  {
94  unsigned int key[32];
95  bool operator<(const StippleKey& b) const;
96  };
97 
98  typedef std::map< StippleKey, int > StippleTextureMap;
100  };
101 
102 
106  {
107  public:
108 
109  virtual DtEffect* create(const std::string& dataPath, const std::string& defines, CreateParameters* params = 0)
110  {
111  return new DtProjected2DFlatEffect(dataPath, defines);
112  }
113 
114  };
115 
116 }
int myUniform_Sphere
Definition: DtProjected2DFlatEffect.h:79
Contains the makVrv::Dt2DEffect class declaration.
Abstract creator class for registering effects with a effects manager.
Definition: DtEffect.h:108
bool myGeocentricFlag
Definition: DtProjected2DFlatEffect.h:89
int myUniform_OccludedAlpha
Definition: DtProjected2DFlatEffect.h:80
StippleTextureMap myStippleTextureMap
Definition: DtProjected2DFlatEffect.h:99
A creator class for the Projected 2D flag quad effect.
Definition: DtProjected2DFlatEffect.h:105
float myGeocentricAlpha
Definition: DtProjected2DFlatEffect.h:90
int myUniform_CameraPos
Definition: DtProjected2DFlatEffect.h:75
Definition: DtProjected2DFlatEffect.h:92
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
virtual DtEffect * create(const std::string &dataPath, const std::string &defines, CreateParameters *params=0)
Definition: DtProjected2DFlatEffect.h:109
std::map< StippleKey, int > StippleTextureMap
Definition: DtProjected2DFlatEffect.h:98
int myUniform_CameraMat
Definition: DtProjected2DFlatEffect.h:76
int myUniform_ProjectionMat
Definition: DtProjected2DFlatEffect.h:77
Definition: DtEffect.h:24
int myUniform_Stipple
Definition: DtProjected2DFlatEffect.h:81
The base class for a programmable pipeline render effect.
Definition: DtEffect.h:20
The 2D effect is an abstract interface for effects used to render in 2D.
Definition: Dt2DEffect.h:19
An effect for rendering 2D flat colored quads.
Definition: DtProjected2DFlatEffect.h:19
int myUniform_Tex
Definition: DtProjected2DFlatEffect.h:82
unsigned int myUnit
Definition: DtProjected2DFlatEffect.h:84
unsigned int myGroupCount
Definition: DtProjected2DFlatEffect.h:85
int myUniform_GroupCount
Definition: DtProjected2DFlatEffect.h:78

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)