Skip to content

Commit 92dc07e

Browse files
committed
Small GLSL fixes
1 parent 5d8de78 commit 92dc07e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/flitter/render/window/glsl/backface_lighting.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void main() {
7070
light_distance = length(L);
7171
if (light_radius > 0.0) {
7272
attenuation = clamp(1.0 - (light_radius / light_distance), 0.0, 1.0);
73-
light_distance = max(0.0, light_distance - light_radius*0.99);
73+
light_distance -= min(light_radius, light_distance*0.99);
7474
}
7575
L = normalize(L);
7676
} else if (light_type == ${Spot}) {

src/flitter/render/window/glsl/standard_lighting.vert

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ flat out vec4 fragment_properties;
2121
uniform mat4 pv_matrix;
2222

2323
void main() {
24-
world_position = (model_matrix * vec4(model_position, 1)).xyz;
25-
gl_Position = pv_matrix * vec4(world_position, 1);
24+
world_position = (model_matrix * vec4(model_position, 1.0)).xyz;
25+
gl_Position = pv_matrix * vec4(world_position, 1.0);
2626
world_normal = model_normal_matrix * model_normal;
2727
texture_uv = model_uv;
2828
fragment_albedo = material_albedo;

0 commit comments

Comments
 (0)