summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/pipeline.h')
-rw-r--r--indra/newview/pipeline.h76
1 files changed, 46 insertions, 30 deletions
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 462d4836ac..5a07bdebe3 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -61,14 +61,7 @@ bool compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn
bool LLRayAABB(const LLVector3 &center, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0);
bool setup_hud_matrices(); // use whole screen to render hud
bool setup_hud_matrices(const LLRect& screen_region); // specify portion of screen (in pixels) to render hud attachments from (for picking)
-glh::matrix4f glh_copy_matrix(F32* src);
-glh::matrix4f glh_get_current_modelview();
-void glh_set_current_modelview(const glh::matrix4f& mat);
-glh::matrix4f glh_get_current_projection();
-void glh_set_current_projection(glh::matrix4f& mat);
-glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar);
-glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
-glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up);
+
extern LLTrace::BlockTimerStatHandle FTM_RENDER_GEOMETRY;
extern LLTrace::BlockTimerStatHandle FTM_RENDER_GRASS;
@@ -91,6 +84,11 @@ extern LLTrace::BlockTimerStatHandle FTM_STATESORT;
extern LLTrace::BlockTimerStatHandle FTM_PIPELINE;
extern LLTrace::BlockTimerStatHandle FTM_CLIENT_COPY;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_HUD;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_3D;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_2D;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_DEBUG_TEXT;
+extern LLTrace::BlockTimerStatHandle FTM_RENDER_UI_SCENE_MON;
class LLPipeline
{
@@ -102,10 +100,17 @@ public:
void restoreGL();
void resetVertexBuffers();
void doResetVertexBuffers(bool forced = false);
+ void requestResizeScreenTexture(); // set flag only, no work, safer for callbacks...
+ void requestResizeShadowTexture(); // set flag only, no work, safer for callbacks...
+
void resizeScreenTexture();
+ void resizeShadowTexture();
+
void releaseGLBuffers();
void releaseLUTBuffers();
void releaseScreenBuffers();
+ void releaseShadowBuffers();
+
void createGLBuffers();
void createLUTBuffers();
@@ -127,6 +132,7 @@ public:
//attempt to allocate screen buffers at resX, resY
//returns true if allocation successful, false otherwise
bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples);
+ bool allocateShadowBuffer(U32 resX, U32 resY);
void allocatePhysicsBuffer();
@@ -213,6 +219,8 @@ public:
U32 addObject(LLViewerObject *obj);
void enableShadows(const bool enable_shadows);
+ void releaseShadowTargets();
+ void releaseShadowTarget(U32 index);
// void setLocalLighting(const bool local_lighting);
// bool isLocalLightingEnabled() const;
@@ -261,6 +269,7 @@ public:
void renderObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false);
void renderMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false);
+ void renderFullbrightMaskedObjects(U32 type, U32 mask, bool texture = true, bool batch_texture = false);
void renderGroups(LLRenderPass* pass, U32 type, U32 mask, bool texture);
@@ -278,15 +287,17 @@ public:
void renderGeomDeferred(LLCamera& camera);
void renderGeomPostDeferred(LLCamera& camera, bool do_occlusion=true);
void renderGeomShadow(LLCamera& camera);
- void bindDeferredShader(LLGLSLShader& shader, U32 light_index = 0, U32 noise_map = 0xFFFFFFFF);
+ void bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_target = nullptr);
void setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep);
void unbindDeferredShader(LLGLSLShader& shader);
- void renderDeferredLighting();
- void renderDeferredLightingToRT(LLRenderTarget* target);
-
+ void renderDeferredLighting(LLRenderTarget* light_target);
+ void postDeferredGammaCorrect(LLRenderTarget* screen_target);
+
void generateWaterReflection(LLCamera& camera);
void generateSunShadow(LLCamera& camera);
+ LLRenderTarget* getShadowTarget(U32 i);
+
void generateHighlight(LLCamera& camera);
void renderHighlight(const LLViewerObject* obj, F32 fade);
void setHighlightObject(LLDrawable* obj) { mHighlightObject = obj; }
@@ -313,7 +324,7 @@ public:
void enableLightsAvatar();
void enableLightsPreview();
void enableLightsAvatarEdit(const LLColor4& color);
- void enableLightsFullbright(const LLColor4& color);
+ void enableLightsFullbright();
void disableLights();
void shiftObjects(const LLVector3 &offset);
@@ -577,6 +588,7 @@ public:
static bool sDynamicLOD;
static bool sPickAvatar;
static bool sReflectionRender;
+ static bool sDistortionRender;
static bool sImpostorRender;
static bool sImpostorRenderAlphaDepthPass;
static bool sUnderWaterRender;
@@ -590,6 +602,7 @@ public:
static S32 sVisibleLightCount;
static F32 sMinRenderSize;
static bool sRenderingHUDs;
+ static F32 sDistortionWaterClipPlaneMargin;
static LLTrace::EventStatHandle<S64> sStatBatchSize;
@@ -608,6 +621,10 @@ public:
LLRenderTarget mHighlight;
LLRenderTarget mPhysicsDisplay;
+ LLCullResult mSky;
+ LLCullResult mReflectedObjects;
+ LLCullResult mRefractedObjects;
+
//utility buffer for rendering post effects, gets abused by renderDeferredLighting
LLPointer<LLVertexBuffer> mDeferredVB;
@@ -626,22 +643,14 @@ public:
glh::matrix4f mSunShadowMatrix[6];
glh::matrix4f mShadowModelview[6];
glh::matrix4f mShadowProjection[6];
- glh::matrix4f mGIMatrix;
- glh::matrix4f mGIMatrixProj;
- glh::matrix4f mGIModelview;
- glh::matrix4f mGIProjection;
- glh::matrix4f mGINormalMatrix;
- glh::matrix4f mGIInvProj;
- LLVector2 mGIRange;
- F32 mGILightRadius;
-
- LLPointer<LLDrawable> mShadowSpotLight[2];
- F32 mSpotLightFade[2];
- LLPointer<LLDrawable> mTargetShadowSpotLight[2];
+ glh::matrix4f mReflectionModelView;
+
+ LLPointer<LLDrawable> mShadowSpotLight[2];
+ F32 mSpotLightFade[2];
+ LLPointer<LLDrawable> mTargetShadowSpotLight[2];
LLVector4 mSunClipPlanes;
LLVector4 mSunOrthoClipPlanes;
-
LLVector2 mScreenScale;
//water reflection texture
@@ -650,6 +659,8 @@ public:
//water distortion texture (refraction)
LLRenderTarget mWaterDis;
+ LLRenderTarget mBake;
+
//texture for making the glow
LLRenderTarget mGlow[3];
@@ -658,9 +669,14 @@ public:
U32 mTrueNoiseMap;
U32 mLightFunc;
- LLColor4 mSunDiffuse;
- LLVector3 mSunDir;
- LLVector3 mTransformedSunDir;
+ LLColor4 mSunDiffuse;
+ LLColor4 mMoonDiffuse;
+ LLVector4 mSunDir;
+ LLVector4 mMoonDir;
+ bool mNeedsShadowTargetClear;
+
+ LLVector4 mTransformedSunDir;
+ LLVector4 mTransformedMoonDir;
bool mInitialized;
bool mVertexShadersEnabled;
@@ -865,7 +881,6 @@ public:
//cached settings
static bool WindLightUseAtmosShaders;
- static bool VertexShaderEnable;
static bool RenderAvatarVP;
static bool RenderDeferred;
static F32 RenderDeferredSunWash;
@@ -921,6 +936,7 @@ public:
static F32 RenderShadowBias;
static F32 RenderSpotShadowOffset;
static F32 RenderSpotShadowBias;
+ static LLDrawable* RenderSpotLight;
static F32 RenderEdgeDepthCutoff;
static F32 RenderEdgeNormCutoff;
static LLVector3 RenderShadowGaussian;