diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-04-19 07:48:05 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-04-19 07:48:05 -0700 |
commit | 6adc6d71a7147a7f53f266bb05cd0157e34f9f4b (patch) | |
tree | ad3b8886cd2c09cc1510db6a8c2e2e87ffafb441 /indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | |
parent | 8bccedd163f1eb25c631e8501bdd468c24e6bf40 (diff) | |
parent | f9ff68b5e3b016a53fe987e5b51442741ca88f15 (diff) |
Merge viewer-dev-materials
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index da47d60049..59950a88ef 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -25,6 +25,10 @@ #extension GL_ARB_texture_rectangle : enable +#define INDEXED 1 +#define NON_INDEXED 2 +#define NON_INDEXED_NO_COLOR 3 + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else @@ -35,9 +39,8 @@ uniform sampler2DShadow shadowMap0; uniform sampler2DShadow shadowMap1; uniform sampler2DShadow shadowMap2; uniform sampler2DShadow shadowMap3; -uniform sampler2DRect depthMap; -#ifndef INDEX_MODE +#if INDEX_MODE != INDEXED uniform sampler2D diffuseMap; #endif @@ -53,12 +56,9 @@ VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; VARYING vec3 vary_norm; -VARYING mat3 vary_rotation; -#ifdef INDEX_MODE_USE_COLOR +#if INDEX_MODE != NON_INDEXED_NO_COLOR VARYING vec4 vertex_color; #endif @@ -66,19 +66,11 @@ uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; uniform float shadow_bias; -uniform mat4 inv_proj; - uniform vec4 light_position[8]; uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; uniform vec3 light_diffuse[8]; -uniform sampler2D bumpMap; -uniform samplerCube environmentMap; -uniform mat3 env_mat; - -uniform vec4 specular_color; - vec3 calcDirectionalLight(vec3 n, vec3 l) { float a = pow(max(dot(n,l),0.0), 0.7); @@ -206,22 +198,19 @@ void main() } vec4 diff; -#ifdef INDEX_MODE +#if INDEX_MODE == INDEXED diff = diffuseLookup(vary_texcoord0.xy); #else diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif - -#ifdef INDEX_MODE_USE_COLOR - float vertex_color_alpha = vertex_color.a; -#else + diff.rgb = pow(diff.rgb, vec3(2.2)); +#if INDEX_MODE == NON_INDEXED_NO_COLOR float vertex_color_alpha = 1.0; +#else + float vertex_color_alpha = vertex_color.a; #endif - vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; - normal = vec3(dot(normal.xyz, vary_rotation[0]), - dot(normal.xyz, vary_rotation[1]), - dot(normal.xyz, vary_rotation[2])); + vec3 normal = vary_norm; vec3 l = light_position[0].xyz; vec3 dlight = calcDirectionalLight(normal, l); |