Commit 8c964276 authored by Kaspar Scharf's avatar Kaspar Scharf

added ridged noise for terrain height in erath_texture

(earthMat is now default material for planet creation again)
parent 8d72757a
......@@ -5,7 +5,18 @@
float getHeightNoise(vec3 normalizedPosInModelspace) {
return (fbm_3d( normalizedPosInModelspace , 4, 80.)/2. + 2*fbm_3d (normalizedPosInModelspace , 2, 1.25));
float noiseContinents = 2*(fbm_3d(normalizedPosInModelspace , 2, 1.25));
float noiseRidged = (.75 - abs(fbm_3d( normalizedPosInModelspace , 2, 40.)))/2.;
float noiseDetails = fbm_3d( normalizedPosInModelspace , 2, 160.)/8.;
// float noise3 = 2*(fbm_3d( normalizedPosInModelspace , 2, 20.) - .5);
// if (noise3 < 0.) {
// noise3 = -noise3;
// }
return (noiseContinents + noiseRidged + noiseDetails) * 2.;
}
......@@ -23,13 +34,18 @@ vec4 texture_getColor(vec3 texCoord3d, vec3 upVectorNormalized, vec3 normalNorma
float noiseOct4 = 0.;
float noiseOct5 = 0.;
if (depth == 1.) {
// if (depth == 1.) {
noiseOct1 = snoise_3d(128.*128. * texCoord3d);
noiseOct2 = snoise_3d(2*128.*128. * texCoord3d);
noiseOct3 = snoise_3d(4*128.*128. * texCoord3d);
noiseOct4 = snoise_3d(8*128.*128. * texCoord3d);
noiseOct5 = snoise_3d(16*128.*128. * texCoord3d);
}
// }
// just some test:
// if (noiseOct1 < 0. || noiseOct2 < 0. || noiseOct3 < 0. || noiseOct4 < 0. || noiseOct5 < 0. ) {
// return vec4 (0.,0.,0.,1.);
// }
vec3 distortion = vec3 (.1, .1, .1);
//float noiseVal2 = fbm_3d( texCoord3d, 3, 128.*128.);
......
......@@ -556,7 +556,7 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
planetTransform->scale = glm::dvec3(solarToWorld(r), solarToWorld(r), solarToWorld(r));
planetTransform->position = pos;
planetEntity.assign<Drawable>(defaultGeom, jupiterMat, 2, m_renderer->getRenderPassId("Main"_sh));
planetEntity.assign<Drawable>(defaultGeom, earthMat, 2, m_renderer->getRenderPassId("Main"_sh));
// Add an atmosphere to the planet
......@@ -581,12 +581,12 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
atmosphere.assign<Drawable>(defaultGeom, atmosphereMat, 0, m_renderer->getRenderPassId("Main"_sh));
atmosphereTransform->scale = planetTransform->scale * 1.05;
// // Add simple water as well
// auto water = m_scene->create();
// auto waterTransform = water.assign<Transform>();
// waterTransform->parent = planetTransform;
// water.assign<Drawable>(defaultGeom, waterMat, 1, 1);
// waterTransform->scale = planetTransform->scale * 1.0;
// Add simple water as well
auto water = m_scene->create();
auto waterTransform = water.assign<Transform>();
waterTransform->parent = planetTransform;
water.assign<Drawable>(defaultGeom, waterMat, 1, 1);
waterTransform->scale = planetTransform->scale * 1.0;
// Let's add a moon!
auto moon = m_scene->create();
......
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