diff options
Diffstat (limited to 'indra/newview/pipeline.h')
-rw-r--r-- | indra/newview/pipeline.h | 130 |
1 files changed, 88 insertions, 42 deletions
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 62d3ae7a39..59858cfcfc 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -38,6 +38,7 @@ #include "llgl.h" #include "lldrawable.h" #include "llrendertarget.h" +#include "llreflectionmapmanager.h" #include <stack> @@ -50,6 +51,7 @@ class LLVOAvatar; class LLVOPartGroup; class LLGLSLShader; class LLDrawPoolAlpha; +class LLSettingsSky; typedef enum e_avatar_skinning_method { @@ -187,6 +189,7 @@ public: LLViewerObject* lineSegmentIntersectInWorld(const LLVector4a& start, const LLVector4a& end, bool pick_transparent, bool pick_rigged, + bool pick_unselectable, S32* face_hit, // return the face hit LLVector4a* intersection = NULL, // return the intersection point LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point @@ -216,8 +219,9 @@ public: U32 addObject(LLViewerObject *obj); void enableShadows(const bool enable_shadows); - void releaseShadowTargets(); - void releaseShadowTarget(U32 index); + void releaseSpotShadowTargets(); + void releaseSunShadowTargets(); + void releaseSunShadowTarget(U32 index); // void setLocalLighting(const bool local_lighting); // bool isLocalLightingEnabled() const; @@ -286,19 +290,28 @@ public: void renderGeom(LLCamera& camera, bool forceVBOUpdate = false); - void renderGeomDeferred(LLCamera& camera); - void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true); + void renderGeomDeferred(LLCamera& camera, bool do_occlusion = false); + void renderGeomPostDeferred(LLCamera& camera); void renderGeomShadow(LLCamera& camera); void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr); void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep); void unbindDeferredShader(LLGLSLShader& shader); - void renderDeferredLighting(LLRenderTarget* light_target); + + // set env_mat parameter in given shader + void setEnvMat(LLGLSLShader& shader); + + void bindReflectionProbes(LLGLSLShader& shader); + void unbindReflectionProbes(LLGLSLShader& shader); + + + + void renderDeferredLighting(); void postDeferredGammaCorrect(LLRenderTarget* screen_target); - void generateWaterReflection(LLCamera& camera); void generateSunShadow(LLCamera& camera); - LLRenderTarget* getShadowTarget(U32 i); + LLRenderTarget* getSunShadowTarget(U32 i); + LLRenderTarget* getSpotShadowTarget(U32 i); void generateHighlight(LLCamera& camera); void renderHighlight(const LLViewerObject* obj, F32 fade); @@ -426,6 +439,9 @@ public: void hideObject( const LLUUID& id ); void restoreHiddenObject( const LLUUID& id ); + LLReflectionMapManager mReflectionMapManager; + void overrideEnvironmentMap(); + private: void unloadShaders(); void addToQuickLookup( LLDrawPool* new_poolp ); @@ -460,6 +476,8 @@ public: RENDER_TYPE_VOIDWATER = LLDrawPool::POOL_VOIDWATER, RENDER_TYPE_WATER = LLDrawPool::POOL_WATER, RENDER_TYPE_ALPHA = LLDrawPool::POOL_ALPHA, + RENDER_TYPE_ALPHA_PRE_WATER = LLDrawPool::POOL_ALPHA_PRE_WATER, + RENDER_TYPE_ALPHA_POST_WATER = LLDrawPool::POOL_ALPHA_POST_WATER, RENDER_TYPE_GLOW = LLDrawPool::POOL_GLOW, RENDER_TYPE_PASS_SIMPLE = LLRenderPass::PASS_SIMPLE, RENDER_TYPE_PASS_SIMPLE_RIGGED = LLRenderPass::PASS_SIMPLE_RIGGED, @@ -517,6 +535,8 @@ public: RENDER_TYPE_PASS_NORMSPEC_MASK_RIGGED = LLRenderPass::PASS_NORMSPEC_MASK_RIGGED, RENDER_TYPE_PASS_NORMSPEC_EMISSIVE = LLRenderPass::PASS_NORMSPEC_EMISSIVE, RENDER_TYPE_PASS_NORMSPEC_EMISSIVE_RIGGED = LLRenderPass::PASS_NORMSPEC_EMISSIVE_RIGGED, + RENDER_TYPE_PASS_PBR_OPAQUE = LLRenderPass::PASS_PBR_OPAQUE, + RENDER_TYPE_PASS_PBR_OPAQUE_RIGGED = LLRenderPass::PASS_PBR_OPAQUE_RIGGED, // Following are object types (only used in drawable mRenderType) RENDER_TYPE_HUD = LLRenderPass::NUM_RENDER_TYPES, RENDER_TYPE_VOLUME, @@ -574,7 +594,8 @@ public: RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, // not used RENDER_DEBUG_TEXEL_DENSITY = 0x40000000, RENDER_DEBUG_TRIANGLE_COUNT = 0x80000000, - RENDER_DEBUG_IMPOSTORS = 0x100000000 + RENDER_DEBUG_IMPOSTORS = 0x100000000, + RENDER_DEBUG_REFLECTION_PROBES = 0x200000000 }; public: @@ -612,7 +633,6 @@ public: static bool sUseTriStrips; static bool sUseFarClip; static bool sShadowRender; - static bool sWaterReflections; static bool sDynamicLOD; static bool sPickAvatar; static bool sReflectionRender; @@ -626,26 +646,50 @@ public: static bool sRenderAttachedLights; static bool sRenderAttachedParticles; static bool sRenderDeferred; + static bool sReflectionProbesEnabled; + static bool sRenderPBR; static S32 sVisibleLightCount; static bool sRenderingHUDs; static F32 sDistortionWaterClipPlaneMargin; static LLTrace::EventStatHandle<S64> sStatBatchSize; - //screen texture - U32 mScreenWidth; - U32 mScreenHeight; - - LLRenderTarget mScreen; - LLRenderTarget mUIScreen; - LLRenderTarget mDeferredScreen; - LLRenderTarget mFXAABuffer; - LLRenderTarget mEdgeMap; - LLRenderTarget mDeferredDepth; - LLRenderTarget mOcclusionDepth; - LLRenderTarget mDeferredLight; - LLRenderTarget mHighlight; - LLRenderTarget mPhysicsDisplay; + class RenderTargetPack + { + public: + U32 width = 0; + U32 height = 0; + + //screen texture + LLRenderTarget screen; + LLRenderTarget uiScreen; + LLRenderTarget deferredScreen; + LLRenderTarget fxaaBuffer; + LLRenderTarget edgeMap; + LLRenderTarget deferredDepth; + LLRenderTarget occlusionDepth; + LLRenderTarget deferredLight; + + //sun shadow map + LLRenderTarget shadow[4]; + LLRenderTarget shadowOcclusion[4]; + }; + + // main full resoltuion render target + RenderTargetPack mMainRT; + + // auxillary 512x512 render target pack + RenderTargetPack mAuxillaryRT; + + // currently used render target pack + RenderTargetPack* mRT; + + LLRenderTarget mSpotShadow[2]; + LLRenderTarget mSpotShadowOcclusion[2]; + + LLRenderTarget mHighlight; + LLRenderTarget mPhysicsDisplay; + LLRenderTarget mPbrBrdfLut; LLCullResult mSky; LLCullResult mReflectedObjects; @@ -657,15 +701,16 @@ public: //utility buffer for rendering cubes, 8 vertices are corners of a cube [-1, 1] LLPointer<LLVertexBuffer> mCubeVB; - //sun shadow map - LLRenderTarget mShadow[6]; - LLRenderTarget mShadowOcclusion[6]; + //list of currently bound reflection maps + std::vector<LLReflectionMap*> mReflectionMaps; + std::vector<LLVector3> mShadowFrustPoints[4]; LLVector4 mShadowError; LLVector4 mShadowFOV; LLVector3 mShadowFrustOrigin[4]; LLCamera mShadowCamera[8]; LLVector3 mShadowExtents[4][2]; + // TODO : separate Sun Shadow and Spot Shadow matrices glh::matrix4f mSunShadowMatrix[6]; glh::matrix4f mShadowModelview[6]; glh::matrix4f mShadowProjection[6]; @@ -845,21 +890,23 @@ protected: // For quick-lookups into mPools (mapped by texture pointer) std::map<uintptr_t, LLDrawPool*> mTerrainPools; std::map<uintptr_t, LLDrawPool*> mTreePools; - LLDrawPoolAlpha* mAlphaPool; - LLDrawPool* mSkyPool; - LLDrawPool* mTerrainPool; - LLDrawPool* mWaterPool; - LLDrawPool* mGroundPool; - LLRenderPass* mSimplePool; - LLRenderPass* mGrassPool; - LLRenderPass* mAlphaMaskPool; - LLRenderPass* mFullbrightAlphaMaskPool; - LLRenderPass* mFullbrightPool; - LLDrawPool* mInvisiblePool; - LLDrawPool* mGlowPool; - LLDrawPool* mBumpPool; - LLDrawPool* mMaterialsPool; - LLDrawPool* mWLSkyPool; + LLDrawPoolAlpha* mAlphaPoolPreWater = nullptr; + LLDrawPoolAlpha* mAlphaPoolPostWater = nullptr; + LLDrawPool* mSkyPool = nullptr; + LLDrawPool* mTerrainPool = nullptr; + LLDrawPool* mWaterPool = nullptr; + LLDrawPool* mGroundPool = nullptr; + LLRenderPass* mSimplePool = nullptr; + LLRenderPass* mGrassPool = nullptr; + LLRenderPass* mAlphaMaskPool = nullptr; + LLRenderPass* mFullbrightAlphaMaskPool = nullptr; + LLRenderPass* mFullbrightPool = nullptr; + LLDrawPool* mInvisiblePool = nullptr; + LLDrawPool* mGlowPool = nullptr; + LLDrawPool* mBumpPool = nullptr; + LLDrawPool* mMaterialsPool = nullptr; + LLDrawPool* mWLSkyPool = nullptr; + LLDrawPool* mPBROpaquePool = nullptr; // Note: no need to keep an quick-lookup to avatar pools, since there's only one per avatar public: @@ -966,7 +1013,6 @@ public: static LLVector3 RenderShadowGaussian; static F32 RenderShadowBlurDistFactor; static bool RenderDeferredAtmospheric; - static S32 RenderReflectionDetail; static F32 RenderHighlightFadeTime; static LLVector3 RenderShadowClipPlanes; static LLVector3 RenderShadowOrthoClipPlanes; |