Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Dario Seyb
edge-of-space
Commits
c7b8a418
Commit
c7b8a418
authored
Jan 02, 2016
by
Dario Seyb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added gamma correction§
parent
a7705fc3
Pipeline
#662
skipped
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
data/shader/Atmosphere.fsh
data/shader/Atmosphere.fsh
+2
-2
data/shader/Blit.fsh
data/shader/Blit.fsh
+2
-2
src/game/src/engine/scene/OrbitalSimulationSystem.cpp
src/game/src/engine/scene/OrbitalSimulationSystem.cpp
+2
-1
src/game/src/engine/scene/PlayerSystem.cpp
src/game/src/engine/scene/PlayerSystem.cpp
+1
-1
src/game/src/engine/scene/scenes/AtmosphereTestScene.cpp
src/game/src/engine/scene/scenes/AtmosphereTestScene.cpp
+1
-1
No files found.
data/shader/Atmosphere.fsh
View file @
c7b8a418
...
...
@@ -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) );
...
...
data/shader/Blit.fsh
View file @
c7b8a418
...
...
@@ -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);
...
...
src/game/src/engine/scene/OrbitalSimulationSystem.cpp
View file @
c7b8a418
...
...
@@ -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.
1
f
;
atmosphereTransform
->
scale
=
planetTransform
->
scale
*
1.
05
f
;
// Let's add a moon!
...
...
src/game/src/engine/scene/PlayerSystem.cpp
View file @
c7b8a418
...
...
@@ -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.05
f
,
up
);
cameraTransform
->
rotation
=
glm
::
rotate
(
cameraTransform
->
rotation
,
rotDir
.
x
*
0.05
f
,
glm
::
vec3
(
0
,
1
,
0
)
);
cameraTransform
->
rotation
=
glm
::
rotate
(
cameraTransform
->
rotation
,
rotDir
.
y
*
0.05
f
,
glm
::
vec3
(
1
,
0
,
0
));
if
(
moveDir
.
x
!=
0
||
moveDir
.
y
||
moveDir
.
z
!=
0
)
{
...
...
src/game/src/engine/scene/scenes/AtmosphereTestScene.cpp
View file @
c7b8a418
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment