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 
62  virtual void setIsNormalisedScreenCoordinates( bool isNormalisedScreenCoords );
63  protected:
64 
66  virtual void updateUniformLocations() override;
67 
69  virtual void updateUniforms() override;
70 
72  virtual void initializeShaderSource() override;
73 
74  virtual void updateOtherUniforms();
75 
76  protected:
77 
87 
88  unsigned int myUnit;
89  unsigned int myGroupCount;
90  double myCameraPos[3];
91  double myMatrix[16];
92  double myProjectionMatrix[16];
93  double myChannelWidthHeight[2];
97 
98  struct StippleKey
99  {
100  unsigned int key[32];
101  bool operator<(const StippleKey& b) const;
102  };
103 
104  typedef std::map< StippleKey, int > StippleTextureMap;
106  };
107 
108 
112  {
113  public:
114 
115  virtual DtEffect* create(const std::string& dataPath, const std::string& defines, CreateParameters* params = 0)
116  {
117  return new DtProjected2DFlatEffect(dataPath, defines);
118  }
119 
120  };
121 
122 }
int myUniform_Sphere
Definition: DtProjected2DFlatEffect.h:82
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:95
bool myIsNormalisedScreenCoords
Definition: DtProjected2DFlatEffect.h:94
int myUniform_OccludedAlpha
Definition: DtProjected2DFlatEffect.h:83
StippleTextureMap myStippleTextureMap
Definition: DtProjected2DFlatEffect.h:105
A creator class for the Projected 2D flag quad effect.
Definition: DtProjected2DFlatEffect.h:111
int myUniform_NormalisedScreenSpace
Definition: DtProjected2DFlatEffect.h:86
float myGeocentricAlpha
Definition: DtProjected2DFlatEffect.h:96
int myUniform_CameraPos
Definition: DtProjected2DFlatEffect.h:78
Definition: DtProjected2DFlatEffect.h:98
#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:115
std::map< StippleKey, int > StippleTextureMap
Definition: DtProjected2DFlatEffect.h:104
int myUniform_CameraMat
Definition: DtProjected2DFlatEffect.h:79
int myUniform_ProjectionMat
Definition: DtProjected2DFlatEffect.h:80
Definition: DtEffect.h:24
int myUniform_Stipple
Definition: DtProjected2DFlatEffect.h:84
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:85
unsigned int myUnit
Definition: DtProjected2DFlatEffect.h:88
unsigned int myGroupCount
Definition: DtProjected2DFlatEffect.h:89
int myUniform_GroupCount
Definition: DtProjected2DFlatEffect.h:81

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)