VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtHdrPostProcessor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #pragma once
7 
11 
12 // Get proper local export symbol
14 
17 
18 #include <osg/Texture2D>
19 #include <osg/ref_ptr>
20 
21 #include <rapidjson/document.h>
22 
24 
25 #include <atomic>
26 
27 namespace makVrv
28 {
29  class DtDe;
30  class DtChannel;
31 
35  {
36 
37  public:
40 
42  virtual ~DtHdrPostProcessor();
43  private:
46 
49 
51  DtHdrPostProcessor& operator=(const DtHdrPostProcessor&);
52  public:
53 
55  virtual void slot_reloadShaders();
56 
58 
59  virtual void slot_enableHdrAutoExposureChanged(bool val);
60  virtual void slot_enableHdrExposureCorrelationChanged(bool val);
61  virtual void slot_enableHdrBloomChanged(bool val);
62  virtual void slot_enableHdrStreaksChanged(bool val);
63  virtual void slot_enableHdrLensFlareChanged(double val);
64  virtual void slot_autoExposureRateScaleChanged(double val);
65  virtual void slot_autoExposurePreScaleChanged(double val);
66  virtual void slot_autoExposureMinDiffChanged(double val);
67  virtual void slot_autoExposureMaxDiffChanged(double val);
68  virtual void slot_autoExposureClampMinChanged(double val);
69  virtual void slot_autoExposureClampMaxChanged(double val);
70  virtual void slot_autoExposurePostScaleChanged(double val);
71  virtual void slot_bloomScaleChanged(double val);
72  virtual void slot_streakIntensityScaleChanged(double val);
73  virtual void slot_numStreaksChanged(int val);
74  virtual void slot_streaksLenScaleChanged(double val);
75  virtual void slot_streakRotationOffsetChanged(double val);
76  virtual void slot_lensFlareScaleChanged(double val);
77  virtual void slot_gammaChanged(double val);
78  virtual void slot_hdrResolutionScaleChanged(int val);
80 
82  virtual bool update(DtChannel* channel);
83 
85  virtual void setInputTexture(const DtChannel* channel, osg::Texture* texture) override;
86 
88  virtual osg::ref_ptr< osg::Texture > inputTexture();
89 
91  virtual bool postProcessorEnabled() override;
92 
95  virtual void releaseGLObjects() override;
96 
97  protected:
98 
103  int calcHdrRes(int width, int height, int scale);
104 
105  virtual bool effectItrEnabled(const EffectMap::iterator& effect) const override;
106 
108 
109  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, std::string& value);
110  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, float& value);
111  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, int& value);
112  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, bool& value);
113  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, Vector4_32& value);
114  virtual void getHdrOptions(int width, int height, DtHdrOptions& options);
116 
118 
119  // hdrHeight - height of the largest texture used for the hdr post process effects
120  // hdrWidth - should be the same as height and is the width of the texture
121  // lumThreshold - threshold for post process effects set higher to reduce the effects
122  // lumScalar - scales the intensity values used by the post process effects before applying
123  // the effects. Increase to increase intensity of the effects
124  // starGenLevel - level of the blur buffer that the star gen should use (keep it at 0)
125  // blendAmount - amount of the effects buffer to blend into the main buffer.
126  // reduce to reduce the effects intensity
127  // streakDec - larger values increase the intensity of the streaks (keep between 0 and 1)
128  // ghostScalar1 - effects how the different ghost/len flares look
129  // ghostScalar2 - more values to effect the ghost/lens flares
130  // gausCompCoeff - How much of each bloom size to use from smallest to largest
131  // streakStride - Another knob to control how long the streaks are
132  // blurScalar - width of each of the bloom passes from smallest to largest
134 
135  protected:
136  int myViewX;
137  int myViewY;
140 
143 
145 
146  bool myIsFirstChannel = false;
147  protected:
148  static std::atomic<int> theCount;
149  };
150 
152  {
153  public:
154 
157 
160 
162  virtual ~DtHdrPostProcessorCreator();
163 
164  protected:
165 
167  DtPostProcessor* create(DtDe& de, const std::string& postProcessType);
168  };
169 
170 }
post processor class that handles HDR post processing effects
Definition: DtHdrPostProcessor.h:34
int myViewHeight
Definition: DtHdrPostProcessor.h:139
DtPostProcessor * create(DtDe &de, const std::string &postProcessType)
Create an instance of DtPostProcessor.
DtPostProcessorCreator is the common base class for all post processor creators.
Definition: DtPostProcessor.h:232
This class provides the management of post processors and their post processing effects.
Definition: DtPostProcessManagerInterface.h:24
static std::atomic< int > theCount
Definition: DtHdrPostProcessor.h:148
DtHdrPostProcessorCreator()
CTOR.
DtSignalConnectionManager myConnections
Definition: DtHdrPostProcessor.h:144
structure to hold all the HDR settings so they can more easily be passed to the drawable.
Definition: DtHdrTypes.h:54
The abstract Channel Class.
Definition: DtChannel.h:35
osg::ref_ptr< osg::Texture > myLensFlareTexture
Definition: DtHdrPostProcessor.h:142
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< DtHdrDrawable > myHdrDrawable
Definition: DtHdrPostProcessor.h:141
virtual ~DtHdrPostProcessorCreator()
DTOR.
#define DT_DLL_VRVPOSTPROCESSOR
Definition: vrvPostProcessor.h:19
Definition: DtHdrPostProcessor.h:151
This file contains the declaration of the class DtHdrDrawable which is used for rendering HDR post pr...
int myViewWidth
Definition: DtHdrPostProcessor.h:138
int myViewY
Definition: DtHdrPostProcessor.h:137
Contains DLL export macros.
Base class to provide boost signal/slot management.
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:72
int myViewX
Definition: DtHdrPostProcessor.h:136
This class provides the OSG-specific implementation of a post processor. A post processor has a type ...
Definition: DtPostProcessor.h:66

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)