Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet INF443 Maé
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Noé ARTRU
Projet INF443 Maé
Commits
29d1d011
Commit
29d1d011
authored
1 year ago
by
Noé
Browse files
Options
Downloads
Patches
Plain Diff
Neige better
parent
bb69921d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projet-code/scenes_inf443/base/shaders/mesh_multi_texture/mesh_multi_texture.frag.glsl
+1
-1
1 addition, 1 deletion
...e/shaders/mesh_multi_texture/mesh_multi_texture.frag.glsl
projet-code/scenes_inf443/base/src/terrain.cpp
+3
-3
3 additions, 3 deletions
projet-code/scenes_inf443/base/src/terrain.cpp
with
4 additions
and
4 deletions
projet-code/scenes_inf443/base/shaders/mesh_multi_texture/mesh_multi_texture.frag.glsl
+
1
−
1
View file @
29d1d011
...
@@ -120,7 +120,7 @@ void main()
...
@@ -120,7 +120,7 @@ void main()
vec4
color_image_texture_2
=
texture
(
image_texture_2
,
uv_image
);
vec4
color_image_texture_2
=
texture
(
image_texture_2
,
uv_image
);
// Blend the crack texture with a white image along the y direction
// Blend the crack texture with a white image along the y direction
float
blending_parameter
=
fragment
.
position
.
z
/
10
;
float
blending_parameter
=
fragment
.
position
.
z
/
25
;
color_image_texture_2
=
(
1
-
blending_parameter
)
*
vec4
(
1
,
1
,
1
,
1
)
+
blending_parameter
*
color_image_texture_2
;
color_image_texture_2
=
(
1
-
blending_parameter
)
*
vec4
(
1
,
1
,
1
,
1
)
+
blending_parameter
*
color_image_texture_2
;
// Finally multiply the color of the two textures
// Finally multiply the color of the two textures
...
...
This diff is collapsed.
Click to expand it.
projet-code/scenes_inf443/base/src/terrain.cpp
+
3
−
3
View file @
29d1d011
...
@@ -43,7 +43,7 @@ mesh create_terrain_mesh(int N, float terrain_length)
...
@@ -43,7 +43,7 @@ mesh create_terrain_mesh(int N, float terrain_length)
perlin_noise_parameters
parameters
;
perlin_noise_parameters
parameters
;
parameters
.
terrain_height
=
6
;
parameters
.
terrain_height
=
6
;
parameters
.
octave
=
6
;
parameters
.
octave
=
6
;
parameters
.
frequency_gain
=
6
;
parameters
.
frequency_gain
=
17
;
parameters
.
persistency
=
0.26
;
parameters
.
persistency
=
0.26
;
float
perlin_noise
;
float
perlin_noise
;
...
@@ -70,8 +70,8 @@ mesh create_terrain_mesh(int N, float terrain_length)
...
@@ -70,8 +70,8 @@ mesh create_terrain_mesh(int N, float terrain_length)
//blending parameter for color
//blending parameter for color
perlin_noise
=
parameters
.
terrain_height
*
noise_perlin
(
vec2
(
3
*
x
/
terrain_length
,
3
*
y
/
terrain_length
),
parameters
.
octave
,
parameters
.
persistency
,
parameters
.
frequency_gain
);
perlin_noise
=
parameters
.
terrain_height
*
noise_perlin
(
vec2
(
3
*
x
/
terrain_length
,
3
*
y
/
terrain_length
),
parameters
.
octave
,
parameters
.
persistency
,
parameters
.
frequency_gain
);
float
b
=
std
::
min
(
2
.0
,
exp
((
z
+
perlin_noise
-
20
)
/
2
)
/
exp
(
6
));
float
b
=
std
::
min
(
1
.0
,
exp
((
z
+
perlin_noise
-
20
)
/
2
)
/
exp
(
6
));
terrain
.
color
[
kv
+
N
*
ku
]
=
(
1
-
b
)
*
vec3
(
0
,
0.3
f
,
0
)
+
b
*
vec3
(
1
,
1
,
1
);
terrain
.
color
[
kv
+
N
*
ku
]
=
std
::
max
(
0.0
f
,
(
1
-
b
)
)
*
vec3
(
0
,
0.3
f
,
0
)
+
b
*
1.5
*
vec3
(
1
,
1
,
1
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment