Merged in SL-10449 (pull request #63)
SL-10449 Approved-by: Dave Houlton <euclid@lindenlab.com>meow-7.2.2
commit
538a6d737d
|
|
@ -569,23 +569,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)
|
||||
|
|
@ -599,8 +594,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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue