Merge branch 'DRTVWR-440' of https://bitbucket.org/lindenlab/viewer
commit
12c68bac09
|
|
@ -575,23 +575,18 @@ static std::string get_object_log(GLhandleARB ret)
|
|||
|
||||
//dump shader source for debugging
|
||||
void LLShaderMgr::dumpShaderSource(U32 shader_code_count, GLcharARB** shader_code_text)
|
||||
{
|
||||
{
|
||||
char num_str[16]; // U32 = max 10 digits
|
||||
|
||||
LL_SHADER_LOADING_WARNS() << "\n";
|
||||
|
||||
for (U32 i = 0; i < shader_code_count; i++)
|
||||
{
|
||||
GLcharARB *line = shader_code_text[i];
|
||||
size_t len = strlen( line );
|
||||
GLcharARB last = len > 0 ? line[len - 1] : 0;
|
||||
|
||||
// LL_ENDL already outputs a newline so temporarily strip off the end newline to prevent EVERY line outputting an (extra) blank line
|
||||
if (last == '\n')
|
||||
line[len - 1] = 0;
|
||||
|
||||
LL_SHADER_LOADING_WARNS() << i << ": " << shader_code_text[i] << LL_ENDL;
|
||||
|
||||
if (last == '\n')
|
||||
line[len - 1] = '\n';
|
||||
snprintf(num_str, sizeof(num_str), "%4d: ", i+1);
|
||||
std::string line_number(num_str);
|
||||
LL_CONT << line_number << shader_code_text[i];
|
||||
}
|
||||
LL_SHADER_LOADING_WARNS() << LL_ENDL;
|
||||
LL_CONT << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string& filename)
|
||||
|
|
@ -605,8 +600,8 @@ void LLShaderMgr::dumpObjectLog(GLhandleARB ret, BOOL warns, const std::string&
|
|||
|
||||
if (log.length() > 0)
|
||||
{
|
||||
LL_SHADER_LOADING_WARNS() << "Shader loading from " << fname << ":\n" << LL_ENDL;
|
||||
LL_SHADER_LOADING_WARNS() << log << LL_ENDL;
|
||||
LL_SHADER_LOADING_WARNS() << "Shader loading from " << fname << LL_ENDL;
|
||||
LL_SHADER_LOADING_WARNS() << "\n" << log << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -234,14 +234,14 @@ void main()
|
|||
diffcol.rgb = srgb_to_linear(diffcol.rgb);
|
||||
#endif
|
||||
|
||||
#if HAS_SPECULAR_MAP != 0
|
||||
#ifdef HAS_SPECULAR_MAP
|
||||
vec4 spec = texture2D(specularMap, vary_texcoord2.xy);
|
||||
spec.rgb *= specular_color.rgb;
|
||||
#else
|
||||
vec4 spec = vec4(specular_color.rgb, 1.0);
|
||||
#endif
|
||||
|
||||
#if HAS_NORMAL_MAP
|
||||
#ifdef HAS_NORMAL_MAP
|
||||
vec4 norm = texture2D(bumpMap, vary_texcoord1.xy);
|
||||
|
||||
norm.xyz = norm.xyz * 2 - 1;
|
||||
|
|
@ -268,7 +268,7 @@ void main()
|
|||
|
||||
vec4 final_specular = spec;
|
||||
|
||||
#if HAS_SPECULAR_MAP != 0
|
||||
#ifdef HAS_SPECULAR_MAP
|
||||
vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity * spec.a, 0.0);
|
||||
final_specular.a = specular_color.a * norm.a;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -74,13 +74,13 @@ void main()
|
|||
vec3 viewVec = normalize(view.xyz);
|
||||
|
||||
//get wave normals
|
||||
//get wave normals
|
||||
vec3 wave1_a = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
|
||||
vec2 bigwave = vec2(refCoord.w, view.w);
|
||||
vec3 wave1_a = texture2D(bumpMap, bigwave ).xyz*2.0-1.0;
|
||||
vec3 wave2_a = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0;
|
||||
vec3 wave3_a = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0;
|
||||
|
||||
|
||||
vec3 wave1_b = texture2D(bumpMap2, vec2(refCoord.w, view.w)).xyz*2.0-1.0;
|
||||
vec3 wave1_b = texture2D(bumpMap2, bigwave ).xyz*2.0-1.0;
|
||||
vec3 wave2_b = texture2D(bumpMap2, littleWave.xy).xyz*2.0-1.0;
|
||||
vec3 wave3_b = texture2D(bumpMap2, littleWave.zw).xyz*2.0-1.0;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ ATTRIBUTE vec2 texcoord0;
|
|||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
VARYING vec3 vary_texcoord1;
|
||||
VARYING vec4 vary_position;
|
||||
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
|
@ -46,6 +47,9 @@ void main()
|
|||
|
||||
mat = modelview_matrix * mat;
|
||||
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
|
||||
|
||||
mat4 mvp = modelview_matrix * projection_matrix;
|
||||
vary_position = mvp * vec4(position, 1.0);
|
||||
|
||||
vec4 norm = vec4(position.xyz, 1.0);
|
||||
norm.xyz += normal.xyz;
|
||||
|
|
|
|||
|
|
@ -1608,11 +1608,8 @@ void LLEnvironment::updateGLVariablesForSettings(LLGLSLShader *shader, const LLS
|
|||
|
||||
void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader)
|
||||
{
|
||||
if (gPipeline.canUseWindLightShaders())
|
||||
{
|
||||
updateGLVariablesForSettings(shader, mCurrentEnvironment->getWater());
|
||||
updateGLVariablesForSettings(shader, mCurrentEnvironment->getSky());
|
||||
}
|
||||
updateGLVariablesForSettings(shader, mCurrentEnvironment->getWater());
|
||||
updateGLVariablesForSettings(shader, mCurrentEnvironment->getSky());
|
||||
}
|
||||
|
||||
void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition)
|
||||
|
|
|
|||
Loading…
Reference in New Issue