1
0
Fork 0

implement material roughness

This commit is contained in:
Sen 2025-08-29 11:22:33 +02:00
parent 1e79613f2b
commit 401f9dbe34
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
12 changed files with 73 additions and 60 deletions

View file

@ -12,12 +12,11 @@ in vec3 vertex;
in vec3 normal;
in vec2 tex_coord;
in vec4 light_color;
in float brightness;
in float shine;
uniform vec3 cam_pos;
uniform sampler2D tex;
uniform vec3 specular;
uniform float shine;
uniform float max_vert_dist;
uniform float max_cam_dist;
uniform float light_factor;

View file

@ -7,7 +7,7 @@ out vec3 vertex;
out vec3 normal;
out vec2 tex_coord;
out vec4 light_color;
out float brightness;
out float shine;
uniform mat4 model;
uniform mat4 view;
@ -21,7 +21,7 @@ void main() {
vec3 nvertex = vec3(model * vec4(pos, 1.0));
vertex = vec3(float(chunk_x) + pos.x, float(chunk_y) + pos.y, float(chunk_z) + pos.z);
normal = mat3(transpose(inverse(model))) * norm.rgb;
brightness = norm.a;
shine = norm.a * 32.0;
tex_coord = coord;
light_color = light;
gl_Position = projection * view * vec4(offset + nvertex, 1.0);