Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Dario Seyb
edge-of-space
Commits
c93805d8
Commit
c93805d8
authored
Feb 23, 2016
by
Dario Seyb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teaked earth a bit
parent
0933cb57
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
data/config/settings.json
data/config/settings.json
+1
-1
data/shader/planets/earth/earth_texture.glsl
data/shader/planets/earth/earth_texture.glsl
+14
-12
data/shader/terrain/generic_water_texture.glsl
data/shader/terrain/generic_water_texture.glsl
+1
-1
No files found.
data/config/settings.json
View file @
c93805d8
...
...
@@ -11,5 +11,5 @@
"jupiter"
],
"scene"
:
"AtmosphereTest"
,
"default_planet_type"
:
"
m
ar
s
"
"default_planet_type"
:
"
e
ar
th
"
}
\ No newline at end of file
data/shader/planets/earth/earth_texture.glsl
View file @
c93805d8
float
getContinentHeightNoise
(
vec3
normalizedPosInModelspace
)
{
return
2
*
(
fbm_3d
(
normalizedPosInModelspace
,
2
,
1
.
25
));
float
val
=
2
*
(
fbm_3d
(
normalizedPosInModelspace
*
2
,
4
,
1
.
25
))
+
0
.
1
;
return
val
;
}
float
getRidgedHeightNoise
(
vec3
normalizedPosInModelspace
)
{
return
(.
75
-
abs
(
fbm_3d
(
normalizedPosInModelspace
,
2
,
40
.)))
/
2
.;
...
...
@@ -13,15 +14,17 @@ float getRidgedDetailsHeightNoise(vec3 normalizedPosInModelspace) {
}
float
getHeightNoise
(
vec3
normalizedPosInModelspace
)
{
return
(
getContinentHeightNoise
(
normalizedPosInModelspace
)
+
getRidgedHeightNoise
(
normalizedPosInModelspace
)
+
getDetailHeightNoise
(
normalizedPosInModelspace
)
+
getRidgedDetailsHeightNoise
(
normalizedPosInModelspace
))
*
2
.;
float
continent
=
getContinentHeightNoise
(
normalizedPosInModelspace
);
return
(
continent
*
0
.
3
+
+
getRidgedHeightNoise
(
normalizedPosInModelspace
)
*
2
*
continent
+
(
getDetailHeightNoise
(
normalizedPosInModelspace
)
+
0
.
1
)
*
(
1
.
0
-
pow
(
1
.
0
-
continent
,
3
))
*
2
+
getDetailHeightNoise
(
normalizedPosInModelspace
*
0
.
25
)
*
(
pow
(
0
.
5
-
continent
*
0
.
5
,
2
))
+
getRidgedDetailsHeightNoise
(
normalizedPosInModelspace
)
*
0
.
2
)
*
1
.;
}
#define SNOW_LEVEL .
5
#define SNOW_LEVEL .
6
#define ROCK_LEVEL .3
#define PLANT_LEVEL .03
...
...
@@ -36,9 +39,9 @@ vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNorma
float
noiseOct5
=
0
.;
// if (depth == 1.) {
noiseOct1
=
snoise_3d
(
32
.
*
128
.
*
texCoord3d
);
noiseOct2
=
snoise_3d
(
64
.
*
128
.
*
texCoord3d
);
noiseOct3
=
snoise_3d
(
128
.
*
128
.
*
texCoord3d
);
noiseOct1
=
snoise_3d
(
32
.
*
texCoord3d
);
noiseOct2
=
snoise_3d
(
64
.
*
texCoord3d
);
noiseOct3
=
snoise_3d
(
128
.
*
texCoord3d
);
//noiseOct4 = snoise_3d(2*128.*128. * texCoord3d);
//noiseOct5 = snoise_3d(4*128.*128. * texCoord3d);
// }
...
...
@@ -50,7 +53,6 @@ vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNorma
//vec3 distortion = vec3 (.1, .1, .1);
float
heightPertubation
=
1
.
/
2
.
*
noiseOct1
+
1
.
/
4
.
*
noiseOct2
+
1
.
/
8
.
*
noiseOct3
;
vec4
color
=
vec4
(
1
.,
1
.,
1
.,
1
.);
//float ridgedHeight = getRidgedHeightNoise(texCoord3d);
...
...
@@ -61,7 +63,7 @@ vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNorma
// + getDetailHeightNoise(texCoord3d)
// )*.9 + heightPertubation * .1;
float
height
=
getHeightNoise
(
texCoord3d
)
/
2
.
*
.
9
+
heightPertubation
*
.
1
;
float
height
=
getHeightNoise
(
texCoord3d
)
/
2
.
*
.
9
;
//testing stuff:
//return vec4(normalNormalized.x,normalNormalized.y, normalNormalized.z, 1.);
...
...
data/shader/terrain/generic_water_texture.glsl
View file @
c93805d8
float
texture_water_getRidgedDetailsHeightNoise
(
vec3
normalizedPosInModelspace
)
{
return
(.
75
-
abs
(
fbm_3d
(
vec3
(
normalizedPosInModelspace
+
vec3
(
uTime
*
0
.
00
05
))
,
3
,
320
.)))
*
0
.
0003
;
return
(.
75
-
abs
(
fbm_3d
(
vec3
(
normalizedPosInModelspace
+
vec3
(
uTime
*
0
.
00
1
))
,
3
,
320
.)))
*
0
.
0003
;
//return 0.;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment