diff --git a/Makefile b/Makefile index 8d02c09..cf9bf15 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: gbrochar +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/12/17 19:47:03 by gbrochar #+# #+# # -# Updated: 2024/04/25 16:18:14 by gbrochar ### ########.fr # +# Updated: 2024/10/07 15:29:50 by gbrochar ### ########.fr # # # # **************************************************************************** # @@ -56,7 +56,10 @@ WHITE = \033[0m all: $(NAME) -$(NAME): $(OBJ) $(INC) +submodules: + @git submodule update --init + +$(NAME): submodules $(OBJ) $(INC) @make -C glew-2.2.0 @make -C libft @$(CC) $(CFLAGS) -c $(SRC) -I $(INC_DIR) -I glew-2.2.0/include/ @@ -84,8 +87,7 @@ fclean: clean re: fclean all -webgl: - @git submodule update --init +webgl: submodules @make -C webgl .PHONY: all clean fclean re webgl diff --git a/src/shader.fs b/src/shader.fs index af9552f..f5341bd 100644 --- a/src/shader.fs +++ b/src/shader.fs @@ -22,7 +22,7 @@ float rand(float n) void main() { - vec3 triangle_color = vec3(rand(float(vID + int(time))), rand(float(vID + int(time))), rand(float(vID + int(time)))) * (1 - texture_level); + vec3 triangle_color = vec3(rand(float(vID)), rand(float(vID)), rand(float(vID))) * (1 - texture_level); vec3 texture_color; if (has_uvs > 0) { if (invert_texture > 0) @@ -40,7 +40,7 @@ void main() } vec3 color = triangle_color + texture_color; if (has_normals > 0 && lighting == 1) { - vec3 n = normalize(vec3(5. * cos(time), 20., 5. * sin(time)) - position); + vec3 n = normalize(vec3(5. * cos(time), 10., 5. * sin(time)) - position); float ambient = 0.2; float phong = max(0., dot(n, normalize(normal))); float specular = pow(max(dot(reflect(n, normalize(normal)), normalize(vec3(0, 0, -2) - position)), 0.), 10.);