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 
39  virtual void setCamera( bool geocentric, float occluded,
40  const double position[3]
41  , const double positionMatrix[16]
42  , const double projectionMatrix[16]
43  , const int viewport[4]) override;
44 
45  //Set the number of groups.
46  virtual void setGroupCount( unsigned int count ) override;
47 
48  // Enables or disables the stipple pattern.
49  // \param enable - enables or disables the use of stipple
50  // \param stipplePattern - an array of 32 unsigned int values representing the stipple bit pattern
51  // \param tileRate - (0.0 - 1.0) the rate to tile the stipple pattern (min/max in shader)
52  virtual void setStipple(bool enable,
53  const unsigned int* stipplePattern, float tileRate);
54 
55  // Sets the given attributes to the OpenGL context.
56  virtual void setVertexAttribPointers( size_t stride,
57  const VertexAttribPtrInfo& positionAddress,
58  const VertexAttribPtrInfo& colorAddress,
59  const VertexAttribPtrInfo& offsetAddress,
60  const VertexAttribPtrInfo& rotationAddress );
61 
63  virtual void unsetVertexAttribPointers();
64 
67  virtual void setIsNormalisedScreenCoordinates( bool isNormalisedScreenCoords );
68  protected:
69 
71  virtual void updateUniformLocations() override;
72 
74  virtual void updateUniforms() override;
75 
77  virtual void initializeShaderSource() override;
78 
79  virtual void updateOtherUniforms();
80 
81  protected:
82 
92 
93  unsigned int myUnit;
94  unsigned int myGroupCount;
95  double myCameraPos[3];
96  double myMatrix[16];
97  double myProjectionMatrix[16];
98  double myChannelWidthHeight[2];
102 
103  struct StippleKey
104  {
105  unsigned int key[32];
106  bool operator<(const StippleKey& b) const;
107  };
108 
109  typedef std::map< StippleKey, int > StippleTextureMap;
111  };
112 
113 
117  {
118  public:
119 
120  virtual DtEffect* create(const std::string& dataPath, const std::string& defines, CreateParameters* params = 0)
121  {
122  return new DtProjected2DFlatEffect(dataPath, defines);
123  }
124 
125  };
126 
127 }
int myUniform_Sphere
Definition: DtProjected2DFlatEffect.h:87
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:100
bool myIsNormalisedScreenCoords
Definition: DtProjected2DFlatEffect.h:99
int myUniform_OccludedAlpha
Definition: DtProjected2DFlatEffect.h:88
StippleTextureMap myStippleTextureMap
Definition: DtProjected2DFlatEffect.h:110
A creator class for the Projected 2D flag quad effect.
Definition: DtProjected2DFlatEffect.h:116
int myUniform_NormalisedScreenSpace
Definition: DtProjected2DFlatEffect.h:91
float myGeocentricAlpha
Definition: DtProjected2DFlatEffect.h:101
int myUniform_CameraPos
Definition: DtProjected2DFlatEffect.h:83
Definition: DtProjected2DFlatEffect.h:103
#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:120
std::map< StippleKey, int > StippleTextureMap
Definition: DtProjected2DFlatEffect.h:109
int myUniform_CameraMat
Definition: DtProjected2DFlatEffect.h:84
int myUniform_ProjectionMat
Definition: DtProjected2DFlatEffect.h:85
Definition: DtEffect.h:24
int myUniform_Stipple
Definition: DtProjected2DFlatEffect.h:89
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:90
unsigned int myUnit
Definition: DtProjected2DFlatEffect.h:93
unsigned int myGroupCount
Definition: DtProjected2DFlatEffect.h:94
int myUniform_GroupCount
Definition: DtProjected2DFlatEffect.h:86

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)