Commit c93805d8 authored by Dario Seyb's avatar Dario Seyb

teaked earth a bit

parent 0933cb57
......@@ -11,5 +11,5 @@
"jupiter"
],
"scene": "AtmosphereTest",
"default_planet_type": "mars"
"default_planet_type": "earth"
}
\ No newline at end of file
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.);
......
float texture_water_getRidgedDetailsHeightNoise(vec3 normalizedPosInModelspace) {
return (.75 - abs(fbm_3d( vec3(normalizedPosInModelspace +vec3( uTime* 0.0005)) , 3, 320.))) * 0.0003;
return (.75 - abs(fbm_3d( vec3(normalizedPosInModelspace +vec3( uTime* 0.001)) , 3, 320.))) * 0.0003;
//return 0.;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment