Merge branch 'future'
This commit is contained in:
@@ -100,12 +100,14 @@ set(viewer_SOURCE_FILES
|
||||
jcfloaterareasearch.cpp
|
||||
chatbar_as_cmdline.cpp
|
||||
qtoolalign.cpp
|
||||
llaccountingcostmanager.cpp
|
||||
llagent.cpp
|
||||
llagentaccess.cpp
|
||||
llagentcamera.cpp
|
||||
llagentdata.cpp
|
||||
llagentlanguage.cpp
|
||||
llagentpilot.cpp
|
||||
llagentui.cpp
|
||||
llagentwearables.cpp
|
||||
llanimstatelabels.cpp
|
||||
llappviewer.cpp
|
||||
@@ -114,7 +116,6 @@ set(viewer_SOURCE_FILES
|
||||
llassetuploadqueue.cpp
|
||||
llattachmentsmgr.cpp
|
||||
llaudiosourcevo.cpp
|
||||
llbbox.cpp
|
||||
llbox.cpp
|
||||
llbuildnewviewsscheduler.cpp
|
||||
llcallbacklist.cpp
|
||||
@@ -293,6 +294,7 @@ set(viewer_SOURCE_FILES
|
||||
llmediaremotectrl.cpp
|
||||
llmemoryview.cpp
|
||||
llmenucommands.cpp
|
||||
llmeshrepository.cpp
|
||||
llmimetypes.cpp
|
||||
llmorphview.cpp
|
||||
llmoveview.cpp
|
||||
@@ -425,6 +427,7 @@ set(viewer_SOURCE_FILES
|
||||
llvelocitybar.cpp
|
||||
llviewchildren.cpp
|
||||
llviewerassetstorage.cpp
|
||||
llviewerassettype.cpp
|
||||
llvieweraudio.cpp
|
||||
llviewercamera.cpp
|
||||
llviewercontrol.cpp
|
||||
@@ -576,12 +579,14 @@ set(viewer_HEADER_FILES
|
||||
lgghunspell_wrapper.h
|
||||
chatbar_as_cmdline.h
|
||||
qtoolalign.h
|
||||
llaccountingcostmanager.h
|
||||
llagent.h
|
||||
llagentaccess.h
|
||||
llagentcamera.h
|
||||
llagentdata.h
|
||||
llagentlanguage.h
|
||||
llagentpilot.h
|
||||
llagentui.h
|
||||
llagentwearables.h
|
||||
llanimstatelabels.h
|
||||
llappearance.h
|
||||
@@ -591,7 +596,6 @@ set(viewer_HEADER_FILES
|
||||
llassetuploadqueue.h
|
||||
llattachmentsmgr.h
|
||||
llaudiosourcevo.h
|
||||
llbbox.h
|
||||
llbox.h
|
||||
llbuildnewviewsscheduler.h
|
||||
llcallbacklist.h
|
||||
@@ -770,6 +774,7 @@ set(viewer_HEADER_FILES
|
||||
llmediaremotectrl.h
|
||||
llmemoryview.h
|
||||
llmenucommands.h
|
||||
llmeshrepository.h
|
||||
llmimetypes.h
|
||||
llmorphview.h
|
||||
llmoveview.h
|
||||
@@ -906,6 +911,7 @@ set(viewer_HEADER_FILES
|
||||
llvelocitybar.h
|
||||
llviewchildren.h
|
||||
llviewerassetstorage.h
|
||||
llviewerassettype.h
|
||||
llvieweraudio.h
|
||||
llviewerbuild.h
|
||||
llviewercamera.h
|
||||
@@ -1606,6 +1612,13 @@ endif (LL_TESTS)
|
||||
if (WINDOWS)
|
||||
|
||||
get_target_property(BUILT_LLCOMMON llcommon LOCATION)
|
||||
|
||||
set_target_properties(llcommon
|
||||
PROPERTIES
|
||||
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT"
|
||||
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\""
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
|
||||
@@ -1182,6 +1182,10 @@ OBJECT_VELOCITY
|
||||
OBJECT_OWNER
|
||||
OBJECT_GROUP
|
||||
OBJECT_CREATOR
|
||||
OBJECT_RUNNING_SCRIPT_COUNT
|
||||
OBJECT_TOTAL_SCRIPT_COUNT
|
||||
OBJECT_SCRIPT_MEMORY
|
||||
OBJECT_SCRIPT_TIME
|
||||
VEHICLE_TYPE_NONE
|
||||
VEHICLE_TYPE_SLED
|
||||
VEHICLE_TYPE_CAR
|
||||
@@ -1478,6 +1482,8 @@ PARCEL_DETAILS_DESC
|
||||
PARCEL_DETAILS_OWNER
|
||||
PARCEL_DETAILS_GROUP
|
||||
PARCEL_DETAILS_AREA
|
||||
PARCEL_DETAILS_ID
|
||||
PARCEL_DETAILS_SEE_AVATARS
|
||||
STRING_TRIM_HEAD
|
||||
STRING_TRIM_TAIL
|
||||
STRING_TRIM
|
||||
|
||||
@@ -162,6 +162,10 @@ OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity.
|
||||
OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned.
|
||||
OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key.
|
||||
OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key.
|
||||
OBJECT_RUNNING_SCRIPT_COUNT Used with llGetObjectDetails to get an object's velocity.
|
||||
OBJECT_TOTAL_SCRIPT_COUNT Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned.
|
||||
OBJECT_SCRIPT_MEMORY Used with llGetObjectDetails to get an object's group's key.
|
||||
OBJECT_SCRIPT_TIME Used with llGetObjectDetails to get an object's creator's key.
|
||||
|
||||
# some vehicle params
|
||||
VEHICLE_TYPE_NONE
|
||||
@@ -502,6 +506,8 @@ PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description.
|
||||
PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id.
|
||||
PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id.
|
||||
PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters.
|
||||
PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id.
|
||||
PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting.
|
||||
|
||||
STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string.
|
||||
STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,6 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
void default_lighting();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
attribute vec4 weight; //1
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
||||
mat4 getSkinnedTransform();
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
void default_lighting();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @file objectSkinV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
attribute vec4 object_weight;
|
||||
|
||||
uniform mat4 matrixPalette[32];
|
||||
|
||||
mat4 getObjectSkinnedTransform()
|
||||
{
|
||||
int i;
|
||||
|
||||
vec4 w = fract(object_weight);
|
||||
vec4 index = floor(object_weight);
|
||||
|
||||
float scale = 1.0/(w.x+w.y+w.z+w.w);
|
||||
w *= scale;
|
||||
|
||||
mat4 mat = matrixPalette[int(index.x)]*w.x;
|
||||
mat += matrixPalette[int(index.y)]*w.y;
|
||||
mat += matrixPalette[int(index.z)]*w.z;
|
||||
mat += matrixPalette[int(index.w)]*w.w;
|
||||
|
||||
return mat;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
mat4 getSkinnedTransform();
|
||||
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
/**
|
||||
* @file alphaF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform sampler2DRect depthMap;
|
||||
|
||||
vec4 diffuseLookup(vec2 texcoord);
|
||||
|
||||
uniform mat4 shadow_matrix[6];
|
||||
uniform vec4 shadow_clip;
|
||||
uniform vec2 screen_res;
|
||||
@@ -47,7 +48,7 @@ void main()
|
||||
|
||||
vec4 pos = vec4(vary_position, 1.0);
|
||||
|
||||
vec4 diff= texture2D(diffuseMap, gl_TexCoord[0].xy);
|
||||
vec4 diff= diffuseLookup(gl_TexCoord[0].xy);
|
||||
|
||||
vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a);
|
||||
vec4 color = diff * col;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* @file alphaF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
uniform sampler2DRect depthMap;
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
uniform mat4 shadow_matrix[6];
|
||||
uniform vec4 shadow_clip;
|
||||
uniform vec2 screen_res;
|
||||
|
||||
vec3 atmosLighting(vec3 light);
|
||||
vec3 scaleSoftClip(vec3 light);
|
||||
|
||||
varying vec3 vary_ambient;
|
||||
varying vec3 vary_directional;
|
||||
varying vec3 vary_fragcoord;
|
||||
varying vec3 vary_position;
|
||||
varying vec3 vary_pointlight_col;
|
||||
|
||||
uniform mat4 inv_proj;
|
||||
|
||||
vec4 getPosition(vec2 pos_screen)
|
||||
{
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
vec2 sc = pos_screen.xy*2.0;
|
||||
sc /= screen_res;
|
||||
sc -= vec2(1.0,1.0);
|
||||
vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
|
||||
vec4 pos = inv_proj * ndc;
|
||||
pos /= pos.w;
|
||||
pos.w = 1.0;
|
||||
return pos;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
|
||||
frag *= screen_res;
|
||||
|
||||
vec4 pos = vec4(vary_position, 1.0);
|
||||
|
||||
vec4 diff= texture2D(diffuseMap,gl_TexCoord[0].xy);
|
||||
|
||||
vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a);
|
||||
vec4 color = diff * col;
|
||||
|
||||
color.rgb = atmosLighting(color.rgb);
|
||||
|
||||
color.rgb = scaleSoftClip(color.rgb);
|
||||
|
||||
color.rgb += diff.rgb * vary_pointlight_col.rgb;
|
||||
|
||||
gl_FragColor = color;
|
||||
//gl_FragColor = vec4(1,0,1,1);
|
||||
//gl_FragColor = vec4(1,0,1,1)*shadow;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* @file alphaSkinnedV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
||||
mat4 getObjectSkinnedTransform();
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l);
|
||||
|
||||
vec3 atmosAmbient(vec3 light);
|
||||
vec3 atmosAffectDirectionalLight(float lightIntensity);
|
||||
vec3 scaleDownLight(vec3 light);
|
||||
vec3 scaleUpLight(vec3 light);
|
||||
|
||||
varying vec3 vary_position;
|
||||
varying vec3 vary_ambient;
|
||||
varying vec3 vary_directional;
|
||||
varying vec3 vary_normal;
|
||||
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);
|
||||
|
||||
float da = 0.0;
|
||||
|
||||
if (d > 0.0 && la > 0.0 && fa > 0.0)
|
||||
{
|
||||
//normalize light vector
|
||||
lv *= 1.0/d;
|
||||
|
||||
//distance attenuation
|
||||
float dist2 = d*d/(la*la);
|
||||
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;
|
||||
|
||||
vec4 pos;
|
||||
vec3 norm;
|
||||
|
||||
mat4 trans = getObjectSkinnedTransform();
|
||||
trans = gl_ModelViewMatrix * trans;
|
||||
|
||||
pos = trans * gl_Vertex;
|
||||
|
||||
norm = gl_Vertex.xyz + gl_Normal.xyz;
|
||||
norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
|
||||
|
||||
vec4 frag_pos = gl_ProjectionMatrix * pos;
|
||||
gl_Position = frag_pos;
|
||||
|
||||
vary_position = pos.xyz;
|
||||
vary_normal = norm;
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
|
||||
|
||||
// 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_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)));
|
||||
|
||||
col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
|
||||
|
||||
gl_FrontColor = col;
|
||||
|
||||
gl_FogFragCoord = pos.z;
|
||||
|
||||
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
@@ -23,6 +23,7 @@ varying vec3 vary_fragcoord;
|
||||
varying vec3 vary_position;
|
||||
varying vec3 vary_light;
|
||||
varying vec3 vary_pointlight_col;
|
||||
varying float vary_texture_index;
|
||||
|
||||
uniform float near_clip;
|
||||
uniform float shadow_offset;
|
||||
@@ -35,20 +36,25 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
|
||||
|
||||
//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);
|
||||
float da = 0.0;
|
||||
|
||||
if (d > 0.0 && la > 0.0 && fa > 0.0)
|
||||
{
|
||||
//normalize light vector
|
||||
lv *= 1.0/d;
|
||||
|
||||
//distance attenuation
|
||||
float dist2 = d*d/(la*la);
|
||||
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;
|
||||
}
|
||||
@@ -56,34 +62,35 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = ftransform();
|
||||
vec4 vert = vec4(gl_Vertex.xyz, 1.0);
|
||||
vary_texture_index = gl_Vertex.w;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * vert;
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
|
||||
vec4 pos = (gl_ModelViewMatrix * vert);
|
||||
vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
|
||||
|
||||
float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
|
||||
vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
|
||||
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
//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
|
||||
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[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.));
|
||||
|
||||
@@ -98,7 +105,7 @@ void main()
|
||||
|
||||
gl_FogFragCoord = pos.z;
|
||||
|
||||
pos = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
pos = gl_ModelViewProjectionMatrix * vert;
|
||||
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @file avatarShadowF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a);
|
||||
gl_FragColor = vec4(1,1,1,1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @file attachmentShadowV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
mat4 getObjectSkinnedTransform();
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
mat4 mat = getObjectSkinnedTransform();
|
||||
|
||||
mat = gl_ModelViewMatrix * mat;
|
||||
vec3 pos = (mat*gl_Vertex).xyz;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0);
|
||||
p.z = max(p.z, -p.w+0.01);
|
||||
gl_Position = p;
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file avatarAlphaV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
||||
mat4 getSkinnedTransform();
|
||||
@@ -35,19 +35,24 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
|
||||
//get distance
|
||||
float d = length(lv);
|
||||
|
||||
//normalize light vector
|
||||
lv *= 1.0/d;
|
||||
float da = 0.0;
|
||||
|
||||
if (d > 0.0 && la > 0.0 && fa > 0.0)
|
||||
{
|
||||
//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);
|
||||
//distance attenuation
|
||||
float dist2 = d*d/(la*la);
|
||||
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
|
||||
// spotlight coefficient.
|
||||
float spot = max(dot(-ln, lv), is_pointlight);
|
||||
da *= spot*spot; // GL_SPOT_EXPONENT=2
|
||||
|
||||
//angular attenuation
|
||||
da *= calcDirectionalLight(n, lv);
|
||||
//angular attenuation
|
||||
da *= calcDirectionalLight(n, lv);
|
||||
}
|
||||
|
||||
return da;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
/**
|
||||
* @file avatarShadowF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
varying vec4 post_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
//gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy).a);
|
||||
gl_FragColor = vec4(1,1,1,1);
|
||||
|
||||
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
/**
|
||||
* @file avatarShadowV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
mat4 getSkinnedTransform();
|
||||
|
||||
attribute vec4 weight;
|
||||
|
||||
varying vec4 post_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
@@ -30,8 +32,9 @@ void main()
|
||||
norm = normalize(norm);
|
||||
|
||||
pos = gl_ProjectionMatrix * pos;
|
||||
pos.z = max(pos.z, -pos.w+0.01);
|
||||
gl_Position = pos;
|
||||
post_pos = pos;
|
||||
|
||||
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
mat4 getSkinnedTransform();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file blurLightF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
@@ -26,7 +26,7 @@ uniform vec2 screen_res;
|
||||
|
||||
vec4 getPosition(vec2 pos_screen)
|
||||
{
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).r;
|
||||
vec2 sc = pos_screen.xy*2.0;
|
||||
sc /= screen_res;
|
||||
sc -= vec2(1.0,1.0);
|
||||
@@ -39,7 +39,7 @@ vec4 getPosition(vec2 pos_screen)
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 tc = vary_fragcoord.xy;
|
||||
vec2 tc = vary_fragcoord.xy;
|
||||
vec3 norm = texture2DRect(normalMap, tc).xyz;
|
||||
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
|
||||
vec3 pos = getPosition(tc).xyz;
|
||||
@@ -55,8 +55,7 @@ void main()
|
||||
float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005;
|
||||
|
||||
// perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large
|
||||
//This causes some pretty nasty artifacting, so disabling for now.
|
||||
//tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 );
|
||||
tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 );
|
||||
|
||||
for (int i = 1; i < 4; i++)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec2 vary_fragcoord;
|
||||
uniform vec2 screen_res;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform sampler2D bumpMap;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* @file bumpV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
varying vec3 vary_mat0;
|
||||
varying vec3 vary_mat1;
|
||||
varying vec3 vary_mat2;
|
||||
|
||||
mat4 getObjectSkinnedTransform();
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
mat4 mat = getObjectSkinnedTransform();
|
||||
|
||||
mat = gl_ModelViewMatrix * mat;
|
||||
|
||||
vec3 pos = (mat*gl_Vertex).xyz;
|
||||
|
||||
|
||||
vec3 n = normalize((mat * vec4(gl_Normal.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz);
|
||||
vec3 b = normalize((mat * vec4(gl_MultiTexCoord2.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz);
|
||||
vec3 t = cross(b, n);
|
||||
|
||||
vary_mat0 = vec3(t.x, b.x, n.x);
|
||||
vary_mat1 = vec3(t.y, b.y, n.y);
|
||||
vary_mat2 = vec3(t.z, b.z, n.z);
|
||||
|
||||
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec3 vary_mat0;
|
||||
varying vec3 vary_mat1;
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* @file WLCloudsF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// The fragment shader for the sky
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
varying vec4 vary_CloudColorSun;
|
||||
varying vec4 vary_CloudColorAmbient;
|
||||
varying float vary_CloudDensity;
|
||||
|
||||
uniform sampler2D cloud_noise_texture;
|
||||
uniform vec4 cloud_pos_density1;
|
||||
uniform vec4 cloud_pos_density2;
|
||||
uniform vec4 gamma;
|
||||
|
||||
/// Soft clips the light with a gamma correction
|
||||
vec3 scaleSoftClip(vec3 light) {
|
||||
//soft clip effect:
|
||||
light = 1. - clamp(light, vec3(0.), vec3(1.));
|
||||
light = 1. - pow(light, gamma.xxx);
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// Set variables
|
||||
vec2 uv1 = gl_TexCoord[0].xy;
|
||||
vec2 uv2 = gl_TexCoord[1].xy;
|
||||
|
||||
vec4 cloudColorSun = vary_CloudColorSun;
|
||||
vec4 cloudColorAmbient = vary_CloudColorAmbient;
|
||||
float cloudDensity = vary_CloudDensity;
|
||||
vec2 uv3 = gl_TexCoord[2].xy;
|
||||
vec2 uv4 = gl_TexCoord[3].xy;
|
||||
|
||||
// Offset texture coords
|
||||
uv1 += cloud_pos_density1.xy; //large texture, visible density
|
||||
uv2 += cloud_pos_density1.xy; //large texture, self shadow
|
||||
uv3 += cloud_pos_density2.xy; //small texture, visible density
|
||||
uv4 += cloud_pos_density2.xy; //small texture, self shadow
|
||||
|
||||
|
||||
// Compute alpha1, the main cloud opacity
|
||||
float alpha1 = (texture2D(cloud_noise_texture, uv1).x - 0.5) + (texture2D(cloud_noise_texture, uv3).x - 0.5) * cloud_pos_density2.z;
|
||||
alpha1 = min(max(alpha1 + cloudDensity, 0.) * 10. * cloud_pos_density1.z, 1.);
|
||||
|
||||
// And smooth
|
||||
alpha1 = 1. - alpha1 * alpha1;
|
||||
alpha1 = 1. - alpha1 * alpha1;
|
||||
|
||||
|
||||
// Compute alpha2, for self shadowing effect
|
||||
// (1 - alpha2) will later be used as percentage of incoming sunlight
|
||||
float alpha2 = (texture2D(cloud_noise_texture, uv2).x - 0.5);
|
||||
alpha2 = min(max(alpha2 + cloudDensity, 0.) * 2.5 * cloud_pos_density1.z, 1.);
|
||||
|
||||
// And smooth
|
||||
alpha2 = 1. - alpha2;
|
||||
alpha2 = 1. - alpha2 * alpha2;
|
||||
|
||||
// Combine
|
||||
vec4 color;
|
||||
color = (cloudColorSun*(1.-alpha2) + cloudColorAmbient);
|
||||
color *= 2.;
|
||||
|
||||
/// Gamma correct for WL (soft clip effect).
|
||||
gl_FragData[0] = vec4(scaleSoftClip(color.rgb), alpha1);
|
||||
gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
gl_FragData[2] = vec4(0,0,1,0);
|
||||
}
|
||||
|
||||
165
indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
Normal file
165
indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
Normal file
@@ -0,0 +1,165 @@
|
||||
/**
|
||||
* @file WLCloudsV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// The vertex shader for creating the atmospheric sky
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Output parameters
|
||||
varying vec4 vary_CloudColorSun;
|
||||
varying vec4 vary_CloudColorAmbient;
|
||||
varying float vary_CloudDensity;
|
||||
|
||||
// Inputs
|
||||
uniform vec3 camPosLocal;
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
uniform vec4 cloud_scale;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
// World / view / projection
|
||||
gl_Position = ftransform();
|
||||
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
// Get relative position
|
||||
vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
|
||||
|
||||
// Set altitude
|
||||
if (P.y > 0.)
|
||||
{
|
||||
P *= (max_y.x / P.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
P *= (-32000. / P.y);
|
||||
}
|
||||
|
||||
// Can normalize then
|
||||
vec3 Pn = normalize(P);
|
||||
float Plen = length(P);
|
||||
|
||||
// Initialize temp variables
|
||||
vec4 temp1 = vec4(0.);
|
||||
vec4 temp2 = vec4(0.);
|
||||
vec4 blue_weight;
|
||||
vec4 haze_weight;
|
||||
vec4 sunlight = sunlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
|
||||
|
||||
// Calculate relative weights
|
||||
temp1 = blue_density + haze_density.x;
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = haze_density.x / temp1;
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
|
||||
temp2.y = 1. / temp2.y;
|
||||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Distance
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z);
|
||||
|
||||
|
||||
// Compute haze glow
|
||||
temp2.x = dot(Pn, lightnorm.xyz);
|
||||
temp2.x = 1. - temp2.x;
|
||||
// temp2.x is 0 at the sun and increases away from sun
|
||||
temp2.x = max(temp2.x, .001);
|
||||
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
temp2.x *= glow.x;
|
||||
// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
temp2.x = pow(temp2.x, glow.z);
|
||||
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
// Add "minimum anti-solar illumination"
|
||||
temp2.x += .25;
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow.x);
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
);
|
||||
|
||||
// CLOUDS
|
||||
|
||||
sunlight = sunlight_color;
|
||||
temp2.y = max(0., lightnorm.y * 2.);
|
||||
temp2.y = 1. / temp2.y;
|
||||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Cloud color out
|
||||
vary_CloudColorSun = (sunlight * temp2.x) * cloud_color;
|
||||
vary_CloudColorAmbient = tmpAmbient * cloud_color;
|
||||
|
||||
// Attenuate cloud color by atmosphere
|
||||
temp1 = sqrt(temp1); //less atmos opacity (more transparency) below clouds
|
||||
vary_CloudColorSun *= temp1;
|
||||
vary_CloudColorAmbient *= temp1;
|
||||
vec4 oHazeColorBelowCloud = additiveColorBelowCloud * (1. - temp1);
|
||||
|
||||
// Make a nice cloud density based on the cloud_shadow value that was passed in.
|
||||
vary_CloudDensity = 2. * (cloud_shadow.x - 0.25);
|
||||
|
||||
|
||||
// Texture coords
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0].xy -= 0.5;
|
||||
gl_TexCoord[0].xy /= cloud_scale.x;
|
||||
gl_TexCoord[0].xy += 0.5;
|
||||
|
||||
gl_TexCoord[1] = gl_TexCoord[0];
|
||||
gl_TexCoord[1].x += lightnorm.x * 0.0125;
|
||||
gl_TexCoord[1].y += lightnorm.z * 0.0125;
|
||||
|
||||
gl_TexCoord[2] = gl_TexCoord[0] * 16.;
|
||||
gl_TexCoord[3] = gl_TexCoord[1] * 16.;
|
||||
|
||||
// Combine these to minimize register use
|
||||
vary_CloudColorAmbient += oHazeColorBelowCloud;
|
||||
|
||||
// needs this to compile on mac
|
||||
//vary_AtmosAttenuation = vec3(0.0,0.0,0.0);
|
||||
|
||||
// END CLOUDS
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* @file diffuseF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
uniform float minimum_alpha;
|
||||
uniform float maximum_alpha;
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
varying vec3 vary_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color;
|
||||
|
||||
if (col.a < minimum_alpha || col.a > maximum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragData[0] = vec4(col.rgb, 0.0);
|
||||
gl_FragData[1] = vec4(0,0,0,0); // spec
|
||||
vec3 nvn = normalize(vary_normal);
|
||||
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @file diffuseAlphaMaskIndexedF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
varying vec3 vary_normal;
|
||||
|
||||
uniform float minimum_alpha;
|
||||
uniform float maximum_alpha;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 col = diffuseLookup(gl_TexCoord[0].xy) * gl_Color;
|
||||
|
||||
if (col.a < minimum_alpha || col.a > maximum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragData[0] = vec4(col.rgb, 0.0);
|
||||
gl_FragData[1] = vec4(0,0,0,0);
|
||||
vec3 nvn = normalize(vary_normal);
|
||||
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @file diffuseIndexedF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
varying vec3 vary_normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 col = gl_Color.rgb * diffuseLookup(gl_TexCoord[0].xy).rgb;
|
||||
|
||||
gl_FragData[0] = vec4(col, 0.0);
|
||||
gl_FragData[1] = gl_Color.aaaa; // spec
|
||||
//gl_FragData[1] = vec4(vec3(gl_Color.a), gl_Color.a+(1.0-gl_Color.a)*gl_Color.a); // spec - from former class3 - maybe better, but not so well tested
|
||||
vec3 nvn = normalize(vary_normal);
|
||||
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @file diffuseSkinnedV.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
varying vec3 vary_normal;
|
||||
|
||||
mat4 getObjectSkinnedTransform();
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
mat4 mat = getObjectSkinnedTransform();
|
||||
|
||||
mat = gl_ModelViewMatrix * mat;
|
||||
vec3 pos = (mat*gl_Vertex).xyz;
|
||||
|
||||
vec4 norm = gl_Vertex;
|
||||
norm.xyz += gl_Normal.xyz;
|
||||
norm.xyz = (mat*norm).xyz;
|
||||
norm.xyz = normalize(norm.xyz-pos.xyz);
|
||||
|
||||
vary_normal = norm.xyz;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
|
||||
}
|
||||
@@ -5,16 +5,18 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec3 vary_normal;
|
||||
varying float vary_texture_index;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.xyz, 1.0);
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
vary_texture_index = gl_Vertex.w;
|
||||
vary_normal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
@@ -5,60 +5,24 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform sampler2DRect depthMap;
|
||||
uniform sampler2D noiseMap;
|
||||
|
||||
uniform vec4 shadow_clip;
|
||||
uniform vec2 screen_res;
|
||||
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
|
||||
varying vec3 vary_ambient;
|
||||
varying vec3 vary_directional;
|
||||
varying vec4 vary_position;
|
||||
varying vec3 vary_normal;
|
||||
varying vec3 vary_fragcoord;
|
||||
|
||||
uniform mat4 inv_proj;
|
||||
|
||||
vec4 getPosition(vec2 pos_screen)
|
||||
{
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
vec2 sc = pos_screen.xy*2.0;
|
||||
sc /= screen_res;
|
||||
sc -= vec2(1.0,1.0);
|
||||
vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0);
|
||||
vec4 pos = inv_proj * ndc;
|
||||
pos /= pos.w;
|
||||
pos.w = 1.0;
|
||||
return pos;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
|
||||
frag *= screen_res;
|
||||
|
||||
vec3 samp_pos = getPosition(frag).xyz;
|
||||
|
||||
float shadow = 1.0;
|
||||
vec4 pos = vary_position;
|
||||
|
||||
vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy)*gl_Color;
|
||||
vec4 color = diffuseLookup(gl_TexCoord[0].xy)*gl_Color;
|
||||
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
|
||||
//gl_FragColor = gl_Color;
|
||||
gl_FragColor = color;
|
||||
//gl_FragColor = vec4(1,0,1,1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
@@ -14,30 +14,23 @@ vec3 atmosAffectDirectionalLight(float lightIntensity);
|
||||
vec3 scaleDownLight(vec3 light);
|
||||
vec3 scaleUpLight(vec3 light);
|
||||
|
||||
varying vec3 vary_ambient;
|
||||
varying vec3 vary_directional;
|
||||
varying vec3 vary_normal;
|
||||
varying vec3 vary_fragcoord;
|
||||
uniform float near_clip;
|
||||
varying vec4 vary_position;
|
||||
varying float vary_texture_index;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = ftransform();
|
||||
vec4 vert = vec4(gl_Vertex.xyz, 1.0);
|
||||
vary_texture_index = gl_Vertex.w;
|
||||
|
||||
gl_Position = gl_ModelViewProjectionMatrix*vert;
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
|
||||
vary_position = pos;
|
||||
|
||||
vec4 pos = (gl_ModelViewMatrix * vert);
|
||||
|
||||
calcAtmospherics(pos.xyz);
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
gl_FogFragCoord = pos.z;
|
||||
|
||||
pos = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec2 vary_fragcoord;
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
uniform float minimum_alpha;
|
||||
uniform float maximum_alpha;
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform sampler2D normalMap;
|
||||
@@ -14,6 +15,10 @@ uniform sampler2D specularMap;
|
||||
void main()
|
||||
{
|
||||
vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
|
||||
if (col.a < minimum_alpha || col.a > maximum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
|
||||
gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy);
|
||||
gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2DRect diffuseMap;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
|
||||
varying vec2 vary_fragcoord;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file multiPointLightF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
@@ -23,8 +23,9 @@ uniform float sun_wash;
|
||||
|
||||
uniform int light_count;
|
||||
|
||||
uniform vec4 light[16];
|
||||
uniform vec4 light_col[16];
|
||||
#define MAX_LIGHT_COUNT 16
|
||||
uniform vec4 light[MAX_LIGHT_COUNT];
|
||||
uniform vec4 light_col[MAX_LIGHT_COUNT];
|
||||
|
||||
varying vec4 vary_fragcoord;
|
||||
uniform vec2 screen_res;
|
||||
@@ -35,7 +36,7 @@ uniform mat4 inv_proj;
|
||||
|
||||
vec4 getPosition(vec2 pos_screen)
|
||||
{
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).r;
|
||||
vec2 sc = pos_screen.xy*2.0;
|
||||
sc /= screen_res;
|
||||
sc -= vec2(1.0,1.0);
|
||||
@@ -63,50 +64,56 @@ void main()
|
||||
float noise = texture2D(noiseMap, frag.xy/128.0).b;
|
||||
vec3 out_col = vec3(0,0,0);
|
||||
vec3 npos = normalize(-pos);
|
||||
|
||||
for (int i = 0; i < light_count; ++i)
|
||||
|
||||
// As of OSX 10.6.7 ATI Apple's crash when using a variable size loop
|
||||
for (int i = 0; i < MAX_LIGHT_COUNT; ++i)
|
||||
{
|
||||
bool light_contrib = (i < light_count);
|
||||
|
||||
vec3 lv = light[i].xyz-pos;
|
||||
float dist2 = dot(lv,lv);
|
||||
dist2 /= light[i].w;
|
||||
if (dist2 > 1.0)
|
||||
{
|
||||
continue;
|
||||
light_contrib = false;
|
||||
}
|
||||
|
||||
float da = dot(norm, lv);
|
||||
if (da < 0.0)
|
||||
{
|
||||
continue;
|
||||
light_contrib = false;
|
||||
}
|
||||
|
||||
lv = normalize(lv);
|
||||
da = dot(norm, lv);
|
||||
|
||||
float fa = light_col[i].a+1.0;
|
||||
float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
dist_atten *= noise;
|
||||
|
||||
float lit = da * dist_atten;
|
||||
|
||||
vec3 col = light_col[i].rgb*lit*diff;
|
||||
//vec3 col = vec3(dist2, light_col[i].a, lit);
|
||||
|
||||
if (spec.a > 0.0)
|
||||
if (light_contrib)
|
||||
{
|
||||
//vec3 ref = dot(pos+lv, norm);
|
||||
lv = normalize(lv);
|
||||
da = dot(norm, lv);
|
||||
|
||||
float fa = light_col[i].a+1.0;
|
||||
float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0);
|
||||
dist_atten *= noise;
|
||||
|
||||
float lit = da * dist_atten;
|
||||
|
||||
float sa = dot(normalize(lv+npos),norm);
|
||||
vec3 col = light_col[i].rgb*lit*diff;
|
||||
//vec3 col = vec3(dist2, light_col[i].a, lit);
|
||||
|
||||
if (sa > 0.0)
|
||||
if (spec.a > 0.0)
|
||||
{
|
||||
sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
|
||||
sa *= noise;
|
||||
col += da*sa*light_col[i].rgb*spec.rgb;
|
||||
//vec3 ref = dot(pos+lv, norm);
|
||||
|
||||
float sa = dot(normalize(lv+npos),norm);
|
||||
|
||||
if (sa > 0.0)
|
||||
{
|
||||
sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0);
|
||||
sa *= noise;
|
||||
col += da*sa*light_col[i].rgb*spec.rgb;
|
||||
}
|
||||
}
|
||||
|
||||
out_col += col;
|
||||
}
|
||||
|
||||
out_col += col;
|
||||
}
|
||||
|
||||
if (dot(out_col, out_col) <= 0.0)
|
||||
@@ -116,4 +123,6 @@ void main()
|
||||
|
||||
gl_FragColor.rgb = out_col;
|
||||
gl_FragColor.a = 0.0;
|
||||
|
||||
//gl_FragColor = vec4(0.1, 0.025, 0.025/4.0, 0.0);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec4 vary_fragcoord;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
//class 1 -- no shadows
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
@@ -30,7 +30,7 @@ uniform vec4 viewport;
|
||||
|
||||
vec4 getPosition(vec2 pos_screen)
|
||||
{
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).r;
|
||||
vec2 sc = (pos_screen.xy-viewport.xy)*2.0;
|
||||
sc /= viewport.zw;
|
||||
sc -= vec2(1.0,1.0);
|
||||
|
||||
@@ -5,19 +5,14 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec4 vary_light;
|
||||
varying vec4 vary_fragcoord;
|
||||
|
||||
uniform vec2 screen_res;
|
||||
uniform float near_clip;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
vary_fragcoord = pos;
|
||||
|
||||
@@ -25,6 +20,8 @@ void main()
|
||||
tex.w = 1.0;
|
||||
|
||||
vary_light = gl_MultiTexCoord0;
|
||||
|
||||
gl_Position = pos;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
@@ -29,7 +29,7 @@ varying vec2 vary_fragcoord;
|
||||
|
||||
float getDepth(vec2 pos_screen)
|
||||
{
|
||||
float z = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
float z = texture2DRect(depthMap, pos_screen.xy).r;
|
||||
z = z*2.0-1.0;
|
||||
vec4 ndc = vec4(0.0, 0.0, z, 1.0);
|
||||
vec4 p = inv_proj*ndc;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec2 vary_fragcoord;
|
||||
uniform vec2 screen_res;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2DRect depthMap;
|
||||
uniform sampler2DRect normalMap;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec2 vary_fragcoord;
|
||||
uniform vec2 screen_res;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @file shadowAlphaMaskF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform float minimum_alpha;
|
||||
uniform float maximum_alpha;
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
varying vec4 post_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
float alpha = texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a;
|
||||
|
||||
if (alpha < minimum_alpha || alpha > maximum_alpha)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(1,1,1,1);
|
||||
|
||||
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @file shadowAlphaMaskV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
varying vec4 post_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex;
|
||||
|
||||
post_pos = pos;
|
||||
|
||||
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -5,15 +5,13 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
varying vec4 post_pos;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(1,1,1,texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a);
|
||||
gl_FragColor = vec4(1,1,1,1);
|
||||
|
||||
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec4 post_pos;
|
||||
|
||||
@@ -17,7 +17,4 @@ void main()
|
||||
post_pos = pos;
|
||||
|
||||
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
44
indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
Normal file
44
indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @file WLSkyF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// The fragment shader for the sky
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
varying vec4 vary_HazeColor;
|
||||
|
||||
uniform sampler2D cloud_noise_texture;
|
||||
uniform vec4 gamma;
|
||||
|
||||
/// Soft clips the light with a gamma correction
|
||||
vec3 scaleSoftClip(vec3 light) {
|
||||
//soft clip effect:
|
||||
light = 1. - clamp(light, vec3(0.), vec3(1.));
|
||||
light = 1. - pow(light, gamma.xxx);
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// Potential Fill-rate optimization. Add cloud calculation
|
||||
// back in and output alpha of 0 (so that alpha culling kills
|
||||
// the fragment) if the sky wouldn't show up because the clouds
|
||||
// are fully opaque.
|
||||
|
||||
vec4 color;
|
||||
color = vary_HazeColor;
|
||||
color *= 2.;
|
||||
|
||||
/// Gamma correct for WL (soft clip effect).
|
||||
gl_FragData[0] = vec4(scaleSoftClip(color.rgb), 1.0);
|
||||
gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
|
||||
gl_FragData[2] = vec4(0,0,1,0);
|
||||
}
|
||||
|
||||
140
indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
Normal file
140
indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
Normal file
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
* @file WLSkyV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// SKY ////////////////////////////////////////////////////////////////////////
|
||||
// The vertex shader for creating the atmospheric sky
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Output parameters
|
||||
varying vec4 vary_HazeColor;
|
||||
|
||||
// Inputs
|
||||
uniform vec3 camPosLocal;
|
||||
|
||||
uniform vec4 lightnorm;
|
||||
uniform vec4 sunlight_color;
|
||||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
uniform vec4 cloud_scale;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
// World / view / projection
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
// Get relative position
|
||||
vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
|
||||
//vec3 P = gl_Vertex.xyz + vec3(0,50,0);
|
||||
|
||||
// Set altitude
|
||||
if (P.y > 0.)
|
||||
{
|
||||
P *= (max_y.x / P.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
P *= (-32000. / P.y);
|
||||
}
|
||||
|
||||
// Can normalize then
|
||||
vec3 Pn = normalize(P);
|
||||
float Plen = length(P);
|
||||
|
||||
// Initialize temp variables
|
||||
vec4 temp1 = vec4(0.);
|
||||
vec4 temp2 = vec4(0.);
|
||||
vec4 blue_weight;
|
||||
vec4 haze_weight;
|
||||
vec4 sunlight = sunlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
|
||||
|
||||
// Calculate relative weights
|
||||
temp1 = blue_density + haze_density.x;
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = haze_density.x / temp1;
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
|
||||
temp2.y = 1. / temp2.y;
|
||||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Distance
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z);
|
||||
|
||||
|
||||
// Compute haze glow
|
||||
temp2.x = dot(Pn, lightnorm.xyz);
|
||||
temp2.x = 1. - temp2.x;
|
||||
// temp2.x is 0 at the sun and increases away from sun
|
||||
temp2.x = max(temp2.x, .001);
|
||||
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
|
||||
temp2.x *= glow.x;
|
||||
// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
|
||||
temp2.x = pow(temp2.x, glow.z);
|
||||
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
|
||||
|
||||
// Add "minimum anti-solar illumination"
|
||||
temp2.x += .25;
|
||||
|
||||
|
||||
// Haze color above cloud
|
||||
vary_HazeColor = ( blue_horizon * blue_weight * (sunlight + ambient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + ambient)
|
||||
);
|
||||
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow.x);
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
);
|
||||
|
||||
// Final atmosphere additive
|
||||
vary_HazeColor *= (1. - temp1);
|
||||
|
||||
// Attenuate cloud color by atmosphere
|
||||
temp1 = sqrt(temp1); //less atmos opacity (more transparency) below clouds
|
||||
|
||||
// At horizon, blend high altitude sky color towards the darker color below the clouds
|
||||
vary_HazeColor += (additiveColorBelowCloud - vary_HazeColor) * (1. - sqrt(temp1));
|
||||
|
||||
// won't compile on mac without this being set
|
||||
//vary_AtmosAttenuation = vec3(0.0,0.0,0.0);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
/**
|
||||
* @file softenLightF.glsl
|
||||
*
|
||||
* Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
|
||||
* $License$
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
uniform sampler2DRect diffuseRect;
|
||||
uniform sampler2DRect specularRect;
|
||||
uniform sampler2DRect positionMap;
|
||||
uniform sampler2DRect normalMap;
|
||||
uniform sampler2DRect lightMap;
|
||||
uniform sampler2DRect depthMap;
|
||||
uniform sampler2D noiseMap;
|
||||
uniform samplerCube environmentMap;
|
||||
uniform sampler2D lightFunc;
|
||||
|
||||
uniform float blur_size;
|
||||
@@ -256,7 +259,7 @@ vec3 scaleSoftClip(vec3 light)
|
||||
void main()
|
||||
{
|
||||
vec2 tc = vary_fragcoord.xy;
|
||||
float depth = texture2DRect(depthMap, tc.xy).a;
|
||||
float depth = texture2DRect(depthMap, tc.xy).r;
|
||||
vec3 pos = getPosition_d(tc, depth).xyz;
|
||||
vec3 norm = texture2DRect(normalMap, tc).xyz;
|
||||
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
|
||||
@@ -267,74 +270,41 @@ void main()
|
||||
vec4 diffuse = texture2DRect(diffuseRect, tc);
|
||||
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
|
||||
|
||||
vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
|
||||
float scol = max(scol_ambocc.r, diffuse.a);
|
||||
float ambocc = scol_ambocc.g;
|
||||
|
||||
calcAtmospherics(pos.xyz, ambocc);
|
||||
|
||||
vec3 col = atmosAmbient(vec3(0));
|
||||
col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
|
||||
col *= diffuse.rgb;
|
||||
|
||||
if (spec.a > 0.0) // specular reflection
|
||||
vec3 col;
|
||||
float bloom = 0.0;
|
||||
if (diffuse.a < 0.9)
|
||||
{
|
||||
// the old infinite-sky shiny reflection
|
||||
//
|
||||
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
|
||||
float sa = dot(refnormpersp, vary_light.xyz);
|
||||
vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
|
||||
/*
|
||||
// screen-space cheap fakey reflection map
|
||||
//
|
||||
vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz));
|
||||
depth -= 0.5; // unbias depth
|
||||
// first figure out where we'll make our 2D guess from
|
||||
vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
|
||||
// Offset the guess source a little according to a trivial
|
||||
// checkerboard dither function and spec.a.
|
||||
// This is meant to be similar to sampling a blurred version
|
||||
// of the diffuse map. LOD would be better in that regard.
|
||||
// The goal of the blur is to soften reflections in surfaces
|
||||
// with low shinyness, and also to disguise our lameness.
|
||||
float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
|
||||
float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5);
|
||||
ref2d += vec2(checkoffset, checkoffset);
|
||||
ref2d += tc.xy; // use as offset from destination
|
||||
// Get attributes from the 2D guess point.
|
||||
// We average two samples of diffuse (not of anything else) per
|
||||
// pixel to try to reduce aliasing some more.
|
||||
vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d + vec2(0.0, -checkoffset)).rgb +
|
||||
texture2DRect(diffuseRect, ref2d + vec2(-checkoffset, 0.0)).rgb);
|
||||
float refdepth = texture2DRect(depthMap, ref2d).a;
|
||||
vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
|
||||
vec3 refn = texture2DRect(normalMap, ref2d).rgb;
|
||||
refn = normalize(vec3((refn.xy-0.5)*2.0,refn.z)); // unpack norm
|
||||
// figure out how appropriate our guess actually was
|
||||
float refapprop = max(0.0, dot(-refnorm, normalize(pos - refpos)));
|
||||
// darken reflections from points which face away from the reflected ray - our guess was a back-face
|
||||
//refapprop *= step(dot(refnorm, refn), 0.0);
|
||||
refapprop = min(refapprop, max(0.0, -dot(refnorm, refn))); // more conservative variant
|
||||
// get appropriate light strength for guess-point.
|
||||
// reflect light direction to increase the illusion that
|
||||
// these are reflections.
|
||||
vec3 reflight = reflect(lightnorm.xyz, norm.xyz);
|
||||
float reflit = max(dot(refn, reflight.xyz), 0.0);
|
||||
// apply sun color to guess-point, dampen according to inappropriateness of guess
|
||||
float refmod = min(refapprop, reflit);
|
||||
vec3 refprod = vary_SunlitColor * refcol.rgb * refmod;
|
||||
vec3 ssshiny = (refprod * spec.a);
|
||||
ssshiny *= 0.3; // dampen it even more
|
||||
*/
|
||||
vec3 ssshiny = vec3(0,0,0);
|
||||
|
||||
// add the two types of shiny together
|
||||
col += (ssshiny + dumbshiny) * spec.rgb;
|
||||
}
|
||||
calcAtmospherics(pos.xyz, 1.0);
|
||||
|
||||
col = atmosLighting(col);
|
||||
col = scaleSoftClip(col);
|
||||
|
||||
col = atmosAmbient(vec3(0));
|
||||
col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a));
|
||||
|
||||
col *= diffuse.rgb;
|
||||
|
||||
if (spec.a > 0.0) // specular reflection
|
||||
{
|
||||
// the old infinite-sky shiny reflection
|
||||
//
|
||||
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
|
||||
float sa = dot(refnormpersp, vary_light.xyz);
|
||||
vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
|
||||
|
||||
// add the two types of shiny together
|
||||
vec3 spec_contrib = dumbshiny * spec.rgb;
|
||||
bloom = dot(spec_contrib, spec_contrib);
|
||||
col += spec_contrib;
|
||||
}
|
||||
|
||||
col = atmosLighting(col);
|
||||
col = scaleSoftClip(col);
|
||||
|
||||
col = mix(col.rgb, diffuse.rgb, diffuse.a);
|
||||
}
|
||||
else
|
||||
{
|
||||
col = diffuse.rgb;
|
||||
}
|
||||
|
||||
gl_FragColor.rgb = col;
|
||||
gl_FragColor.a = 0.0;
|
||||
gl_FragColor.a = bloom;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform vec2 screen_res;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @file starsF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 col = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
|
||||
|
||||
gl_FragData[0] = col;
|
||||
gl_FragData[1] = vec4(0,0,0,0);
|
||||
gl_FragData[2] = vec4(0,0,1,0);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @file starsV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
//transform vertex
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
//class 1, no shadow, no SSAO, should never be called
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
@@ -35,7 +35,7 @@ uniform float shadow_offset;
|
||||
|
||||
vec4 getPosition(vec2 pos_screen)
|
||||
{
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).a;
|
||||
float depth = texture2DRect(depthMap, pos_screen.xy).r;
|
||||
vec2 sc = pos_screen.xy*2.0;
|
||||
sc /= screen_res;
|
||||
sc -= vec2(1.0,1.0);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec4 vary_light;
|
||||
varying vec2 vary_fragcoord;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D detail_0;
|
||||
uniform sampler2D detail_1;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec3 vary_normal;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
varying vec3 vary_normal;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform float glowStrength;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform vec2 glowDelta;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D detail0;
|
||||
uniform sampler2D detail1;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
// this class1 shader is just a copy of terrainF
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform sampler2D bumpMap;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
vec3 scaleSoftClip(vec3 inColor);
|
||||
vec3 atmosTransport(vec3 inColor);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
vec4 applyWaterFog(vec4 color)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye);
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @file customalphaF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
uniform float custom_alpha;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
|
||||
color.a *= custom_alpha;
|
||||
gl_FragColor = color;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @file customalphaV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @file glowcombineF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#extension GL_ARB_texture_rectangle : enable
|
||||
|
||||
uniform sampler2D glowMap;
|
||||
uniform sampler2DRect screenMap;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) +
|
||||
texture2DRect(screenMap, gl_TexCoord[1].xy);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @file glowcombineV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* $License$
|
||||
*/
|
||||
|
||||
#version 120
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @file occlusionF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vec4(1,1,1,1);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @file uiV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @file twotextureaddF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform sampler2D tex0;
|
||||
|
||||
void main()
|
||||
{
|
||||
float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a;
|
||||
|
||||
gl_FragColor = vec4(gl_Color.rgb, alpha);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @file solidcolorV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @file twotextureaddF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform sampler2D tex0;
|
||||
uniform sampler2D tex1;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @file twotextureaddV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
}
|
||||
|
||||
13
indra/newview/app_settings/shaders/class1/interface/uiF.glsl
Normal file
13
indra/newview/app_settings/shaders/class1/interface/uiF.glsl
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @file uiF.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
|
||||
}
|
||||
16
indra/newview/app_settings/shaders/class1/interface/uiV.glsl
Normal file
16
indra/newview/app_settings/shaders/class1/interface/uiV.glsl
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @file uiV.glsl
|
||||
*
|
||||
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user