1
0
Fork 0

Add a bloom strength property and a slider in the Rembrandt dialog

This commit is contained in:
Frederic Bouvier 2012-06-26 09:02:21 +02:00
parent ecbcdbbd02
commit 4e241640b6
4 changed files with 87 additions and 24 deletions

View file

@ -5,6 +5,7 @@
<exposure type="float"><use>/sim/rendering/rembrandt/exposure</use></exposure>
<show-buffers type="bool"><use>/sim/rendering/rembrandt/show-buffers</use></show-buffers>
<bloom type="bool"><use>/sim/rendering/rembrandt/bloom</use></bloom>
<bloom-strength type="float"><use>/sim/rendering/rembrandt/bloom-strength</use></bloom-strength>
<bloom-buffers type="bool"><use>/sim/rendering/rembrandt/bloom-buffers</use></bloom-buffers>
<buffer-nw-enabled><use>/sim/rendering/rembrandt/debug-buffer[0]/enabled</use></buffer-nw-enabled>
@ -125,10 +126,15 @@
<type>bool</type>
<value type="bool"><use>bloom</use></value>
</uniform>
<uniform>
<name>bloomStrength</name>
<type>float</type>
<value><use>bloom-strength</use></value>
</uniform>
<uniform>
<name>bloomBuffers</name>
<type>bool</type>
<value type="bool"><use>bloom-buffers</use></value>
<value><use>bloom-buffers</use></value>
</uniform>
</pass>
</technique>

View file

@ -10,6 +10,7 @@ uniform float exposure;
uniform bool showBuffers;
uniform bool bloomEnabled;
uniform float bloomStrength;
uniform bool bloomBuffers;
uniform bool bufferNW_enabled;
@ -40,13 +41,13 @@ void main() {
} else {
color = texture2D( lighting_tex, coords );
if (bloomEnabled && bloomBuffers)
color = color + texture2D( bloom_tex, coords );
color = color + bloomStrength * texture2D( bloom_tex, coords );
//color = vec4( HDR( color.rgb ), 1.0 );
}
} else {
color = texture2D( lighting_tex, coords );
if (bloomEnabled && bloomBuffers)
color = color + texture2D( bloom_tex, coords );
color = color + bloomStrength * texture2D( bloom_tex, coords );
//color = vec4( HDR( color.rgb ), 1.0 );
}
gl_FragColor = color;

View file

@ -34,22 +34,65 @@
<hrule/>
<checkbox>
<group>
<layout>hbox</layout>
<halign>left</halign>
<label>Bloom</label>
<name>bloom</name>
<property>/sim/rendering/rembrandt/bloom</property>
<binding>
<command>dialog-apply</command>
<object-name>bloom</object-name>
</binding>
<visible>
<and>
<property>/sim/rendering/rembrandt/enabled</property>
<checkbox>
<halign>left</halign>
<label>Bloom</label>
<name>bloom</name>
<property>/sim/rendering/rembrandt/bloom</property>
<binding>
<command>dialog-apply</command>
<object-name>bloom</object-name>
</binding>
<enable>
<property>/sim/rendering/rembrandt/bloom-buffers</property>
</and>
</visible>
</checkbox>
</enable>
</checkbox>
<empty>
<pref-width>66</pref-width>
</empty>
<text>
<label>Strength</label>
<enable>
<and>
<property>/sim/rendering/rembrandt/bloom</property>
<property>/sim/rendering/rembrandt/bloom-buffers</property>
</and>
</enable>
</text>
<slider>
<name>bloom-strength</name>
<min>0.0</min>
<max>1.0</max>
<step>0.01</step>
<property>/sim/rendering/rembrandt/bloom-strength</property>
<binding>
<command>dialog-apply</command>
<object-name>bloom-strength</object-name>
</binding>
<enable>
<and>
<property>/sim/rendering/rembrandt/bloom</property>
<property>/sim/rendering/rembrandt/bloom-buffers</property>
</and>
</enable>
</slider>
<text>
<label>12345678</label>
<format>%.2f</format>
<live>true</live>
<property>/sim/rendering/rembrandt/bloom-strength</property>
<enable>
<and>
<property>/sim/rendering/rembrandt/bloom</property>
<property>/sim/rendering/rembrandt/bloom-buffers</property>
</and>
</enable>
</text>
</group>
<group>
<layout>hbox</layout>
@ -63,6 +106,9 @@
<command>dialog-apply</command>
<object-name>occlusion</object-name>
</binding>
<enable>
<property>/sim/rendering/rembrandt/ambient-occlusion-buffers</property>
</enable>
</checkbox>
<empty>
<pref-width>-4</pref-width>
@ -70,14 +116,14 @@
<text>
<label>Strength</label>
<enable>
<property>/sim/rendering/rembrandt/ambient-occlusion</property>
<and>
<property>/sim/rendering/rembrandt/ambient-occlusion</property>
<property>/sim/rendering/rembrandt/ambient-occlusion-buffers</property>
</and>
</enable>
</text>
<slider>
<name>ambient-occlusion-strength</name>
<enable>
<property>/sim/rendering/rembrandt/ambient-occlusion</property>
</enable>
<min>0.0</min>
<max>1.0</max>
<step>0.01</step>
@ -86,15 +132,24 @@
<command>dialog-apply</command>
<object-name>ambient-occlusion-strength</object-name>
</binding>
<enable>
<and>
<property>/sim/rendering/rembrandt/ambient-occlusion</property>
<property>/sim/rendering/rembrandt/ambient-occlusion-buffers</property>
</and>
</enable>
</slider>
<text>
<enable>
<property>/sim/rendering/rembrandt/ambient-occlusion</property>
</enable>
<label>12345678</label>
<format>%.2f</format>
<live>true</live>
<property>/sim/rendering/rembrandt/ambient-occlusion-strength</property>
<enable>
<and>
<property>/sim/rendering/rembrandt/ambient-occlusion</property>
<property>/sim/rendering/rembrandt/ambient-occlusion-buffers</property>
</and>
</enable>
</text>
</group>

View file

@ -69,6 +69,7 @@ Started September 2000 by David Megginson, david@megginson.com
<ambient-occlusion-strength type="float" userarchive="y">1.0</ambient-occlusion-strength>
<ambient-occlusion-buffers type="bool">true</ambient-occlusion-buffers>
<bloom type="bool" userarchive="y">true</bloom>
<bloom-strength type="float" userarchive="y">1.0</bloom-strength>
<bloom-buffers type="bool">true</bloom-buffers>
<exposure type="float" userarchive="y">1.0</exposure>
<use-color-for-depth type="bool">false</use-color-for-depth>