fix last stuff
This commit is contained in:
parent
9a83bb2975
commit
9cd8c22dce
10
Makefile
10
Makefile
|
@ -6,7 +6,7 @@
|
||||||
# By: gbrochar <gbrochar@student.42.fr> +#+ +:+ +#+ #
|
# By: gbrochar <gbrochar@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2020/12/17 19:47:03 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)
|
all: $(NAME)
|
||||||
|
|
||||||
$(NAME): $(OBJ) $(INC)
|
submodules:
|
||||||
|
@git submodule update --init
|
||||||
|
|
||||||
|
$(NAME): submodules $(OBJ) $(INC)
|
||||||
@make -C glew-2.2.0
|
@make -C glew-2.2.0
|
||||||
@make -C libft
|
@make -C libft
|
||||||
@$(CC) $(CFLAGS) -c $(SRC) -I $(INC_DIR) -I glew-2.2.0/include/
|
@$(CC) $(CFLAGS) -c $(SRC) -I $(INC_DIR) -I glew-2.2.0/include/
|
||||||
|
@ -84,8 +87,7 @@ fclean: clean
|
||||||
|
|
||||||
re: fclean all
|
re: fclean all
|
||||||
|
|
||||||
webgl:
|
webgl: submodules
|
||||||
@git submodule update --init
|
|
||||||
@make -C webgl
|
@make -C webgl
|
||||||
|
|
||||||
.PHONY: all clean fclean re webgl
|
.PHONY: all clean fclean re webgl
|
||||||
|
|
|
@ -22,7 +22,7 @@ float rand(float n)
|
||||||
|
|
||||||
void main()
|
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;
|
vec3 texture_color;
|
||||||
if (has_uvs > 0) {
|
if (has_uvs > 0) {
|
||||||
if (invert_texture > 0)
|
if (invert_texture > 0)
|
||||||
|
@ -40,7 +40,7 @@ void main()
|
||||||
}
|
}
|
||||||
vec3 color = triangle_color + texture_color;
|
vec3 color = triangle_color + texture_color;
|
||||||
if (has_normals > 0 && lighting == 1) {
|
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 ambient = 0.2;
|
||||||
float phong = max(0., dot(n, normalize(normal)));
|
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.);
|
float specular = pow(max(dot(reflect(n, normalize(normal)), normalize(vec3(0, 0, -2) - position)), 0.), 10.);
|
||||||
|
|
Loading…
Reference in New Issue