mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
parent
75e44badba
commit
60312915dc
3 changed files with 28 additions and 54 deletions
|
|
@ -1558,7 +1558,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
|
|||
float sign = light_ptr->negative ? -1 : 1;
|
||||
|
||||
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_SPECULAR, specular);
|
||||
Color color = light_ptr->color * sign * energy * M_PI;
|
||||
Color color = light_ptr->color * sign * energy * Math_PI;
|
||||
state.scene_shader.set_uniform(SceneShaderGLES2::LIGHT_COLOR, color);
|
||||
|
||||
//specific parameters
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@ uniform highp sampler2D light_directional_shadow; // texunit:-3
|
|||
uniform highp vec4 light_split_offsets;
|
||||
#endif
|
||||
|
||||
|
||||
uniform highp mat4 light_shadow_matrix;
|
||||
varying highp vec4 shadow_coord;
|
||||
|
||||
|
|
@ -155,7 +154,6 @@ varying highp vec4 shadow_coord4;
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(USE_VERTEX_LIGHTING) && defined(USE_LIGHTING)
|
||||
|
||||
varying highp vec3 diffuse_interp;
|
||||
|
|
@ -206,7 +204,6 @@ void light_compute(
|
|||
float NdotV = dot(N, V);
|
||||
float cNdotV = max(NdotV, 0.0);
|
||||
|
||||
|
||||
#if defined(DIFFUSE_OREN_NAYAR)
|
||||
vec3 diffuse_brdf_NL;
|
||||
#else
|
||||
|
|
@ -241,8 +238,6 @@ void light_compute(
|
|||
|
||||
diffuse_interp += light_color * diffuse_brdf_NL * attenuation;
|
||||
|
||||
|
||||
|
||||
if (roughness > 0.0) {
|
||||
|
||||
// D
|
||||
|
|
@ -262,9 +257,7 @@ void light_compute(
|
|||
|
||||
SRGB_APPROX(specular_brdf_NL)
|
||||
specular_interp += specular_brdf_NL * light_color * attenuation;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -364,7 +357,6 @@ void main() {
|
|||
mat4 modelview = camera_matrix * world_matrix;
|
||||
float roughness = 1.0;
|
||||
|
||||
|
||||
#define world_transform world_matrix
|
||||
|
||||
{
|
||||
|
|
@ -434,7 +426,6 @@ VERTEX_SHADER_CODE
|
|||
|
||||
#endif //depth
|
||||
|
||||
|
||||
//vertex lighting
|
||||
#if defined(USE_VERTEX_LIGHTING) && defined(USE_LIGHTING)
|
||||
//vertex shaded version of lighting (more limited)
|
||||
|
|
@ -616,7 +607,6 @@ uniform highp sampler2D light_directional_shadow; // texunit:-3
|
|||
uniform highp vec4 light_split_offsets;
|
||||
#endif
|
||||
|
||||
|
||||
varying highp vec4 shadow_coord;
|
||||
|
||||
#if defined(LIGHT_USE_PSSM2) || defined(LIGHT_USE_PSSM4)
|
||||
|
|
@ -684,7 +674,6 @@ varying highp float dp_clip;
|
|||
|
||||
#ifdef USE_LIGHTING
|
||||
|
||||
|
||||
// This returns the G_GGX function divided by 2 cos_theta_m, where in practice cos_theta_m is either N.L or N.V.
|
||||
// We're dividing this factor off because the overall term we'll end up looks like
|
||||
// (see, for example, the first unnumbered equation in B. Burley, "Physically Based Shading at Disney", SIGGRAPH 2012):
|
||||
|
|
@ -904,8 +893,6 @@ LIGHT_SHADER_CODE
|
|||
phong *= (shininess + 8.0) / (8.0 * 3.141592654);
|
||||
specular_brdf_NL = (phong) / max(4.0 * cNdotV * cNdotL, 0.75);
|
||||
|
||||
|
||||
|
||||
#elif defined(SPECULAR_TOON)
|
||||
|
||||
vec3 R = normalize(-reflect(L, N));
|
||||
|
|
@ -954,7 +941,6 @@ LIGHT_SHADER_CODE
|
|||
SRGB_APPROX(specular_brdf_NL)
|
||||
specular_light += specular_brdf_NL * light_color * specular_blob_intensity * attenuation;
|
||||
|
||||
|
||||
#if defined(LIGHT_USE_CLEARCOAT)
|
||||
if (clearcoat_gloss > 0.0) {
|
||||
#if !defined(SPECULAR_SCHLICK_GGX) && !defined(SPECULAR_BLINN)
|
||||
|
|
@ -976,9 +962,7 @@ LIGHT_SHADER_CODE
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif //defined(USE_LIGHT_SHADER_CODE)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -993,7 +977,6 @@ float sample_shadow(
|
|||
highp vec2 pos,
|
||||
highp float depth) {
|
||||
|
||||
|
||||
#ifdef SHADOW_MODE_PCF_13
|
||||
|
||||
float avg = SAMPLE_SHADOW_TEXEL(shadow, pos, depth);
|
||||
|
|
@ -1027,7 +1010,6 @@ float sample_shadow(
|
|||
|
||||
return SAMPLE_SHADOW_TEXEL(shadow, pos, depth);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1194,7 +1176,6 @@ FRAGMENT_SHADER_CODE
|
|||
float shadow = sample_shadow(light_shadow_atlas, splane.xy, splane.z);
|
||||
|
||||
light_att *= shadow;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1318,12 +1299,10 @@ FRAGMENT_SHADER_CODE
|
|||
}
|
||||
#endif //use shadow
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef LIGHT_MODE_SPOT
|
||||
|
||||
|
||||
light_att = vec3(1.0);
|
||||
|
||||
#ifndef USE_VERTEX_LIGHTING
|
||||
|
|
@ -1358,8 +1337,6 @@ FRAGMENT_SHADER_CODE
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_VERTEX_LIGHTING
|
||||
|
|
@ -1435,7 +1412,5 @@ FRAGMENT_SHADER_CODE
|
|||
|
||||
#endif //unshaded
|
||||
|
||||
|
||||
#endif // not RENDER_DEPTH
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1047,7 +1047,6 @@ LIGHT_SHADER_CODE
|
|||
|
||||
specular_light += light_color * intensity * specular_blob_intensity * attenuation;
|
||||
|
||||
|
||||
#elif defined(SPECULAR_TOON)
|
||||
|
||||
vec3 R = normalize(-reflect(L, N));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue