VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVirtualRealityChannel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <vrvOsg/DtOsgChannel.h>
18 #include <osg/Texture2DArray>
19 
20 
21 namespace makVrv
22 {
31  {
32  protected:
34 
35  // \brief CTOR
37 
38  public:
39 
41  virtual ~DtVirtualRealityChannel();
42 
44  virtual bool initialize() override;
45 
48  virtual void setWidth(int width, bool reset = true);
49 
51  virtual void setHeight(int height, bool reset = true);
52 
54  virtual void setViewport(int x, int y, int width, int height) override;
55 
57  virtual void resetViewport();
58 
63  virtual void setRenderToTexture(bool enabled) override;
64 
66  virtual void setIsMultiView(bool enabled, bool useAA, int viewCount);
67 
69  virtual bool isMultiView() const;
70 
72  virtual void setIgnoreZoom(bool ignore);
73 
75  virtual bool isIgnoringZoom() const;
76 
78  virtual void setOverlayViewportMatchesScene(bool shouldMatch);
79 
81  virtual bool overlayViewportMatchedScene();
82 
84  virtual void setProjectionConfiguration(DtChannelConfiguration::ProjectionUnits units, double left, double right, double bottom, double top, double zNear, double zFar);
85 
87  virtual void setCameraOffsetConfiguration(const osg::Vec3d& trans, const osg::Quat& ori);
88 
90  virtual void getNearFar(double& zNear, double& zFar);
91 
92  //| \brief calculate a projection matrix for the passed frustum values (in vrv units)
93  virtual osg::Matrix calculateEyeProjecionMatrix(DtChannelConfiguration::ProjectionUnits units, float left, float right, float bottom, float top, float zNear, float zFar);
94 
96  virtual void setFrustumAnglesForEye(const osg::Vec4& frustumAngles, int multiViewEye);
97 
99  virtual void setProjectionMatrixForEye(const osg::Matrix& matrix, int multiViewEye);
100 
102  osg::Uniform* eyeProjectionMatrixUniform();
103 
105  osg::Uniform* eyeInverseProjectionMatrixUniform();
106 
108  virtual void updateProjectionConfigurationForMultiView();
109 
111  osg::Uniform* eyeOffsetMatrixUniform();
112 
114  void setOffsetForEye(const osg::Matrix& offset, const osg::Matrix& cameraSpaceOffset, int multiViewEye);
115 
117  osg::Vec2 viewToClipSpace(osg::Vec3d worldCoords, int multiViewEye);
118 
120  DtVariableRateShadingImage* shadingRateImage() const;
121 
123  DtVariableRateShadingImagePalette* shadingRateImagePalette() const;
124 
126  virtual void installVrsUpdater(DtVariableRateShadingImageUpdater* updater);
127 
129  virtual void setVrsEnabled(bool enabled);
130 
133  virtual void setMultiViewUsesAA(bool enabled);
134 
137  boost::signalslib::signal<void()> signal_renderTextureChanged;
138 
140  virtual void addPostProcessEffect(const std::string& postProcessorEffect) override;
141 
142  protected:
143 
145  virtual void projectFor3D() override;
146 
148  virtual void projectFor2D() override;
149 
151  virtual void updateProjection() override;
152 
154  virtual void slot_windowConfigurationModified(const std::string&, const std::string&, const DtWindowConfiguration&) override;
155 
157  virtual void initializeSignalConnections() override;
158 
160  virtual void getRenderTextureAttachmentInfo(unsigned int& level, unsigned int& face, unsigned int& sampleBuffers, unsigned int& samples) override;
161 
163  virtual osg::ref_ptr<osg::Texture> allocateRenderTexture(int width, int height) const override;
164 
165  private:
168 
171 
173  DtVirtualRealityChannel& operator=(const DtVirtualRealityChannel& other);
174 
175  protected:
176 
178 
179  int myWidth;
180  int myHeight;
181 
184 
187 
190 
193 
196 
198  std::vector<osg::Vec4d> myEyeFrustumAngles;
199 
201  std::vector<osg::Matrix> myViewOffsets;
202 
205 
208 
211 
215  };
216 
220  {
221  public:
223  virtual DtChannel* create(DtDe& de, DtWindow* window, DtChannelConfiguration& config) override;
224  };
225 }
Drawable and pre Drawcallback that draw full screen quad to update vrs image.
Abstract Base class.
Definition: DtWindow.h:25
bool myIsMultiView
is multiview being used
Definition: DtVirtualRealityChannel.h:183
osg::ref_ptr< DtVariableRateShadingImage > myShadingRateImage
Definition: DtVirtualRealityChannel.h:212
Wrapper around Nvidia Variable Rate Shading Image functionality Creates a texture of the correct size...
Definition: DtVariableRateShadingImage.h:75
osg::ref_ptr< osg::Uniform > myEyeOffsetMatrixUniform
view space offect matrix for the multiview eyes, single uniform accessing an array of two mat4 values...
Definition: DtVirtualRealityChannel.h:210
bool myIgnoreZoom
should this channel ignore zoom when computing projection
Definition: DtVirtualRealityChannel.h:192
Contains DLL export macros.
osg::ref_ptr< DtVariableRateShadingImageUpdater > myVrsUpdater
Definition: DtVirtualRealityChannel.h:214
Contains makVrv::DtOsgChannel class.
bool myMultiViewUsesAA
should this channel use aa when in multiview
Definition: DtVirtualRealityChannel.h:189
bool myMultiViewDirty
has some aspect of the multiview texture format changed
Definition: DtVirtualRealityChannel.h:186
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
int myWidth
Definition: DtVirtualRealityChannel.h:179
std::vector< osg::Vec4d > myEyeFrustumAngles
store the eye frustum angles so we can more easily update the projection later
Definition: DtVirtualRealityChannel.h:198
bool myOverlayViewportMatchScene
should the overlay viewports be set to match the rttcameras
Definition: DtVirtualRealityChannel.h:195
osg::ref_ptr< osg::Uniform > myEyeProjectionMatrixUniform
projection matrix uniform for the multiview eyes, single uniform accessing an array of two mat4 value...
Definition: DtVirtualRealityChannel.h:204
std::vector< osg::Matrix > myViewOffsets
view offsets for each eye
Definition: DtVirtualRealityChannel.h:201
The abstract channel creator for the abstract channel class.
Definition: DtChannel.h:196
Base class for GPU updates of the variable rate shading image Draw a full screen quad using a shader ...
Definition: DtVariableRateShadingImageUpdater.h:26
This owns a list of channel configurations.
Definition: DtWindowConfiguration.h:26
This class provides the OSG-specific implementation of a DtChannel.
Definition: DtOsgChannel.h:58
boost::signalslib::signal< void()> signal_renderTextureChanged
signaled any time the underlying texture target changes. Used for systems that use the texture as an ...
Definition: DtVirtualRealityChannel.h:137
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
The abstract Channel Class.
Definition: DtChannel.h:35
int myViewCount
Definition: DtVirtualRealityChannel.h:177
Wrap functionality of Nvidia Variable Rate Shading Image Palette Allocates shading rate pallete data ...
Definition: DtVariableRateShadingImagePalette.h:23
A VRV channel that represents the eyes of the HMD A Virtual Reality channel can render in a few diffe...
Definition: DtVirtualRealityChannel.h:30
ProjectionUnits
Definition: DtChannelConfiguration.h:37
osg::ref_ptr< osg::Uniform > myEyeInverseProjectionMatrixUniform
inverse projection matrix uniform for the multiview eyes, single uniform accessing an array of two ma...
Definition: DtVirtualRealityChannel.h:207
Configuration for a single channel Serialized and sent to remote displays as necessary to configure r...
Definition: DtChannelConfiguration.h:24
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Channel creator for Virtual Reality channel.
Definition: DtVirtualRealityChannel.h:219
voidpf uLong offset
Definition: ioapi.h:42
Wraps functionality of Variable Rate Shading Image.
osg::ref_ptr< DtVariableRateShadingImagePalette > myShadingRateImagePalette
Definition: DtVirtualRealityChannel.h:213
A basic OSG display window, used to get the osg context for a display window.
Definition: DtOsgWindow.h:36
int myHeight
Definition: DtVirtualRealityChannel.h:180

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)