Commit c7b8a418 authored by Dario Seyb's avatar Dario Seyb

added gamma correction§

parent a7705fc3
Pipeline #662 skipped
......@@ -43,9 +43,9 @@ vec4 color() {
distance = min(distance, length(camSpaceAtmospherePos - tePosition + uCameraPosition));
float fogAmount = 1.0 - exp( -distance*1.0/atmosphereRadius );
float fogAmount = 1.0 - exp( -distance*4.0/atmosphereRadius );
float sunAmount = max( dot( viewDir, uSunDir ), 0.0 );
vec3 fogColor = mix( vec3(0.5,0.6,0.7), // bluish
vec3 fogColor = mix( vec3(0.5,0.6,0.9), // bluish
vec3(1.0,0.9,0.7), // yellowish
pow(sunAmount,8.0) );
......
......@@ -32,9 +32,9 @@ void main()
vec3 curr = Uncharted2Tonemap(ExposureBias*texColor);
vec3 whiteScale = vec3(1.0f)/Uncharted2Tonemap(vec3(W));
vec3 color = curr*whiteScale;
vec3 color = texture(uSamplerColor, vTexCoord).rgb; //curr*whiteScale;
vec3 retColor = texture(uSamplerColor, vTexCoord).rgb; //pow(color, vec3(1.0/2.2));
vec3 retColor = pow(color, vec3(1.0/2.2));
retColor += vec3(rand(gl_FragCoord.xy) * 1.0/255 - 0.5/255);
oColor = vec4( retColor, 1);
......
......@@ -156,11 +156,12 @@ Entity OrbitalSimulationSystem::addPlanet(Transform::Handle sun, std::string n,
planetTransform->scale = glm::vec3(solarToWorld(r), solarToWorld(r), solarToWorld(r));
planetTransform->position = pos;
// Add an atmosphere to the planet
auto atmosphere = m_scene->create();
auto atmosphereTransform = atmosphere.assign<Transform>();
atmosphereTransform->parent = planetTransform;
atmosphere.assign<Drawable>(defaultGeom, atmosphereMat);
atmosphereTransform->scale = planetTransform->scale * 1.1f;
atmosphereTransform->scale = planetTransform->scale * 1.05f;
// Let's add a moon!
......
......@@ -145,7 +145,7 @@ void PlayerSystem::update(float dt) {
// Rotate the camera based on the mouse movement
auto up = rotate(glm::vec3(0, 1, 0), glm::inverse(cameraTransform->rotation));
cameraTransform->rotation = glm::rotate(cameraTransform->rotation, rotDir.x * 0.05f, up);
cameraTransform->rotation = glm::rotate(cameraTransform->rotation, rotDir.x * 0.05f, glm::vec3(0, 1, 0));
cameraTransform->rotation = glm::rotate(cameraTransform->rotation, rotDir.y * 0.05f, glm::vec3(1, 0, 0));
if (moveDir.x != 0 || moveDir.y || moveDir.z != 0 ) {
......
......@@ -62,7 +62,7 @@ bool AtmosphereTestScene::startup() {
sun.assign<Drawable>(geom1, sunMaterial);
float scale = m_orbitals->solarRadius * m_orbitals->scaleFactor * 0.1;
sunTransform->scale = glm::vec3(scale);
sunLight = sun.assign<Light>(glm::vec4(1, 1, 1, 1.5), glm::vec3(1, 0, 0), false, LightType::DIRECTIONAL);
sunLight = sun.assign<Light>(glm::vec4(1, 1, 1, 3), glm::vec3(1, 0, 0), false, LightType::DIRECTIONAL);
// create a planet!
// Mass in solar masses, Radius in solar radii, Eccentricity, Semimajor axis, Inclination, Ascending Node, Arg. of Periapsis, time at perihelion
......
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