Commit 0cb3af52 authored by Kaspar Scharf's avatar Kaspar Scharf

added some more ridged noise for details

parent 74b52177
#pragma import "../noise/noise3d.glsl"
//needed for calculation of modified normal-vector; change until you get a good result for normals:
#define SAMPLE_ANGLE__NORMAL_VECTOR 0.0005
#define SAMPLE_ANGLE__NORMAL_VECTOR 0.000005
float getContinentHeightNoise(vec3 normalizedPosInModelspace) {
return 2*(fbm_3d(normalizedPosInModelspace , 2, 1.25));
......@@ -12,12 +12,16 @@ float getRidgedHeightNoise(vec3 normalizedPosInModelspace) {
float getDetailHeightNoise(vec3 normalizedPosInModelspace) {
return fbm_3d( normalizedPosInModelspace , 2, 160.)/8.;
}
float getRidgedDetailsHeightNoise(vec3 normalizedPosInModelspace) {
return (.75 - abs(fbm_3d( normalizedPosInModelspace , 4, 8*640.)))/256.;
//return 0.;
}
float getHeightNoise(vec3 normalizedPosInModelspace) {
return (getContinentHeightNoise(normalizedPosInModelspace)
+ getRidgedHeightNoise(normalizedPosInModelspace)
+ getDetailHeightNoise(normalizedPosInModelspace))
+ getDetailHeightNoise(normalizedPosInModelspace)
+ getRidgedDetailsHeightNoise(normalizedPosInModelspace))
* 2.;
}
......@@ -40,8 +44,8 @@ vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNorma
noiseOct1 = snoise_3d(32.*128. * texCoord3d);
noiseOct2 = snoise_3d(64.*128. * texCoord3d);
noiseOct3 = snoise_3d(128.*128. * texCoord3d);
noiseOct4 = snoise_3d(2*128.*128. * texCoord3d);
noiseOct5 = snoise_3d(4*128.*128. * texCoord3d);
//noiseOct4 = snoise_3d(2*128.*128. * texCoord3d);
//noiseOct5 = snoise_3d(4*128.*128. * texCoord3d);
// }
// just some test:
......@@ -65,7 +69,7 @@ vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNorma
float height =getHeightNoise(texCoord3d)/2.*.9 + heightPertubation * .1;
//testing stuff:
//color = vec4(normalNormalized.x,normalNormalized.y, normalNormalized.z, 1.);
//return vec4(normalNormalized.x,normalNormalized.y, normalNormalized.z, 1.);
//color = vec4(upVectorNormalized.x,upVectorNormalized.y, upVectorNormalized.z, 1.);
float dt = dot(normalNormalized, upVectorNormalized);
......
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