Commit 19567fd9 authored by Dario Seyb's avatar Dario Seyb

more atmosphere tweaks

parent 76c84d7e
......@@ -248,7 +248,7 @@ vec4 color() {
/*vec3 g = x - vec3(0.0, 0.0, planetRadius + 10.0);
vec3 g = x - vec3(0.0, 0.0, planetRadius + 10.0);
float a = v.x * v.x + v.y * v.y - v.z * v.z;
float b = 2.0 * (g.x * v.x + g.y * v.y - g.z * v.z);
float c = g.x * g.x + g.y * g.y - g.z * g.z;
......@@ -261,16 +261,16 @@ vec4 color() {
}
} else if (cone) {
t = d;
}*/
}
vec3 attenuation = vec3(1.0);
vec3 s = uSunDir;
fogColor = max(vec3(0.0), inscatter(x, worldPos, t, v, s, r, mu, attenuation));
if(length(attenuation) < 0.5 || true) attenuation = vec3(1);
if(length(attenuation) < 0.5) attenuation = vec3(1);
vec3 backgroundColor = texture(uSamplerColor, screenTexCoord).rgb;
fogColor += max(vec3(0.0), attenuation * backgroundColor);
fogColor += max(vec3(0.0), backgroundColor);
fogAmount = 1.0;
......
......@@ -507,7 +507,7 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
auto planetComponent = planetEntity.assign<Planet>(n, m, r, e, a, i, N, P, T);
// Move the planet to the right position:
glm::dvec3 posInAU = applyKepler(planetComponent, 0);
glm::dvec3 posInAU = applyKepler(planetComponent, 180);
glm::dvec3 pos = glm::dvec3(AUToWorld(posInAU.x), AUToWorld(posInAU.y), AUToWorld(posInAU.z));
......
......@@ -278,7 +278,7 @@ bool PlayerSystem::startup() {
cameraTransform = m_mainCamera.assign<Transform>();
camera = m_mainCamera.assign<Camera>(50, 1, 20000000);
camera->isMain = true;
cameraTransform->position = glm::dvec3(0, 0, 1000);
cameraTransform->position = glm::dvec3(0, 0, 25000);
directionRot = cameraTransform->rotation;
......@@ -513,7 +513,7 @@ void PlayerSystem::update(float dt) {
double dist = glm::length(cameraTransform->position);
// If we drift away from the planet, stop following its orbit:
if (dist > r * 2.5 ) {
if (dist > r * 5 ) {
cameraTransform->position += cameraTransform->parent->position;
m_orbitals->minimapItems[parentEntity.id()].component<Drawable>()->material.emissiveColor = glm::vec4(1.0, 0.0, 0, 1.0);
......@@ -562,7 +562,7 @@ void PlayerSystem::update(float dt) {
// Excluding moons FIXME
if (planet->name != "Moon") {
r = m_orbitals->solarToWorld(planet->radius);
if (glm::length( cameraTransform->position - transform->position) < r * 2){
if (glm::length( cameraTransform->position - transform->position) < r * 4.5){
cameraTransform->position = cameraTransform->position - transform->position;
cameraTransform->lastPosition = cameraTransform->lastPosition - transform->lastPosition;
cameraTransform->parent = transform;
......
......@@ -171,7 +171,7 @@ bool AtmosphereTestScene::startup() {
if (e.originalEvent.key.type == SDL_KEYDOWN) {
m_player->attachToParent(earth);
float r = earth.component<Transform>()->scale.x;
m_player->setPosition(glm::vec3(0, 0, r * 1.2));
m_player->setPosition(glm::vec3(0, 0, r * 3.5));
m_player->setRotation(glm::mat4());
}
break;
......@@ -279,7 +279,7 @@ void AtmosphereTestScene::switchToMainScene() {
m_player->attachToParent(earth);
double r = earth.component<Transform>()->scale.x;
m_player->setPosition(glm::dvec3(0, 0, r * 1.2));
m_player->setPosition(glm::dvec3(-r * 0.5, 0, r * 2.5));
}
{
......
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