Merged in graham_linden/viewer-eep-fixes (pull request #237)

SL-10303
meow-7.2.2
Rider Linden 2019-01-25 22:04:47 +00:00
commit 64ce16aa07
7 changed files with 38 additions and 29 deletions

View File

@ -40,17 +40,21 @@ uniform sampler2D diffuseMap;
uniform sampler2D altDiffuseMap;
uniform float blend_factor; // interp factor between sunDisc A/B
VARYING vec2 vary_texcoord0;
VARYING float sun_fade;
void main()
{
vec4 sunDiscA = texture2D(diffuseMap, vary_texcoord0.xy);
vec4 sunDiscB = texture2D(altDiffuseMap, vary_texcoord0.xy);
vec4 sunDiscA = texture2D(diffuseMap, vary_texcoord0.xy);
vec4 sunDiscB = texture2D(altDiffuseMap, vary_texcoord0.xy);
vec4 c = mix(sunDiscA, sunDiscB, blend_factor);
c.rgb = clamp(c.rgb, vec3(0), vec3(1));
c.rgb = pow(c.rgb, vec3(0.7f));
c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = pow(c.rgb, vec3(0.7f));
c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = fullbrightScaleSoftClip(c.rgb);
frag_data[0] = c;
c.a *= sun_fade;
frag_data[0] = c;
frag_data[1] = vec4(0.0f);
frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0);
}

View File

@ -31,18 +31,22 @@ ATTRIBUTE vec3 position;
ATTRIBUTE vec2 texcoord0;
VARYING vec2 vary_texcoord0;
VARYING float sun_fade;
void calcAtmospherics(vec3 eye_pos);
void main()
{
//transform vertex
vec4 vert = vec4(position.xyz - vec3(0, 0, 50), 1.0);
vec4 pos = modelview_projection_matrix*vert;
//transform vertex
vec3 offset = vec3(0, 0, 50);
vec4 vert = vec4(position.xyz - offset, 1.0);
vec4 pos = modelview_projection_matrix*vert;
gl_Position = pos;
sun_fade = smoothstep(0.3, 1.0, (position.z + 50) / 512.0f);
gl_Position = pos;
calcAtmospherics(pos.xyz);
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
}

View File

@ -40,15 +40,18 @@ uniform sampler2D diffuseMap;
uniform sampler2D altDiffuseMap;
uniform float blend_factor; // interp factor between sun A/B
VARYING vec2 vary_texcoord0;
VARYING float sun_fade;
void main()
{
vec4 sunA = texture2D(diffuseMap, vary_texcoord0.xy);
vec4 sunB = texture2D(altDiffuseMap, vary_texcoord0.xy);
vec4 sunA = texture2D(diffuseMap, vary_texcoord0.xy);
vec4 sunB = texture2D(altDiffuseMap, vary_texcoord0.xy);
vec4 c = mix(sunA, sunB, blend_factor);
c.a *= sun_fade;
c.rgb = pow(c.rgb, vec3(0.7f));
c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = fullbrightScaleSoftClip(c.rgb);
frag_color = c;
frag_color = c;
}

View File

@ -31,18 +31,20 @@ ATTRIBUTE vec3 position;
ATTRIBUTE vec2 texcoord0;
VARYING vec2 vary_texcoord0;
VARYING float sun_fade;
void calcAtmospherics(vec3 eye_pos);
void main()
{
//transform vertex
vec4 vert = vec4(position.xyz - vec3(0, 0, 50), 1.0);
vec4 pos = modelview_projection_matrix*vert;
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
vec4 pos = modelview_projection_matrix*vert;
gl_Position = pos;
sun_fade = smoothstep(0.3, 1.0, (position.z + 50) / 512.0f);
gl_Position = pos;
calcAtmospherics(pos.xyz);
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
}

View File

@ -62,8 +62,8 @@ void calcAtmospherics(vec3 inPositionEye) {
setPositionEye(P);
//(TERRAIN) limit altitude
if (P.y > max_y) P *= (max_y / P.y);
if (P.y < -max_y) P *= (-max_y / P.y);
//if (P.y > max_y) P *= (max_y / P.y);
//if (P.y < -max_y) P *= (-max_y / P.y);
vec3 tmpLightnorm = lightnorm.xyz;

View File

@ -117,10 +117,6 @@
#include "llenvironment.h"
#if LL_WINDOWS
#pragma optimize("", off)
#endif
#ifdef _DEBUG
// Debug indices is disabled for now for debug performance - djs 4/24/02
//#define DEBUG_INDICES

View File

@ -78,7 +78,7 @@
decimal_digits="2"
follows="left|top"
height="16"
increment="0.25"
increment="0.01"
initial_value="0"
layout="topleft"
left_delta="5"
@ -254,7 +254,7 @@
decimal_digits="2"
follows="left|top"
height="16"
increment="0.25"
increment="0.01"
initial_value="0"
layout="topleft"
left_delta="5"