VR-Forces 5.0.3 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) 2021 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 namespace makVrv
26 {
27  class DtDe;
28  class DtChannel;
29 
33  {
34 
35  public:
38 
40  virtual ~DtHdrPostProcessor();
41  private:
44 
47 
49  DtHdrPostProcessor& operator=(const DtHdrPostProcessor&);
50  public:
51 
53  virtual void slot_reloadShaders();
54 
56 
57  virtual void slot_enableHdrAutoExposureChanged(bool val);
58  virtual void slot_enableHdrExposureCorrelationChanged(bool val);
59  virtual void slot_enableHdrBloomChanged(bool val);
60  virtual void slot_enableHdrStreaksChanged(bool val);
61  virtual void slot_enableHdrLensFlareChanged(double val);
62  virtual void slot_autoExposureRateScaleChanged(double val);
63  virtual void slot_autoExposurePreScaleChanged(double val);
64  virtual void slot_autoExposureMinDiffChanged(double val);
65  virtual void slot_autoExposureMaxDiffChanged(double val);
66  virtual void slot_autoExposureClampMinChanged(double val);
67  virtual void slot_autoExposureClampMaxChanged(double val);
68  virtual void slot_autoExposurePostScaleChanged(double val);
69  virtual void slot_bloomScaleChanged(double val);
70  virtual void slot_streakIntensityScaleChanged(double val);
71  virtual void slot_numStreaksChanged(int val);
72  virtual void slot_streaksLenScaleChanged(double val);
73  virtual void slot_streakRotationOffsetChanged(double val);
74  virtual void slot_lensFlareScaleChanged(double val);
75  virtual void slot_gammaChanged(double val);
76  virtual void slot_hdrResolutionScaleChanged(int val);
78 
80  virtual bool update(DtChannel *channel);
81 
83  virtual void setInputTexture(const DtChannel *channel, osg::Texture* texture ) override;
84 
86  virtual osg::ref_ptr< osg::Texture > inputTexture();
87 
89  virtual bool postProcessorEnabled() const;
90 
93  virtual void releaseGLObjects() override;
94 
95  protected:
96 
101  int calcHdrRes(int width, int height, int scale);
102 
103  virtual bool effectItrEnabled(EffectMap::iterator &effect);
104 
106 
107  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, std::string& value);
108  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, float& value);
109  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, int& value);
110  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, bool& value);
111  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, osg::Vec4& value );
112  virtual void getHdrOptions(int width, int height, DtHdrDrawable::DtHdrOptions& options);
114 
116 
117  // hdrHeight - height of the largest texture used for the hdr post process effects
118  // hdrWidth - should be the same as height and is the width of the texture
119  // lumThreshold - threshold for post process effects set higher to reduce the effects
120  // lumScalar - scales the intensity values used by the post process effects before applying
121  // the effects. Increase to increase intensity of the effects
122  // starGenLevel - level of the blur buffer that the star gen should use (keep it at 0)
123  // blendAmount - amount of the effects buffer to blend into the main buffer.
124  // reduce to reduce the effects intensity
125  // streakDec - larger values increase the intensity of the streaks (keep between 0 and 1)
126  // ghostScalar1 - effects how the different ghost/len flares look
127  // ghostScalar2 - more values to effect the ghost/lens flares
128  // gausCompCoeff - How much of each bloom size to use from smallest to largest
129  // streakStride - Another knob to control how long the streaks are
130  // blurScalar - width of each of the bloom passes from smallest to largest
132 
133  protected:
134  int myViewX;
135  int myViewY;
138 
141 
143 
144  };
145 
147  {
148  public:
149 
152 
155 
157  virtual ~DtHdrPostProcessorCreator();
158 
159  protected:
160 
162  DtPostProcessor* create(DtDe& de, const std::string& postProcessType);
163  };
164 
165 }
post processor class that handles HDR post processing effects
Definition: DtHdrPostProcessor.h:32
int myViewHeight
Definition: DtHdrPostProcessor.h:137
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
DtHdrPostProcessorCreator()
CTOR.
DtSignalConnectionManager myConnections
Definition: DtHdrPostProcessor.h:142
The abstract Channel Class.
Definition: DtChannel.h:35
structure to hold all the HDR settings so they can more easily be passed to the drawable.
Definition: DtHdrDrawable.h:115
osg::ref_ptr< osg::Texture > myLensFlareTexture
Definition: DtHdrPostProcessor.h:140
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
osg::ref_ptr< DtHdrDrawable > myHdrDrawable
Definition: DtHdrPostProcessor.h:139
virtual ~DtHdrPostProcessorCreator()
DTOR.
#define DT_DLL_VRVPOSTPROCESSOR
Definition: vrvPostProcessor.h:19
Definition: DtHdrPostProcessor.h:146
This file contains the declaration of the class DtHdrDrawable which is used for rendering HDR post pr...
int myViewWidth
Definition: DtHdrPostProcessor.h:136
int myViewY
Definition: DtHdrPostProcessor.h:135
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:70
int myViewX
Definition: DtHdrPostProcessor.h:134
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 Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)