Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
edge-of-space
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dario Seyb
edge-of-space
Commits
7b2dead6
Commit
7b2dead6
authored
Feb 08, 2016
by
Dario Seyb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made music loop
parent
b2062388
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
data/shader/ssao/SSAOCompute.fsh
data/shader/ssao/SSAOCompute.fsh
+6
-3
src/game/include/engine/audio/SoundSource.hpp
src/game/include/engine/audio/SoundSource.hpp
+2
-2
src/game/src/engine/audio/SoundSource.cpp
src/game/src/engine/audio/SoundSource.cpp
+2
-1
src/game/src/engine/scene/scenes/AtmosphereTestScene.cpp
src/game/src/engine/scene/scenes/AtmosphereTestScene.cpp
+2
-2
No files found.
data/shader/ssao/SSAOCompute.fsh
View file @
7b2dead6
...
...
@@ -28,7 +28,8 @@ vec3 unpackWorldPosition(float depth) {
clipSpaceLocation.z = depth * 2.0 - 1.0;
clipSpaceLocation.w = 1.0;
vec4 homogenousLocation = uViewProjectionInverseMatrix * clipSpaceLocation;
return homogenousLocation.xyz / homogenousLocation.w;
homogenousLocation /= homogenousLocation.w;
return homogenousLocation.xyz;
}
float linearizeDepth(float depth) {
...
...
@@ -61,9 +62,11 @@ void main() {
float sampleDepth = texture(uSamplerDepth, offset.xy).r;
vec3 samplePos = unpackWorldPosition(sampleDepth);
// range check & accumulate:
float rangeCheck= length(samplePos-origin) > uRadius ? 1.0 : 0.0;
occlusion += ( originDepth >= sampleDepth ? 1.0 : 0.0) * rangeCheck;
float rangeCheck= length(samplePos-origin) < uRadius ? 1.0 : 0.0;
//oColor.r = samplePos.x; return;
occlusion += ( length(origin) >= length(samplePos) ? 1.0 : 0.0) * rangeCheck;
}
occlusion = 1.0 - (occlusion / uSampleKernelSize);
...
...
src/game/include/engine/audio/SoundSource.hpp
View file @
7b2dead6
...
...
@@ -18,11 +18,11 @@ struct SoundSource : Component<SoundSource> {
friend
class
AudioSystem
;
public:
SoundSource
()
:
m_sound
(
nullptr
),
m_channel
(
nullptr
)
{}
SoundSource
(
std
::
shared_ptr
<
Sound
>
sound
)
:
m_sound
(
sound
),
m_channel
(
nullptr
),
m_state
(
PlaybackState
::
STOPPED
)
{}
SoundSource
(
std
::
shared_ptr
<
Sound
>
sound
)
:
m_sound
(
sound
),
m_channel
(
nullptr
),
m_state
(
PlaybackState
::
STOPPED
)
{
}
void
stop
();
void
pause
();
void
play
();
void
play
(
int
loops
=
0
);
void
setVolume
(
float
vol
);
PlaybackState
getState
()
{
return
m_state
;
}
...
...
src/game/src/engine/audio/SoundSource.cpp
View file @
7b2dead6
...
...
@@ -16,7 +16,7 @@ void SoundSource::pause() {
}
}
void
SoundSource
::
play
()
{
void
SoundSource
::
play
(
int
loops
)
{
bool
isPaused
;
m_channel
->
getPaused
(
&
isPaused
);
if
(
isPaused
&&
m_channel
)
{
...
...
@@ -25,6 +25,7 @@ void SoundSource::play() {
m_channel
=
m_sound
->
play
();
}
m_channel
->
setVolume
(
m_volume
);
m_channel
->
setLoopCount
(
loops
);
m_state
=
PlaybackState
::
PLAYING
;
}
...
...
src/game/src/engine/scene/scenes/AtmosphereTestScene.cpp
View file @
7b2dead6
...
...
@@ -42,7 +42,7 @@ void AtmosphereTestScene::switchConsole() {
m_renderer
->
setRenderPassActive
(
"Skybox"
_sh
,
true
);
m_renderer
->
setRenderPassActive
(
"Minimap"
_sh
,
true
);
cockpitSoundSource
->
setVolume
(
0
);
cockpitSoundSource
->
play
();
cockpitSoundSource
->
play
(
-
1
);
m_renderer
->
setRenderPassActive
(
"Console"
_sh
,
false
);
}
else
{
...
...
@@ -315,7 +315,7 @@ void AtmosphereTestScene::switchToMainScene() {
consoleSoundSource
=
console
.
assign
<
SoundSource
>
(
soundTrackMain
);
consoleSoundSource
->
setVolume
(
0.5
);
consoleSoundSource
->
play
();
consoleSoundSource
->
play
(
-
1
);
auto
consoleFrontLeft
=
m_sceneGraph
->
create
();
consoleFrontLeft
.
assign
<
Drawable
>
(
...
...
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