merge
commit
4c169a5750
|
|
@ -12,7 +12,6 @@ mat4 getObjectSkinnedTransform();
|
|||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l);
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
|
||||
|
||||
vec3 atmosAmbient(vec3 light);
|
||||
vec3 atmosAffectDirectionalLight(float lightIntensity);
|
||||
|
|
@ -23,11 +22,36 @@ varying vec3 vary_position;
|
|||
varying vec3 vary_ambient;
|
||||
varying vec3 vary_directional;
|
||||
varying vec3 vary_normal;
|
||||
varying vec3 vary_light;
|
||||
varying vec3 vary_fragcoord;
|
||||
varying vec3 vary_pointlight_col;
|
||||
|
||||
uniform float near_clip;
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
vec3 lv = lp.xyz-v;
|
||||
|
||||
//get distance
|
||||
float d = length(lv);
|
||||
|
||||
//normalize light vector
|
||||
lv *= 1.0/d;
|
||||
|
||||
//distance attenuation
|
||||
float dist2 = d*d/(la*la);
|
||||
float da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
|
||||
// spotlight coefficient.
|
||||
float spot = max(dot(-ln, lv), is_pointlight);
|
||||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
//angular attenuation
|
||||
da *= calcDirectionalLight(n, lv);
|
||||
|
||||
return da;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
|
@ -53,20 +77,20 @@ void main()
|
|||
|
||||
vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
|
||||
|
||||
// Collect normal lights (need to be divided by two, as we later multiply by 2)
|
||||
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a);
|
||||
col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a);
|
||||
col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a);
|
||||
col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a);
|
||||
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a);
|
||||
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a);
|
||||
col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
|
||||
col.rgb = scaleDownLight(col.rgb);
|
||||
// Collect normal lights
|
||||
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
|
||||
col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
|
||||
col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
|
||||
col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
|
||||
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
|
||||
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
|
||||
|
||||
vary_pointlight_col = col.rgb*gl_Color.rgb;
|
||||
|
||||
col.rgb = vec3(0,0,0);
|
||||
|
||||
// Add windlight lights
|
||||
col.rgb += atmosAmbient(vec3(0.));
|
||||
|
||||
vary_light = gl_LightSource[0].position.xyz;
|
||||
col.rgb = atmosAmbient(vec3(0.));
|
||||
|
||||
vary_ambient = col.rgb*gl_Color.rgb;
|
||||
vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ varying vec3 vary_ambient;
|
|||
varying vec3 vary_directional;
|
||||
varying vec3 vary_fragcoord;
|
||||
varying vec3 vary_position;
|
||||
varying vec3 vary_light;
|
||||
varying vec3 vary_pointlight_col;
|
||||
|
||||
uniform float shadow_bias;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
|||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l);
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
|
||||
mat4 getObjectSkinnedTransform();
|
||||
vec3 atmosAmbient(vec3 light);
|
||||
vec3 atmosAffectDirectionalLight(float lightIntensity);
|
||||
|
|
@ -22,12 +21,37 @@ varying vec3 vary_ambient;
|
|||
varying vec3 vary_directional;
|
||||
varying vec3 vary_fragcoord;
|
||||
varying vec3 vary_position;
|
||||
varying vec3 vary_light;
|
||||
varying vec3 vary_pointlight_col;
|
||||
|
||||
uniform float near_clip;
|
||||
uniform float shadow_offset;
|
||||
uniform float shadow_bias;
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
vec3 lv = lp.xyz-v;
|
||||
|
||||
//get distance
|
||||
float d = length(lv);
|
||||
|
||||
//normalize light vector
|
||||
lv *= 1.0/d;
|
||||
|
||||
//distance attenuation
|
||||
float dist2 = d*d/(la*la);
|
||||
float da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
|
||||
// spotlight coefficient.
|
||||
float spot = max(dot(-ln, lv), is_pointlight);
|
||||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
//angular attenuation
|
||||
da *= calcDirectionalLight(n, lv);
|
||||
|
||||
return da;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
|
@ -55,21 +79,21 @@ void main()
|
|||
//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
|
||||
vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
|
||||
|
||||
// Collect normal lights (need to be divided by two, as we later multiply by 2)
|
||||
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a);
|
||||
col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a);
|
||||
col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a);
|
||||
col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a);
|
||||
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a);
|
||||
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a);
|
||||
col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz);
|
||||
col.rgb = scaleDownLight(col.rgb);
|
||||
// Collect normal lights
|
||||
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
|
||||
col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a);
|
||||
col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a);
|
||||
col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a);
|
||||
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
|
||||
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
|
||||
|
||||
vary_pointlight_col = col.rgb*gl_Color.rgb;
|
||||
|
||||
col.rgb = vec3(0,0,0);
|
||||
|
||||
// Add windlight lights
|
||||
col.rgb += atmosAmbient(vec3(0.));
|
||||
|
||||
vary_light = gl_LightSource[0].position.xyz;
|
||||
|
||||
col.rgb = atmosAmbient(vec3(0.));
|
||||
|
||||
vary_ambient = col.rgb*gl_Color.rgb;
|
||||
vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ varying vec3 vary_ambient;
|
|||
varying vec3 vary_directional;
|
||||
varying vec3 vary_fragcoord;
|
||||
varying vec3 vary_position;
|
||||
varying vec3 vary_light;
|
||||
varying vec3 vary_pointlight_col;
|
||||
|
||||
uniform float near_clip;
|
||||
|
|
@ -86,8 +85,6 @@ void main()
|
|||
// Add windlight lights
|
||||
col.rgb = atmosAmbient(vec3(0.));
|
||||
|
||||
vary_light = gl_LightSource[0].position.xyz;
|
||||
|
||||
vary_ambient = col.rgb*gl_Color.rgb;
|
||||
vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ Disregard96DefaultDrawDistance 1 1
|
|||
RenderTextureMemoryMultiple 1 1.0
|
||||
SkyUseClassicClouds 1 1
|
||||
RenderShaderLightingMaxLevel 1 3
|
||||
RenderDeferred 1 0
|
||||
RenderDeferred 1 1
|
||||
RenderDeferredSSAO 1 1
|
||||
RenderShadowDetail 1 2
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ Disregard128DefaultDrawDistance 1 1
|
|||
Disregard96DefaultDrawDistance 1 1
|
||||
SkyUseClassicClouds 1 1
|
||||
WatchdogDisabled 1 1
|
||||
RenderDeferred 1 1
|
||||
RenderDeferredSSAO 1 1
|
||||
RenderShadowDetail 1 2
|
||||
|
||||
|
||||
//
|
||||
// Low Graphics Settings
|
||||
|
|
@ -91,6 +95,10 @@ VertexShaderEnable 1 0
|
|||
WindLightUseAtmosShaders 1 0
|
||||
WLSkyDetail 1 48
|
||||
SkyUseClassicClouds 1 0
|
||||
RenderDeferred 1 0
|
||||
RenderDeferredSSAO 1 0
|
||||
RenderShadowDetail 1 2
|
||||
|
||||
|
||||
//
|
||||
// Mid Graphics Settings
|
||||
|
|
@ -118,6 +126,10 @@ RenderWaterReflections 1 0
|
|||
VertexShaderEnable 1 1
|
||||
WindLightUseAtmosShaders 1 0
|
||||
WLSkyDetail 1 48
|
||||
RenderDeferred 1 0
|
||||
RenderDeferredSSAO 1 0
|
||||
RenderShadowDetail 1 2
|
||||
|
||||
|
||||
//
|
||||
// High Graphics Settings (purty)
|
||||
|
|
@ -145,6 +157,10 @@ RenderWaterReflections 1 0
|
|||
VertexShaderEnable 1 1
|
||||
WindLightUseAtmosShaders 1 1
|
||||
WLSkyDetail 1 48
|
||||
RenderDeferred 1 0
|
||||
RenderDeferredSSAO 1 0
|
||||
RenderShadowDetail 1 2
|
||||
|
||||
|
||||
//
|
||||
// Ultra graphics (REALLY PURTY!)
|
||||
|
|
@ -172,6 +188,10 @@ RenderWaterReflections 1 1
|
|||
VertexShaderEnable 1 1
|
||||
WindLightUseAtmosShaders 1 1
|
||||
WLSkyDetail 1 128
|
||||
RenderDeferred 1 0
|
||||
RenderDeferredSSAO 1 0
|
||||
RenderShadowDetail 1 2
|
||||
|
||||
|
||||
//
|
||||
// Class Unknown Hardware (unknown)
|
||||
|
|
|
|||
|
|
@ -26,12 +26,6 @@
|
|||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#if defined(_DEBUG)
|
||||
# if _MSC_VER >= 1400 // Visual C++ 2005 or later
|
||||
# define WINDOWS_CRT_MEM_CHECKS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "llappviewerwin32.h"
|
||||
|
||||
#include "llmemtype.h"
|
||||
|
|
|
|||
|
|
@ -112,8 +112,6 @@ const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
|
|||
const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
|
||||
const S32 PREVIEW_TEXTURE_HEIGHT = 300;
|
||||
|
||||
const F32 MAXIMUM_PIVOT_OFFSET = 64.0f;
|
||||
|
||||
void drawBoxOutline(const LLVector3& pos, const LLVector3& size);
|
||||
|
||||
|
||||
|
|
@ -1772,8 +1770,6 @@ bool LLModelLoader::doLoadModel()
|
|||
|
||||
processElement(scene);
|
||||
|
||||
handlePivotPoint( root );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1963,49 +1959,6 @@ void LLModelLoader::processJointToNodeMapping( domNode* pNode )
|
|||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// handlePivotPoint()
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLModelLoader::handlePivotPoint( daeElement* pRoot )
|
||||
{
|
||||
//Import an optional pivot point - a pivot point is just a node in the visual scene named "AssetPivot"
|
||||
//If no assetpivot is found then the asset will use the SL default
|
||||
daeElement* pScene = pRoot->getDescendant("visual_scene");
|
||||
if ( pScene )
|
||||
{
|
||||
daeTArray< daeSmartRef<daeElement> > children = pScene->getChildren();
|
||||
S32 childCount = children.getCount();
|
||||
for (S32 i = 0; i < childCount; ++i)
|
||||
{
|
||||
domNode* pNode = daeSafeCast<domNode>(children[i]);
|
||||
if ( pNode && isNodeAPivotPoint( pNode ) )
|
||||
{
|
||||
LLMatrix4 workingTransform;
|
||||
daeSIDResolver nodeResolver( pNode, "./translate" );
|
||||
domTranslate* pTranslate = daeSafeCast<domTranslate>( nodeResolver.getElement() );
|
||||
//Translation via SID was successful
|
||||
//todo#extract via element as well
|
||||
if ( pTranslate )
|
||||
{
|
||||
extractTranslation( pTranslate, workingTransform );
|
||||
LLVector3 pivotTrans = workingTransform.getTranslation();
|
||||
if ( pivotTrans[VX] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VX] < -MAXIMUM_PIVOT_OFFSET ||
|
||||
pivotTrans[VY] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VY] < -MAXIMUM_PIVOT_OFFSET ||
|
||||
pivotTrans[VZ] > MAXIMUM_PIVOT_OFFSET || pivotTrans[VZ] < -MAXIMUM_PIVOT_OFFSET )
|
||||
{
|
||||
llwarns<<"Asset Pivot Node contains an offset that is too large - values should be within (-"<<MAXIMUM_PIVOT_OFFSET<<","<<MAXIMUM_PIVOT_OFFSET<<")."<<llendl;
|
||||
mPreview->setHasPivot( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
mPreview->setModelPivot( pivotTrans );
|
||||
mPreview->setHasPivot( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// critiqueRigForUploadApplicability()
|
||||
|
|
@ -2205,27 +2158,7 @@ bool LLModelLoader::isNodeAJoint( domNode* pNode )
|
|||
|
||||
return false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
// isNodeAPivotPoint()
|
||||
//-----------------------------------------------------------------------------
|
||||
bool LLModelLoader::isNodeAPivotPoint( domNode* pNode )
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if ( pNode && pNode->getName() )
|
||||
{
|
||||
std::string name = pNode->getName();
|
||||
if ( name == "AssetPivot" )
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// extractTranslation()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -2852,27 +2785,6 @@ void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost,
|
|||
childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost));
|
||||
}
|
||||
|
||||
void LLModelPreview::alterModelsPivot( void )
|
||||
{
|
||||
for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter)
|
||||
{
|
||||
if ( *iter )
|
||||
{
|
||||
(*iter)->offsetMesh( mModelPivot );
|
||||
}
|
||||
}
|
||||
|
||||
for ( int i=0;i<LLModel::NUM_LODS;++i )
|
||||
{
|
||||
for (LLModelLoader::model_list::iterator iter = mModel[i].begin(); iter != mModel[i].end(); ++iter)
|
||||
{
|
||||
if ( *iter )
|
||||
{
|
||||
(*iter)->offsetMesh( mModelPivot );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLModelPreview::rebuildUploadData()
|
||||
{
|
||||
|
|
@ -3643,21 +3555,19 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_lim
|
|||
glodGroupParameterf(mGroup, GLOD_OBJECT_SPACE_ERROR_THRESHOLD, lod_error_threshold);
|
||||
stop_gloderror();
|
||||
|
||||
glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, 0);
|
||||
stop_gloderror();
|
||||
|
||||
glodAdaptGroup(mGroup);
|
||||
stop_gloderror();
|
||||
|
||||
if (lod_mode == GLOD_TRIANGLE_BUDGET)
|
||||
{ //SH-632 Always adapt to 0 before adapting to actual desired amount, and always
|
||||
//add 1 to desired amount to avoid decimating below desired amount
|
||||
glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, triangle_count+1);
|
||||
stop_gloderror();
|
||||
|
||||
glodAdaptGroup(mGroup);
|
||||
stop_gloderror();
|
||||
if (lod_mode != GLOD_TRIANGLE_BUDGET)
|
||||
{
|
||||
glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
//SH-632: always add 1 to desired amount to avoid decimating below desired amount
|
||||
glodGroupParameteri(mGroup, GLOD_MAX_TRIANGLES, triangle_count+1);
|
||||
}
|
||||
|
||||
stop_gloderror();
|
||||
glodAdaptGroup(mGroup);
|
||||
stop_gloderror();
|
||||
|
||||
for (U32 mdl_idx = 0; mdl_idx < mBaseModel.size(); ++mdl_idx)
|
||||
{
|
||||
|
|
@ -4973,11 +4883,6 @@ void LLFloaterModelPreview::onUpload(void* user_data)
|
|||
|
||||
LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data;
|
||||
|
||||
if ( mp && mp->mModelPreview->mHasPivot )
|
||||
{
|
||||
mp->mModelPreview->alterModelsPivot();
|
||||
}
|
||||
|
||||
mp->mModelPreview->rebuildUploadData();
|
||||
|
||||
bool upload_skinweights = mp->childGetValue("upload_skin").asBoolean();
|
||||
|
|
|
|||
|
|
@ -120,9 +120,6 @@ public:
|
|||
void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform );
|
||||
void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform );
|
||||
|
||||
void handlePivotPoint( daeElement* pRoot );
|
||||
bool isNodeAPivotPoint( domNode* pNode );
|
||||
|
||||
void setLoadState(U32 state);
|
||||
|
||||
void buildJointToNodeMappingFromScene( daeElement* pRoot );
|
||||
|
|
@ -298,7 +295,6 @@ public:
|
|||
void loadModelCallback(S32 lod);
|
||||
void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
|
||||
void generateNormals();
|
||||
void alterModelsPivot( void );
|
||||
void clearMaterials();
|
||||
U32 calcResourceCost();
|
||||
void rebuildUploadData();
|
||||
|
|
|
|||
|
|
@ -1580,27 +1580,7 @@ void LLMeshUploadThread::doIterativeUpload()
|
|||
}
|
||||
|
||||
//queue up models for hull generation
|
||||
LLModel* physics = NULL;
|
||||
|
||||
if (data.mModel[LLModel::LOD_PHYSICS].notNull())
|
||||
{
|
||||
physics = data.mModel[LLModel::LOD_PHYSICS];
|
||||
}
|
||||
else if (data.mModel[LLModel::LOD_MEDIUM].notNull())
|
||||
{
|
||||
physics = data.mModel[LLModel::LOD_MEDIUM];
|
||||
}
|
||||
else
|
||||
{
|
||||
physics = data.mModel[LLModel::LOD_HIGH];
|
||||
}
|
||||
|
||||
if (!physics)
|
||||
{
|
||||
llerrs << "WTF?" << llendl;
|
||||
}
|
||||
|
||||
DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
|
||||
DecompRequest* request = new DecompRequest(data.mModel[LLModel::LOD_HIGH], data.mBaseModel, this);
|
||||
gMeshRepo.mDecompThread->submitRequest(request);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -756,6 +756,10 @@ LLVector3 LLViewerCamera::roundToPixel(const LLVector3 &pos_agent)
|
|||
|
||||
BOOL LLViewerCamera::cameraUnderWater() const
|
||||
{
|
||||
if(!gAgent.getRegion())
|
||||
{
|
||||
return FALSE ;
|
||||
}
|
||||
return getOrigin().mV[VZ] < gAgent.getRegion()->getWaterHeight();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -825,7 +825,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
|
|||
//}
|
||||
|
||||
LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
|
||||
LLPipeline::updateRenderDeferred();
|
||||
LLPipeline::refreshRenderDeferred();
|
||||
|
||||
stop_glerror();
|
||||
|
||||
|
|
|
|||
|
|
@ -784,6 +784,21 @@ void LLPipeline::updateRenderDeferred()
|
|||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLPipeline::refreshRenderDeferred()
|
||||
{
|
||||
if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES))
|
||||
{
|
||||
//turn the deferred rendering and glow off when draw physics shapes.
|
||||
sRenderDeferred = FALSE ;
|
||||
sRenderGlow = FALSE ;
|
||||
}
|
||||
else
|
||||
{
|
||||
updateRenderDeferred() ;
|
||||
}
|
||||
}
|
||||
|
||||
void LLPipeline::releaseGLBuffers()
|
||||
{
|
||||
assertInitialized();
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ public:
|
|||
static BOOL getRenderHighlights(void* data);
|
||||
|
||||
static void updateRenderDeferred();
|
||||
static void refreshRenderDeferred();
|
||||
|
||||
private:
|
||||
void unloadShaders();
|
||||
|
|
|
|||
|
|
@ -449,12 +449,12 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
|
|||
<slider
|
||||
follows="left|top"
|
||||
height="20"
|
||||
increment="0.5"
|
||||
increment="1"
|
||||
layout="topleft"
|
||||
left="204"
|
||||
max_val="4"
|
||||
initial_value="3"
|
||||
min_val="2"
|
||||
max_val="3"
|
||||
initial_value="2"
|
||||
min_val="0"
|
||||
name="accuracy_slider"
|
||||
show_text="false"
|
||||
top="130"
|
||||
|
|
@ -464,7 +464,8 @@ Advanced users familiar with 3d content creation tools may prefer to use the [se
|
|||
top_pad="0"
|
||||
width="300"
|
||||
left_delta="6"
|
||||
height="4">' ' '</text>
|
||||
height="4">'
|
||||
</text>
|
||||
|
||||
|
||||
<icon
|
||||
|
|
|
|||
Loading…
Reference in New Issue