![]() |
VR-Forces 5.0.1 Developer's Guide
|
class used to render hdr during the post processor camera draw

Classes | |
| struct | DtHdrOptions |
Public Types | |
| enum | HDR_PASS { DOWNSAMPLE = 0, DOWNSAMPLE4X, BLURH4, BLURV4, BLURH6, BLURV6, BLURH10, BLURV10, BLURH12, BLURV12, TONEMAPPING, EXTRACTHL, GAUSCOMP, STARSTREAK, GLARECOMP, STARCOMP, GHOSTIMAGE, CALCADAPTEDLUM, PROGSIZE } |
| enum | BUFFER_PYRAMID { LEVEL_0 = 0, LEVEL_1, LEVEL_2, LEVEL_3, LEVEL_4, LEVEL_5, LEVEL_TOTAL } |
Public Member Functions | |
| DtHdrDrawable (DtDe &de, DtHdrOptions options, osg::Texture *lensFlareTexture) | |
| DtHdrDrawable (const DtHdrDrawable &orig, const osg::CopyOp &op) | |
| virtual | ~DtHdrDrawable () |
| virtual osg::Object * | clone (const osg::CopyOp ©op) const |
| virtual osg::Object * | cloneType () const |
| virtual void | drawImplementation (osg::RenderInfo &renderInfo) const |
| virtual void | setInputTexture (osg::Texture *inputTex) |
| virtual void | setEnabled (bool enabled) |
| virtual bool | enabled () |
| virtual DtHdrOptions & | options () |
| virtual void | setLumOverride (bool lumOverride) |
| virtual void | setHdrPassthrough (bool enable) |
| virtual bool | hdrPassthrough () |
| virtual void | cleanupGpuMemory () |
| virtual float | localHdrOutputScale () |
Public Member Functions inherited from makVrv::DtPostProcessorDrawable | |
| DtPostProcessorDrawable (DtDe &de) | |
| DtPostProcessorDrawable (const DtPostProcessorDrawable &orig, const osg::CopyOp &op) | |
| virtual | ~DtPostProcessorDrawable () |
| virtual void | drawTexturedQuad (bool drawOnly=false) const |
| virtual void | beginTexturedQuad () const |
| virtual void | endTexturedQuad () const |
| virtual std::string | preprocessorDefinesString (void) const |
| virtual DtGlProgram * | createProgram (const std::string &path, const std::string &prefixName, const std::string &preprocessor="") const |
Protected Member Functions | |
| virtual void | initRenderTextures () const |
| virtual void | downSample (DtGlTexture *src, DtGlTexture *dest, osg::State *state) const |
| virtual void | downsample4x (DtGlTexture *src, DtGlTexture *dest, osg::State *state) const |
| virtual void | extractHL (DtGlTexture *src, DtGlTexture *dest, osg::State *state) const |
| virtual void | runPass (HDR_PASS prog, DtGlTexture *src, DtGlTexture *dest, osg::State *state) const |
| virtual void | blur (DtGlTexture *src, DtGlTexture *dest, DtGlTexture *temp, int blurWidth, osg::State *state) const |
| virtual void | getBufferPyramidSize (BUFFER_PYRAMID level, int *w, int *h) const |
| virtual void | genStarStreak (int streak, float dir, float length) const |
| virtual void | genGhostImage (const float *ghost_modulation1st, const float *ghost_modulation2nd, osg::State *state) const |
| virtual void | composeEffect (void) const |
| virtual void | toneMappingPass (osg::State *state) const |
| virtual void | calculateLuminance (osg::State *state) const |
| virtual float | adaptiveLuminance (osg::State *state) const |
| virtual bool | adaptiveLuminanceCompute (osg::State *state) const |
| virtual float | adaptiveLuminanceRead (osg::State *state) const |
| virtual float | regularLuminance (osg::State *state) const |
| virtual float | silverLiningLuminance (void) const |
| virtual void | initShaders () |
| virtual void | computeColorModulationRedShift (float *color, float r, float g, float b, int num) |
| virtual void | computeColorModulation (float *color, float r, float g, float b, int num) |
| virtual void | computeColorModulationCoefficients () |
| virtual void | createComputeProgramIfNecessary (HDR_PASS pass, const std::string &name) const |
| virtual void | createBlurProgramsIfNecessary () const |
| virtual std::string | preprocessorDefinesString (HDR_PASS pass) const |
| virtual unsigned int | inputTextureId (unsigned int &target, const DtGlTexture *src, osg::State *state) const |
| virtual void | streakPass0 (int streak, float dec, const float step[2], float stride) const |
| virtual void | streakPass1 (int streak, float dec, const float step[2], float stride) const |
| virtual void | streakPass2 (int streak, float dec, const float step[2], float stride) const |
| virtual void | ghostPass0 (const float *ghost_modulation1st) const |
| virtual void | ghostPass1 (const float *ghost_modulation2nd) const |
| virtual void | gaussianBlurComposePass (void) const |
| virtual void | starStreakCompose (void) const |
| virtual void | finalGlarePass (void) const |
| virtual void | initializeUniformLocations (HDR_PASS pass) const |
| virtual void | zeroOutUniformLocations () |
| virtual void | createToneMappingProgramIfNecessary (void) const |
| virtual void | slot_hdrResolutionScaleChanged (int val) |
Protected Member Functions inherited from makVrv::DtPostProcessorDrawable | |
| void | setupGeometry () const |
Static Protected Attributes | |
| static double | theLastHdrFrameTime |
Private Member Functions | |
| DtHdrDrawable ()=delete | |
| DtHdrDrawable (const DtHdrDrawable &)=delete | |
| DtHdrDrawable & | operator= (const DtHdrDrawable &)=delete |
| makVrv::DtHdrDrawable::DtHdrDrawable | ( | DtDe & | de, |
| DtHdrOptions | options, | ||
| osg::Texture * | lensFlareTexture | ||
| ) |
constructor that passes in the options needed for setting up HDR
| makVrv::DtHdrDrawable::DtHdrDrawable | ( | const DtHdrDrawable & | orig, |
| const osg::CopyOp & | op | ||
| ) |
Copy constructor needed because it is derived from osg::Drawable.
|
virtual |
Destructor.
|
privatedelete |
private default constructor. not allowed.
|
privatedelete |
prevent copy-construction
|
privatedelete |
prevent assignment
|
inlinevirtual |
required functions for derriving from osg::Drawable
|
inlinevirtual |
|
virtual |
overridden currently unneeded because the postprocessor drawable is always deleted/recreated because of channel creation/destruction virtual void releaseGLObjects(osg::State* state = 0) const; //!
overridden overriden
|
virtual |
setter for the input texture from the previous post processor or main rendering
|
virtual |
setter/getter for whether or not this effect is enabled.
|
virtual |
|
virtual |
getter for the hdr options. returns a reference so modifications will effect this drawable.
|
virtual |
setter for whether or not the luminance override should be turned on for this drawable the luminance override is used to render modes that have the sky turned of when HDR is turned on.
|
virtual |
getter/setter for the whether the HDR post processor
|
virtual |
|
virtual |
cleanup the Gpu memory. this should be called in the render thread before throwing away a ref_ptr to the drawable.
|
virtual |
hdr output sclae this drawable calulated or used last frame
|
protectedvirtual |
initializes all the render textures if they have not been initialized yet
|
protectedvirtual |
downsample the the src texture into the dest texture (or upsample if the dest is larger)
|
protectedvirtual |
same as downsample except it samples a 4x4 square in the src for each sample in the dest this helps reduce flickering for really bright objects like light points.
|
protectedvirtual |
extract the anything above the lumThreshold and put it in the dest render texture
|
protectedvirtual |
run the specified prog on the src and put the result in dest. Used mostly for blur shaders.
|
protectedvirtual |
blur pass
|
protectedvirtual |
calculate the buffer size for a particular blur level
|
protectedvirtual |
run the star streak shaders for a particular streak direction and length
|
protectedvirtual |
run the shaders to generate the ghosting/lens flare effect
|
protectedvirtual |
compose the three HDR effects into a single render texture.
|
protectedvirtual |
run the final tone mapping pass that combines the effects texture with the main rendering and scales everything appropriately
|
protectedvirtual |
calculate the luminace scaling to use in the tone mapping
|
protectedvirtual |
adaptive luminance (do the pass, read, etc)
|
protectedvirtual |
compute adaptive luminance
|
protectedvirtual |
read back the adaptive luminance
|
protectedvirtual |
non-adaptive luminance
|
protectedvirtual |
luminance per Silver Lining
|
protectedvirtual |
initialize the rest of the HDR shaders.
|
protectedvirtual |
helper functions used for creating color constants
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
helper function to create compute program
|
protectedvirtual |
|
protectedvirtual |
preprocessor string taking into account the current options. NOTE: This is a different signature than base class function (but calls up to base class)
|
protectedvirtual |
get the OpenGL texture id and target (2D for regular, 2D array if in VR)
|
protectedvirtual |
streak passes
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
ghost image passes
|
protectedvirtual |
|
protectedvirtual |
final passes
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
init uniform locations from the compiled shader
|
protectedvirtual |
set initial value of uniform locations to an invalid value
|
protectedvirtual |
create the tone mapping program if not created already
|
protectedvirtual |
Trigger shader recompile if resolution scale has changed.
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
mutables needed since osg drawable draw implementations are const functions. This allows us to keep track of a bit of state that is needed between frames Also these are protected instead of private because they may be needed by classes derived from this class
Render textures need to be initialized in draw implementation so they need to be mutable...
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
need to keep track of the previous frame time in draw implementation so this needs to be mutable.
|
mutableprotected |
locations of various uniforms in the shaders
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |