2014-02-10 01:10:30 +00:00
|
|
|
[vertex]
|
|
|
|
|
|
|
|
#ifdef USE_GLES_OVER_GL
|
|
|
|
#define mediump
|
|
|
|
#define highp
|
|
|
|
#else
|
|
|
|
precision mediump float;
|
|
|
|
precision mediump int;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
uniform highp mat4 projection_matrix;
|
|
|
|
uniform highp mat4 modelview_matrix;
|
|
|
|
uniform highp mat4 extra_matrix;
|
|
|
|
attribute highp vec3 vertex; // attrib:0
|
|
|
|
attribute vec4 color_attrib; // attrib:3
|
|
|
|
attribute highp vec2 uv_attrib; // attrib:4
|
|
|
|
|
|
|
|
varying vec2 uv_interp;
|
|
|
|
varying vec4 color_interp;
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#if defined(USE_TIME)
|
|
|
|
uniform float time;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef USE_LIGHTING
|
|
|
|
|
|
|
|
uniform highp mat4 light_matrix;
|
2015-03-09 05:34:56 +00:00
|
|
|
uniform highp mat4 light_local_matrix;
|
2015-02-18 22:39:44 +00:00
|
|
|
uniform vec2 light_pos;
|
|
|
|
varying vec4 light_uv_interp;
|
|
|
|
|
|
|
|
#if defined(NORMAL_USED)
|
|
|
|
varying vec4 local_rot;
|
|
|
|
uniform vec2 normal_flip;
|
|
|
|
#endif
|
2015-01-11 14:43:31 +00:00
|
|
|
|
2015-03-02 03:54:10 +00:00
|
|
|
#ifdef USE_SHADOWS
|
2015-03-26 01:56:35 +00:00
|
|
|
varying highp vec2 pos;
|
2015-03-02 03:54:10 +00:00
|
|
|
#endif
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ENABLE_VAR1_INTERP)
|
|
|
|
varying vec4 var1_interp;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ENABLE_VAR2_INTERP)
|
|
|
|
varying vec4 var2_interp;
|
|
|
|
#endif
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
//uniform bool snap_pixels;
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
VERTEX_SHADER_GLOBALS
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void main() {
|
|
|
|
|
|
|
|
color_interp = color_attrib;
|
|
|
|
uv_interp = uv_attrib;
|
2015-01-19 05:39:58 +00:00
|
|
|
highp vec4 outvec = vec4(vertex, 1.0);
|
2015-01-11 14:43:31 +00:00
|
|
|
{
|
2015-01-19 05:39:58 +00:00
|
|
|
vec2 src_vtx=outvec.xy;
|
2015-01-11 14:43:31 +00:00
|
|
|
VERTEX_SHADER_CODE
|
|
|
|
|
|
|
|
}
|
2015-01-20 23:25:19 +00:00
|
|
|
#if !defined(USE_WORLD_VEC)
|
2015-01-19 05:39:58 +00:00
|
|
|
outvec = extra_matrix * outvec;
|
|
|
|
outvec = modelview_matrix * outvec;
|
2015-01-20 23:25:19 +00:00
|
|
|
#endif
|
2015-01-19 05:39:58 +00:00
|
|
|
|
2015-03-02 03:54:10 +00:00
|
|
|
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
#ifdef USE_PIXEL_SNAP
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
outvec.xy=floor(outvec.xy+0.5);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2015-01-20 23:25:19 +00:00
|
|
|
gl_Position = projection_matrix * outvec;
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#ifdef USE_LIGHTING
|
|
|
|
|
2015-02-18 22:39:44 +00:00
|
|
|
light_uv_interp.xy = (light_matrix * outvec).xy;
|
2015-03-09 05:34:56 +00:00
|
|
|
light_uv_interp.zw =(light_local_matrix * outvec).xy;
|
2015-03-02 03:54:10 +00:00
|
|
|
#ifdef USE_SHADOWS
|
|
|
|
pos=outvec.xy;
|
|
|
|
#endif
|
2015-02-18 22:39:44 +00:00
|
|
|
|
|
|
|
#if defined(NORMAL_USED)
|
|
|
|
local_rot.xy=normalize( (modelview_matrix * ( extra_matrix * vec4(1.0,0.0,0.0,0.0) )).xy )*normal_flip.x;
|
|
|
|
local_rot.zw=normalize( (modelview_matrix * ( extra_matrix * vec4(0.0,1.0,0.0,0.0) )).xy )*normal_flip.y;
|
|
|
|
#endif
|
2015-01-11 14:43:31 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
#endif
|
2015-01-11 14:43:31 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[fragment]
|
|
|
|
|
|
|
|
#ifdef USE_GLES_OVER_GL
|
|
|
|
#define mediump
|
|
|
|
#define highp
|
|
|
|
#else
|
|
|
|
precision mediump float;
|
|
|
|
precision mediump int;
|
|
|
|
#endif
|
|
|
|
|
2016-10-03 19:33:42 +00:00
|
|
|
|
|
|
|
uniform sampler2D texture; // texunit:0
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
varying vec2 uv_interp;
|
|
|
|
varying vec4 color_interp;
|
|
|
|
|
|
|
|
#ifdef MOMO
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#if defined(ENABLE_SCREEN_UV)
|
|
|
|
|
|
|
|
uniform vec2 screen_uv_mult;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ENABLE_TEXSCREEN)
|
|
|
|
|
|
|
|
uniform vec2 texscreen_screen_mult;
|
2015-01-13 13:49:26 +00:00
|
|
|
uniform vec4 texscreen_screen_clamp;
|
2015-01-11 14:43:31 +00:00
|
|
|
uniform sampler2D texscreen_tex;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(ENABLE_VAR1_INTERP)
|
|
|
|
varying vec4 var1_interp;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(ENABLE_VAR2_INTERP)
|
|
|
|
varying vec4 var2_interp;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(USE_TIME)
|
|
|
|
uniform float time;
|
|
|
|
#endif
|
|
|
|
|
2015-02-18 22:39:44 +00:00
|
|
|
#ifdef USE_MODULATE
|
|
|
|
|
|
|
|
uniform vec4 modulate;
|
|
|
|
|
|
|
|
#endif
|
2015-01-11 14:43:31 +00:00
|
|
|
|
|
|
|
#ifdef USE_LIGHTING
|
|
|
|
|
|
|
|
uniform sampler2D light_texture;
|
2015-02-18 22:39:44 +00:00
|
|
|
uniform vec4 light_color;
|
2015-06-24 21:15:43 +00:00
|
|
|
uniform vec4 light_shadow_color;
|
2015-02-18 22:39:44 +00:00
|
|
|
uniform float light_height;
|
|
|
|
varying vec4 light_uv_interp;
|
2015-12-08 23:25:08 +00:00
|
|
|
uniform float light_outside_alpha;
|
2015-02-18 22:39:44 +00:00
|
|
|
|
|
|
|
#if defined(NORMAL_USED)
|
|
|
|
varying vec4 local_rot;
|
|
|
|
#endif
|
2015-01-11 14:43:31 +00:00
|
|
|
|
|
|
|
#ifdef USE_SHADOWS
|
|
|
|
|
2015-03-26 01:56:35 +00:00
|
|
|
uniform highp sampler2D shadow_texture;
|
2015-01-11 14:43:31 +00:00
|
|
|
uniform float shadow_attenuation;
|
|
|
|
|
2015-03-02 03:54:10 +00:00
|
|
|
uniform highp mat4 shadow_matrix;
|
2015-03-26 01:56:35 +00:00
|
|
|
varying highp vec2 pos;
|
2015-03-02 03:54:10 +00:00
|
|
|
uniform float shadowpixel_size;
|
|
|
|
|
|
|
|
#ifdef SHADOW_ESM
|
|
|
|
uniform float shadow_esm_multiplier;
|
|
|
|
#endif
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2015-01-12 13:19:09 +00:00
|
|
|
#if defined(USE_TEXPIXEL_SIZE)
|
|
|
|
uniform vec2 texpixel_size;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
FRAGMENT_SHADER_GLOBALS
|
|
|
|
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void main() {
|
|
|
|
|
|
|
|
vec4 color = color_interp;
|
2015-01-11 14:43:31 +00:00
|
|
|
#if defined(NORMAL_USED)
|
2015-03-09 05:34:56 +00:00
|
|
|
vec3 normal = vec3(0.0,0.0,1.0);
|
2015-01-11 14:43:31 +00:00
|
|
|
#endif
|
|
|
|
|
2015-03-21 03:43:33 +00:00
|
|
|
#ifdef USE_DISTANCE_FIELD
|
|
|
|
const float smoothing = 1.0/32.0;
|
|
|
|
float distance = texture2D(texture, uv_interp).a;
|
2016-01-02 18:57:19 +00:00
|
|
|
color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a;
|
2015-03-21 03:43:33 +00:00
|
|
|
#else
|
2014-02-10 01:10:30 +00:00
|
|
|
color *= texture2D( texture, uv_interp );
|
2015-03-21 03:43:33 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#if defined(ENABLE_SCREEN_UV)
|
|
|
|
vec2 screen_uv = gl_FragCoord.xy*screen_uv_mult;
|
|
|
|
#endif
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
{
|
2015-04-27 11:11:54 +00:00
|
|
|
#if defined(USE_NORMALMAP)
|
|
|
|
vec3 normal_map=vec3(0.0,0.0,1.0);
|
|
|
|
float normal_depth=1.0;
|
|
|
|
#endif
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
FRAGMENT_SHADER_CODE
|
2015-04-27 11:11:54 +00:00
|
|
|
|
|
|
|
#if defined(USE_NORMALMAP)
|
|
|
|
normal = mix(vec3(0.0,0.0,1.0), normal_map * vec3(2.0,-2.0,1.0) - vec3( 1.0, -1.0, 0.0 ), normal_depth );
|
|
|
|
#endif
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
#ifdef DEBUG_ENCODED_32
|
|
|
|
highp float enc32 = dot( color,highp vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) );
|
|
|
|
color = vec4(vec3(enc32),1.0);
|
|
|
|
#endif
|
2014-05-24 04:35:47 +00:00
|
|
|
|
2015-03-02 03:54:10 +00:00
|
|
|
#ifdef USE_MODULATE
|
|
|
|
|
|
|
|
color*=modulate;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
#ifdef USE_LIGHTING
|
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
vec2 light_vec = light_uv_interp.zw;; //for shadow and normal mapping
|
|
|
|
|
2015-02-18 22:39:44 +00:00
|
|
|
#if defined(NORMAL_USED)
|
|
|
|
normal.xy = mat2(local_rot.xy,local_rot.zw) * normal.xy;
|
|
|
|
#endif
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
float att=1.0;
|
|
|
|
|
2015-04-03 04:43:37 +00:00
|
|
|
vec2 light_uv = light_uv_interp.xy;
|
|
|
|
vec4 light = texture2D(light_texture,light_uv) * light_color;
|
2016-09-06 22:22:28 +00:00
|
|
|
#if defined(USE_OUTPUT_SHADOW_COLOR)
|
2015-04-03 04:43:37 +00:00
|
|
|
vec4 shadow_color=vec4(0.0,0.0,0.0,0.0);
|
|
|
|
#endif
|
2015-03-09 05:34:56 +00:00
|
|
|
|
2015-12-08 23:25:08 +00:00
|
|
|
if (any(lessThan(light_uv_interp.xy,vec2(0.0,0.0))) || any(greaterThanEqual(light_uv_interp.xy,vec2(1.0,1.0)))) {
|
|
|
|
color.a*=light_outside_alpha; //invisible
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
#if defined(USE_LIGHT_SHADER_CODE)
|
|
|
|
//light is written by the light shader
|
2015-12-08 23:25:08 +00:00
|
|
|
{
|
|
|
|
vec4 light_out=light*color;
|
2015-03-09 05:34:56 +00:00
|
|
|
LIGHT_SHADER_CODE
|
2015-12-08 23:25:08 +00:00
|
|
|
color=light_out;
|
|
|
|
}
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
#else
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
#if defined(NORMAL_USED)
|
2015-12-08 23:25:08 +00:00
|
|
|
vec3 light_normal = normalize(vec3(light_vec,-light_height));
|
|
|
|
light*=max(dot(-light_normal,normal),0.0);
|
2015-03-09 05:34:56 +00:00
|
|
|
#endif
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-12-08 23:25:08 +00:00
|
|
|
color*=light;
|
2015-03-09 05:34:56 +00:00
|
|
|
/*
|
|
|
|
#ifdef USE_NORMAL
|
|
|
|
color.xy=local_rot.xy;//normal.xy;
|
|
|
|
color.zw=vec2(0.0,1.0);
|
|
|
|
#endif
|
|
|
|
*/
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
//light shader code
|
|
|
|
#endif
|
2015-03-02 03:54:10 +00:00
|
|
|
|
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
#ifdef USE_SHADOWS
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
float angle_to_light = -atan(light_vec.x,light_vec.y);
|
|
|
|
float PI = 3.14159265358979323846264;
|
|
|
|
/*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays
|
|
|
|
float ang*/
|
|
|
|
|
|
|
|
float su,sz;
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
float abs_angle = abs(angle_to_light);
|
|
|
|
vec2 point;
|
|
|
|
float sh;
|
|
|
|
if (abs_angle<45.0*PI/180.0) {
|
|
|
|
point = light_vec;
|
|
|
|
sh=0.0+(1.0/8.0);
|
|
|
|
} else if (abs_angle>135.0*PI/180.0) {
|
|
|
|
point = -light_vec;
|
|
|
|
sh = 0.5+(1.0/8.0);
|
|
|
|
} else if (angle_to_light>0.0) {
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
point = vec2(light_vec.y,-light_vec.x);
|
|
|
|
sh = 0.25+(1.0/8.0);
|
|
|
|
} else {
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-09 05:34:56 +00:00
|
|
|
point = vec2(-light_vec.y,light_vec.x);
|
|
|
|
sh = 0.75+(1.0/8.0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-04-18 19:33:31 +00:00
|
|
|
highp vec4 s = shadow_matrix * vec4(point,0.0,1.0);
|
2015-03-09 05:34:56 +00:00
|
|
|
s.xyz/=s.w;
|
|
|
|
su=s.x*0.5+0.5;
|
|
|
|
sz=s.z*0.5+0.5;
|
|
|
|
|
2015-04-01 15:23:13 +00:00
|
|
|
highp float shadow_attenuation=0.0;
|
2015-03-02 03:54:10 +00:00
|
|
|
|
2015-03-31 17:58:52 +00:00
|
|
|
#ifdef USE_DEPTH_SHADOWS
|
|
|
|
|
2016-10-03 19:33:42 +00:00
|
|
|
#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).r)
|
2015-03-31 17:58:52 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
//#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),highp vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) )
|
|
|
|
#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) )
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-02 03:54:10 +00:00
|
|
|
#ifdef SHADOW_PCF5
|
|
|
|
|
2015-03-31 17:58:52 +00:00
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size*2.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size*2.0,sh))<sz?0.0:1.0;
|
2015-03-09 05:34:56 +00:00
|
|
|
shadow_attenuation/=5.0;
|
2015-03-02 03:54:10 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SHADOW_PCF13
|
|
|
|
|
2015-03-31 17:58:52 +00:00
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size*2.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size*3.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size*4.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size*5.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size*6.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size*2.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size*3.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size*4.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size*5.0,sh))<sz?0.0:1.0;
|
|
|
|
shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su-shadowpixel_size*6.0,sh))<sz?0.0:1.0;
|
2015-03-09 05:34:56 +00:00
|
|
|
shadow_attenuation/=13.0;
|
2015-03-02 03:54:10 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SHADOW_ESM
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2015-03-09 05:34:56 +00:00
|
|
|
float unnormalized = su/shadowpixel_size;
|
|
|
|
float fractional = fract(unnormalized);
|
|
|
|
unnormalized = floor(unnormalized);
|
2015-03-31 17:58:52 +00:00
|
|
|
float zc = SHADOW_DEPTH(shadow_texture,vec2((unnormalized-0.5)*shadowpixel_size,sh));
|
|
|
|
float zn = SHADOW_DEPTH(shadow_texture,vec2((unnormalized+0.5)*shadowpixel_size,sh));
|
2015-03-09 05:34:56 +00:00
|
|
|
float z = mix(zc,zn,fractional);
|
|
|
|
shadow_attenuation=clamp(exp(shadow_esm_multiplier* ( z - sz )),0.0,1.0);
|
2015-01-11 14:43:31 +00:00
|
|
|
}
|
2015-03-02 03:54:10 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(SHADOW_PCF5) && !defined(SHADOW_PCF13) && !defined(SHADOW_ESM)
|
|
|
|
|
2015-03-31 17:58:52 +00:00
|
|
|
shadow_attenuation = SHADOW_DEPTH(shadow_texture,vec2(su+shadowpixel_size,sh))<sz?0.0:1.0;
|
2015-03-02 03:54:10 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2016-09-06 22:22:28 +00:00
|
|
|
#if defined(USE_OUTPUT_SHADOW_COLOR)
|
2015-04-03 04:43:37 +00:00
|
|
|
color=mix(shadow_color,color,shadow_attenuation);
|
|
|
|
#else
|
2015-06-24 21:15:43 +00:00
|
|
|
//color*=shadow_attenuation;
|
|
|
|
color=mix(light_shadow_color,color,shadow_attenuation);
|
2015-04-03 04:43:37 +00:00
|
|
|
#endif
|
2015-01-11 14:43:31 +00:00
|
|
|
//use shadows
|
|
|
|
#endif
|
2015-02-18 22:39:44 +00:00
|
|
|
}
|
|
|
|
|
2015-01-11 14:43:31 +00:00
|
|
|
//use lighting
|
|
|
|
#endif
|
2014-05-24 04:35:47 +00:00
|
|
|
// color.rgb*=color.a;
|
2014-02-10 01:10:30 +00:00
|
|
|
gl_FragColor = color;
|
2014-05-24 04:35:47 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|