fix last stuff

This commit is contained in:
gbrochar 2024-10-07 15:46:21 +02:00
parent 9a83bb2975
commit 9cd8c22dce
2 changed files with 8 additions and 6 deletions

View File

@ -6,7 +6,7 @@
# By: gbrochar <gbrochar@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# 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

View File

@ -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.);