![]() |
VR-Forces Developer's Guide
|
This class encapsulates all the (lazily) created OpenGL objects that are required for doing hdr. It also executes the various hdr passes and the final tone mapping pass..
Public Member Functions | |
| virtual | ~DtHdrDrawableRenderData () |
| DtHdrDrawableRenderData ()=delete | |
| DtHdrDrawableRenderData (const DtHdrDrawableRenderData &rhs)=delete | |
| DtHdrDrawableRenderData & | operator= (const DtHdrDrawableRenderData &rhs)=delete |
| virtual void | initShaders () |
| virtual void | execute (osg::RenderInfo &renderInfo) |
| virtual void | cleanupGpuMemory () |
| virtual void | setInputTexture (osg::Texture *inputTex) |
| virtual float | localHdrOutputScale () |
Public Attributes | |
| friend | DtHdrDrawableRenderDataCreator |
Protected Member Functions | |
| DtHdrDrawableRenderData (DtDe &de, const DtHdrOptions &options, DtHdrDrawable *parent, osg::Texture *&lensFlareTexture) | |
| virtual void | initRenderTextures (const osg::Camera *osgCamera) |
| virtual void | downSample (DtGlTexture *src, DtGlTexture *dest, osg::State *state) |
| virtual void | downsample4x (DtGlTexture *src, DtGlTexture *dest, osg::State *state) |
| virtual void | extractHL (DtGlTexture *src, DtGlTexture *dest, osg::State *state) |
| virtual void | runPass (HDR_PASS prog, DtGlTexture *src, DtGlTexture *dest, osg::State *state) |
| virtual void | blur (DtGlTexture *src, DtGlTexture *dest, DtGlTexture *temp, int blurWidth, osg::State *state) |
| virtual void | getBufferPyramidSize (BUFFER_PYRAMID level, int *w, int *h) |
| virtual void | genStarStreak (int streak, float dir, float length) |
| virtual void | genGhostImage (const float *ghost_modulation1st, const float *ghost_modulation2nd, osg::State *state) |
| virtual void | composeEffect (void) |
| virtual void | toneMappingPass (osg::State *state) |
| virtual void | calculateLuminance (const osg::Camera *osgCamera) |
| virtual float | adaptiveLuminance (const osg::Camera *osgCamera) |
| virtual bool | adaptiveLuminanceCompute (const osg::Camera *osgCamera) |
| virtual float | adaptiveLuminanceRead (const osg::Camera *osgCamera) |
| virtual float | regularLuminance (const osg::Camera *osgCamera) |
| virtual float | silverLiningLuminance (const osg::Camera *osgCamera) |
| 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) |
| virtual void | createBlurProgramsIfNecessary () |
| virtual std::string | preprocessorDefinesString (HDR_PASS pass) |
| virtual unsigned int | inputTextureId (unsigned int &target, const DtGlTexture *src, osg::State *state) |
| virtual void | streakPass0 (int streak, float dec, const float step[2], float stride) |
| virtual void | streakPass1 (int streak, float dec, const float step[2], float stride) |
| virtual void | streakPass2 (int streak, float dec, const float step[2], float stride) |
| virtual void | ghostPass0 (const float *ghost_modulation1st) |
| virtual void | ghostPass1 (const float *ghost_modulation2nd) |
| virtual void | gaussianBlurComposePass (void) |
| virtual void | starStreakCompose (void) |
| virtual void | finalGlarePass (void) |
| virtual void | initializeUniformLocations (HDR_PASS pass) |
| virtual void | zeroOutUniformLocations () |
| virtual void | createToneMappingProgramIfNecessary (void) |
| virtual void | slot_hdrResolutionScaleChanged (int val) |
|
virtual |
destructor
|
delete |
not allowed
|
delete |
|
protected |
protected constructor
|
delete |
|
virtual |
initialize the rest of the HDR shaders.
|
virtual |
do hdr
|
virtual |
clean up
|
virtual |
set the input texture
|
virtual |
hdr output scale 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 luminance 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 |
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.
| friend makVrv::DtHdrDrawableRenderData::DtHdrDrawableRenderDataCreator |
only friend can create
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
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...
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
need to keep track of the previous frame time in draw implementation so this needs to be mutable.
|
protected |
locations of various uniforms in the shaders
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |