diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-01-27 17:24:22 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 17:24:22 -0600 |
commit | 3ef31cb9b28f7b026e109eab69d383dddc922850 (patch) | |
tree | eb4034470bbc59bba139a66b053583bb05e3d7c1 /indra/llrender/llrendertarget.h | |
parent | 503e18fc646c6d88cd8006ad2210a8afd0bced83 (diff) |
SL-19203 et al -- Integrate SSR with reflection probes, tweak probe blending. (#63)
* SL-19203 WIP -- Integrate SSR with reflection probes. Decruft LLRenderTarget.
* SL-19203 WIP -- Re-integrate SSR. Incidental decruft.
* SL-19203 WIP -- SSR frame delta correction (still broken for Z)
* SL-19203 WIP -- SSR frame delta Z fix
* SL-19203 WIP -- Make SSR toggleable again and disable SSR in cube snapshots.
* SL-19203 WIP -- Soften sphere probe transitions and fix reflections on void water (make fallback probe a simple terrain+water+sky probe). Remove parallax correction for automatic probes to reduce artifacts.
* SL-19203 Tune probe blending.
* SL-19203 Cleanup.
Diffstat (limited to 'indra/llrender/llrendertarget.h')
-rw-r--r-- | indra/llrender/llrendertarget.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index 5f3214add3..71727bf09d 100644 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -33,6 +33,8 @@ #include "llrender.h" /* + Wrapper around OpenGL framebuffer objects for use in render-to-texture + SAMPLE USAGE: LLRenderTarget target; @@ -73,7 +75,12 @@ public: //allocate resources for rendering //must be called before use //multiple calls will release previously allocated resources - bool allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool sample_depth, LLTexUnit::eTextureType usage = LLTexUnit::TT_TEXTURE, bool use_fbo = false, S32 samples = 0); + // resX - width + // resY - height + // color_fmt - GL color format (e.g. GL_RGB) + // depth - if true, allocate a depth buffer + // usage - deprecated, should always be TT_TEXTURE + bool allocate(U32 resx, U32 resy, U32 color_fmt, bool depth = false, LLTexUnit::eTextureType usage = LLTexUnit::TT_TEXTURE); //resize existing attachments to use new resolution and color format // CAUTION: if the GL runs out of memory attempting to resize, this render target will be undefined @@ -93,7 +100,7 @@ public: // attachment -- LLImageGL to render into // use_name -- optional texture name to target instead of attachment->getTexName() // NOTE: setColorAttachment and releaseColorAttachment cannot be used in conjuction with - // addColorAttachment, allocateDepth, resize, etc. + // addColorAttachment, allocateDepth, resize, etc. void setColorAttachment(LLImageGL* attachment, LLGLuint use_name = 0); // detach from current color attachment @@ -111,14 +118,19 @@ public: //free any allocated resources //safe to call redundantly + // asserts that this target is not currently bound or present in the RT stack void release(); //bind target for rendering //applies appropriate viewport + // If an LLRenderTarget is currently bound, stores a reference to that LLRenderTarget + // and restores previous binding on flush() (maintains a stack of Render Targets) + // Asserts that this target is not currently bound in the stack void bindTarget(); //clear render targer, clears depth buffer if present, //uses scissor rect if in copy-to-texture mode + // asserts that this target is currently bound void clear(U32 mask = 0xFFFFFFFF); //get applied viewport @@ -136,7 +148,6 @@ public: U32 getNumTextures() const; U32 getDepth(void) const { return mDepth; } - bool canSampleDepth() const { return mSampleDepth; } void bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options = LLTexUnit::TFO_BILINEAR); @@ -144,15 +155,18 @@ public: //must be called when rendering is complete //should be used 1:1 with bindTarget // call bindTarget once, do all your rendering, call flush once - // if fetch_depth is TRUE, every effort will be made to copy the depth buffer into - // the current depth texture. A depth texture will be allocated if needed. - void flush(bool fetch_depth = FALSE); + // If an LLRenderTarget was bound when bindTarget was called, binds that RenderTarget for rendering (maintains RT stack) + // asserts that this target is currently bound + void flush(); //Returns TRUE if target is ready to be rendered into. //That is, if the target has been allocated with at least //one renderable attachment (i.e. color buffer, depth buffer). bool isComplete() const; + // Returns true if this RenderTarget is bound somewhere in the stack + bool isBoundInStack() const; + static LLRenderTarget* getCurrentBoundTarget() { return sBoundTarget; } protected: @@ -161,13 +175,10 @@ protected: std::vector<U32> mTex; std::vector<U32> mInternalFormat; U32 mFBO; - U32 mPreviousFBO; - U32 mPreviousResX; - U32 mPreviousResY; + LLRenderTarget* mPreviousRT = nullptr; - U32 mDepth; + U32 mDepth; bool mUseDepth; - bool mSampleDepth; LLTexUnit::eTextureType mUsage; |