This repository has been archived on 2023-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
api8/shaders/manif.fs

16 lines
304 B
Forth
Raw Normal View History

2023-05-01 01:00:50 +02:00
#version 330
2023-05-08 12:16:29 +02:00
in vec4 pos_model;
in vec3 vec_normal;
2023-05-01 01:00:50 +02:00
out vec4 fragColor;
2023-05-08 10:38:45 +02:00
uniform vec4 couleur;
2023-05-08 12:16:29 +02:00
uniform vec4 lumpos;
2023-05-08 10:38:45 +02:00
2023-05-01 01:00:50 +02:00
void main() {
2023-05-08 12:16:29 +02:00
vec3 torche = normalize(pos_model.xyz - lumpos.xyz);
float intensite_eclairage = clamp(dot(vec_normal, -torche), 0, 1);
2023-05-08 10:38:45 +02:00
fragColor = intensite_eclairage * couleur;
2023-05-01 01:00:50 +02:00
}