V3 merge part 1 / 2.
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
#include "llviewerjoint.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewershadermgr.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llworld.h"
|
||||
#include "llui.h"
|
||||
@@ -1662,17 +1663,28 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
LLQuaternion grid_rotation,
|
||||
LLColor4 inner_color)
|
||||
{
|
||||
if (!gSavedSettings.getBOOL("GridCrossSections"))
|
||||
if (!gSavedSettings.getBOOL("GridCrossSections") || !LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
|
||||
|
||||
|
||||
U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY };
|
||||
U32 num_types = LL_ARRAY_SIZE(types);
|
||||
|
||||
GLuint stencil_mask = 0xFFFFFFFF;
|
||||
//stencil in volumes
|
||||
|
||||
gGL.flush();
|
||||
|
||||
if (shader)
|
||||
{
|
||||
gClipProgram.bind();
|
||||
}
|
||||
|
||||
{
|
||||
glStencilMask(stencil_mask);
|
||||
glClearStencil(1);
|
||||
@@ -1683,6 +1695,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
glStencilFunc(GL_ALWAYS, 0, stencil_mask);
|
||||
gGL.setColorMask(false, false);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
gGL.diffuseColor4f(1,1,1,1);
|
||||
|
||||
//setup clip plane
|
||||
@@ -1692,10 +1705,12 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
normal = -normal;
|
||||
}
|
||||
F32 d = -(selection_center * normal);
|
||||
F64 plane[] = { normal.mV[0], normal.mV[1], normal.mV[2], d };
|
||||
LLGLEnable clip(GL_CLIP_PLANE0);
|
||||
glClipPlane(GL_CLIP_PLANE0, plane);
|
||||
glh::vec4f plane(normal.mV[0], normal.mV[1], normal.mV[2], d );
|
||||
|
||||
gGL.getModelviewMatrix().inverse().mult_vec_matrix(plane);
|
||||
|
||||
gClipProgram.uniform4fv("clip_plane", 1, plane.v);
|
||||
|
||||
BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
|
||||
BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
|
||||
|
||||
@@ -1746,6 +1761,11 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
|
||||
F32 sz = mGridSizeMeters;
|
||||
F32 tiles = sz;
|
||||
|
||||
if (shader)
|
||||
{
|
||||
shader->bind();
|
||||
}
|
||||
|
||||
//draw volume/plane intersections
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
Reference in New Issue
Block a user