1
0
Fork 0

Show bloom buffer

This commit is contained in:
Frederic Bouvier 2012-05-12 23:38:00 +02:00
parent 8fa093ce76
commit 41ff7da797
2 changed files with 12 additions and 2 deletions

View file

@ -43,6 +43,11 @@
<type>buffer</type>
<name>bloom-3</name>
</texture-unit>
<texture-unit>
<unit>6</unit>
<type>buffer</type>
<name>ao-3</name>
</texture-unit>
<program>
<vertex-shader>Shaders/fullscreen.vert</vertex-shader>
<fragment-shader>Shaders/display.frag</fragment-shader>
@ -77,6 +82,11 @@
<type>sampler-2d</type>
<value type="int">5</value>
</uniform>
<uniform>
<name>ao_tex</name>
<type>sampler-2d</type>
<value type="int">6</value>
</uniform>
<uniform>
<name>exposure</name>
<type>float</type>

View file

@ -31,8 +31,8 @@ void main() {
color = texture2D( color_tex, (coords - vec2( 0.8, 0.0 )) * 5.0 );
} else if (coords.x < 0.2 && coords.y >= 0.8 && fg_DepthInColor) {
color = texture2D( depth_tex, (coords - vec2( 0.0, 0.8 )) * 5.0 );
} else if (coords.x < 0.2 && coords.y >= 0.8 && ambientOcclusion) {
color = texture2D( ao_tex, (coords - vec2( 0.0, 0.8 )) * 5.0 );
} else if (coords.x < 0.2 && coords.y >= 0.8 && bloomEnabled) {
color = texture2D( bloom_tex, (coords - vec2( 0.0, 0.8 )) * 5.0 );
} else {
color = texture2D( lighting_tex, coords );
if (bloomEnabled)