VR-Forces 4.6 Class Documentation
 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) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #pragma once
7 
11 
12 // Get proper local export symbol
14 
15 #include <GL/glew.h>
16 
19 
20 #include <osg/Texture2D>
21 #include <osg/ref_ptr>
22 
23 #include <rapidjson/document.h>
24 
26 
27 namespace makVrv
28 {
29  class DtDe;
30  class DtChannel;
31 
35  {
36 
37  public:
38 
41 
43  virtual ~DtHdrPostProcessor();
44 
46  virtual void slot_reloadShaders();
47 
49 
50  virtual void slot_enableHdrAutoExposureChanged(bool val);
51  virtual void slot_enableHdrBloomChanged(bool val);
52  virtual void slot_enableHdrStreaksChanged(bool val);
53  virtual void slot_enableHdrLensFlareChanged(double val);
54  virtual void slot_autoExposureRateScaleChanged(double val);
55  virtual void slot_autoExposurePreScaleChanged(double val);
56  virtual void slot_autoExposureMinDiffChanged(double val);
57  virtual void slot_autoExposureMaxDiffChanged(double val);
58  virtual void slot_autoExposureClampMinChanged(double val);
59  virtual void slot_autoExposureClampMaxChanged(double val);
60  virtual void slot_autoExposurePostScaleChanged(double val);
61  virtual void slot_bloomScaleChanged(double val);
62  virtual void slot_streakIntensityScaleChanged(double val);
63  virtual void slot_numStreaksChanged(int val);
64  virtual void slot_streaksLenScaleChanged(double val);
65  virtual void slot_streakRotationOffsetChanged(double val);
66  virtual void slot_lensFlareScaleChanged(double val);
67  virtual void slot_gammaChanged(double val);
68  virtual void slot_hdrResolutionScaleChanged(int val);
70 
72  virtual bool update(DtChannel *channel);
73 
75  virtual void setInputTexture(const DtChannel *channel, osg::Texture2D* texture );
76 
78  virtual osg::ref_ptr< osg::Texture2D > inputTexture();
79 
81  virtual bool postProcessorEnabled() const;
82 
83  protected:
84 
89  int calcHdrRes(int width, int height, int scale);
90 
91  virtual bool effectItrEnabled(EffectMap::iterator &effect);
92 
94 
95  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, std::string& value);
96  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, float& value);
97  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, int& value);
98  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, bool& value);
99  virtual void getJsonValue(const rapidjson::Document& doc, const std::string& name, osg::Vec4& value );
100  virtual void getHdrOptions(int width, int height, DtHdrDrawable::DtHdrOptions& options);
102 
104 
105  // hdrHeight - height of the largest texture used for the hdr post process effects
106  // hdrWidth - should be the same as height and is the width of the texture
107  // lumThreshold - threshold for post process effects set higher to reduce the effects
108  // lumScalar - scales the intensity values used by the post process effects before applying
109  // the effects. Increase to increase intensity of the effects
110  // starGenLevel - level of the blur buffer that the star gen should use (keep it at 0)
111  // blendAmount - amount of the effects buffer to blend into the main buffer.
112  // reduce to reduce the effects intensity
113  // streakDec - larger values increase the intensity of the streaks (keep between 0 and 1)
114  // ghostScalar1 - effects how the different ghost/len flares look
115  // ghostScalar2 - more values to effect the ghost/lens flares
116  // gausCompCoeff - How much of each bloom size to use from smallest to largest
117  // streakStride - Another knob to control how long the streaks are
118  // blurScalar - width of each of the bloom passes from smallest to largest
120 
121  protected:
122 
124 
125  int myViewX;
126  int myViewY;
129 
130  osg::ref_ptr<DtHdrDrawable> myHdrDrawable;
131  osg::ref_ptr<osg::Texture> myLensFlareTexture;
132 
134 
135  };
136 
138  {
139  public:
140 
143 
146  {
147  }
148 
151  {
152  }
153 
154  protected:
155 
157  DtPostProcessor* create(DtDe& de, const std::string& postProcessType);
158 
159  };
160 
161 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)