Add film wear to the cinema postprocessing effects
This commit is contained in:
parent
fb0fa00877
commit
c3bcb8a6de
5 changed files with 64 additions and 3 deletions
|
@ -13,6 +13,13 @@
|
||||||
<wrap-t>repeat</wrap-t>
|
<wrap-t>repeat</wrap-t>
|
||||||
<internal-format>normalized</internal-format>
|
<internal-format>normalized</internal-format>
|
||||||
</texture>
|
</texture>
|
||||||
|
<texture n="1">
|
||||||
|
<image>Textures\film-dirt.png</image>
|
||||||
|
<filter>linear-mipmap-linear</filter>
|
||||||
|
<wrap-s>repeat</wrap-s>
|
||||||
|
<wrap-t>repeat</wrap-t>
|
||||||
|
<internal-format>normalized</internal-format>
|
||||||
|
</texture>
|
||||||
|
|
||||||
<cinema>
|
<cinema>
|
||||||
<vignette><use>/sim/rendering/rembrandt/cinema/vignette</use></vignette>
|
<vignette><use>/sim/rendering/rembrandt/cinema/vignette</use></vignette>
|
||||||
|
@ -26,6 +33,7 @@
|
||||||
<distortion-factor><use>/sim/rendering/rembrandt/cinema/distortion-factor</use></distortion-factor>
|
<distortion-factor><use>/sim/rendering/rembrandt/cinema/distortion-factor</use></distortion-factor>
|
||||||
<color-fringe><use>/sim/rendering/rembrandt/cinema/color-fringe</use></color-fringe>
|
<color-fringe><use>/sim/rendering/rembrandt/cinema/color-fringe</use></color-fringe>
|
||||||
<color-fringe-factor><use>/sim/rendering/rembrandt/cinema/color-fringe-factor</use></color-fringe-factor>
|
<color-fringe-factor><use>/sim/rendering/rembrandt/cinema/color-fringe-factor</use></color-fringe-factor>
|
||||||
|
<film-wear><use>/sim/rendering/rembrandt/cinema/film-wear</use></film-wear>
|
||||||
</cinema>
|
</cinema>
|
||||||
|
|
||||||
<buffer-nw-enabled><use>/sim/rendering/rembrandt/debug-buffer[0]/enabled</use></buffer-nw-enabled>
|
<buffer-nw-enabled><use>/sim/rendering/rembrandt/debug-buffer[0]/enabled</use></buffer-nw-enabled>
|
||||||
|
@ -157,6 +165,14 @@
|
||||||
<type>buffer</type>
|
<type>buffer</type>
|
||||||
<name>bloom-3</name>
|
<name>bloom-3</name>
|
||||||
</texture-unit>
|
</texture-unit>
|
||||||
|
<texture-unit>
|
||||||
|
<unit>2</unit>
|
||||||
|
<image><use>texture[1]/image</use></image>
|
||||||
|
<filter><use>texture[1]/filter</use></filter>
|
||||||
|
<wrap-s><use>texture[1]/wrap-s</use></wrap-s>
|
||||||
|
<wrap-t><use>texture[1]/wrap-t</use></wrap-t>
|
||||||
|
<internal-format><use>texture[1]/internal-format</use></internal-format>
|
||||||
|
</texture-unit>
|
||||||
|
|
||||||
<program>
|
<program>
|
||||||
<vertex-shader>Shaders/fullscreen.vert</vertex-shader>
|
<vertex-shader>Shaders/fullscreen.vert</vertex-shader>
|
||||||
|
@ -172,6 +188,11 @@
|
||||||
<type>sampler-2d</type>
|
<type>sampler-2d</type>
|
||||||
<value type="int">1</value>
|
<value type="int">1</value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
<uniform>
|
||||||
|
<name>film_tex</name>
|
||||||
|
<type>sampler-2d</type>
|
||||||
|
<value type="int">2</value>
|
||||||
|
</uniform>
|
||||||
|
|
||||||
<uniform>
|
<uniform>
|
||||||
<name>bloomEnabled</name>
|
<name>bloomEnabled</name>
|
||||||
|
@ -246,6 +267,12 @@
|
||||||
<type>float</type>
|
<type>float</type>
|
||||||
<value><use>cinema/color-fringe-factor</use></value>
|
<value><use>cinema/color-fringe-factor</use></value>
|
||||||
</uniform>
|
</uniform>
|
||||||
|
|
||||||
|
<uniform>
|
||||||
|
<name>filmWear</name>
|
||||||
|
<type>bool</type>
|
||||||
|
<value><use>cinema/film-wear</use></value>
|
||||||
|
</uniform>
|
||||||
</pass>
|
</pass>
|
||||||
</technique>
|
</technique>
|
||||||
<technique n="11">
|
<technique n="11">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
uniform sampler2D lighting_tex;
|
uniform sampler2D lighting_tex;
|
||||||
uniform sampler2D bloom_tex;
|
uniform sampler2D bloom_tex;
|
||||||
|
uniform sampler2D film_tex;
|
||||||
|
|
||||||
uniform bool colorShift;
|
uniform bool colorShift;
|
||||||
uniform vec3 redShift;
|
uniform vec3 redShift;
|
||||||
|
@ -16,8 +17,10 @@ uniform vec3 distortionFactor;
|
||||||
uniform bool colorFringe;
|
uniform bool colorFringe;
|
||||||
uniform float colorFringeFactor;
|
uniform float colorFringeFactor;
|
||||||
|
|
||||||
|
uniform bool filmWear;
|
||||||
|
|
||||||
uniform vec2 fg_BufferSize;
|
uniform vec2 fg_BufferSize;
|
||||||
// uniform float osg_SimulationTime;
|
uniform float osg_SimulationTime;
|
||||||
// uniform float shutterFreq;
|
// uniform float shutterFreq;
|
||||||
// uniform float shutterDuration;
|
// uniform float shutterDuration;
|
||||||
|
|
||||||
|
@ -54,6 +57,11 @@ void main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec3 dirt = vec3(1.0);
|
||||||
|
if (filmWear) {
|
||||||
|
dirt = texture2D(film_tex, initialCoords + vec2(0.0, osg_SimulationTime * 7.7)).rgb;
|
||||||
|
}
|
||||||
|
|
||||||
vec4 color = texture2D( lighting_tex, c1 );
|
vec4 color = texture2D( lighting_tex, c1 );
|
||||||
if (bloomEnabled && bloomBuffers)
|
if (bloomEnabled && bloomBuffers)
|
||||||
color += bloomStrength * texture2D( bloom_tex, c1 );
|
color += bloomStrength * texture2D( bloom_tex, c1 );
|
||||||
|
@ -77,10 +85,10 @@ void main() {
|
||||||
c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x );
|
c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x );
|
||||||
float l = length(c);
|
float l = length(c);
|
||||||
float f = smoothstep( innerCircle, innerCircle * outerCircle, l );
|
float f = smoothstep( innerCircle, innerCircle * outerCircle, l );
|
||||||
color.rgb = (1 - f) * color.rgb;
|
color.rgb = (1.0 - f) * color.rgb;
|
||||||
}
|
}
|
||||||
// if ((osg_FrameNumber % 6) == 0)
|
// if ((osg_FrameNumber % 6) == 0)
|
||||||
// f = 1.0;
|
// f = 1.0;
|
||||||
|
|
||||||
gl_FragColor = color;
|
gl_FragColor = color * vec4(dirt, 1.0);
|
||||||
}
|
}
|
||||||
|
|
BIN
Textures/film-dirt.png
Normal file
BIN
Textures/film-dirt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
|
@ -1007,6 +1007,31 @@
|
||||||
</text>
|
</text>
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
|
<group>
|
||||||
|
<layout>hbox</layout>
|
||||||
|
<halign>left</halign>
|
||||||
|
|
||||||
|
<checkbox>
|
||||||
|
<halign>left</halign>
|
||||||
|
<label>Film wear</label>
|
||||||
|
<name>film-wear</name>
|
||||||
|
<property>/sim/rendering/rembrandt/cinema/film-wear</property>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
<object-name>film-wear</object-name>
|
||||||
|
</binding>
|
||||||
|
<enable>
|
||||||
|
<and>
|
||||||
|
<not><property>/sim/rendering/rembrandt/night-vision</property></not>
|
||||||
|
<or>
|
||||||
|
<property>/sim/rendering/rembrandt/cinema/vignette</property>
|
||||||
|
<property>/sim/rendering/rembrandt/cinema/color-shift</property>
|
||||||
|
</or>
|
||||||
|
</and>
|
||||||
|
</enable>
|
||||||
|
</checkbox>
|
||||||
|
</group>
|
||||||
|
|
||||||
<hrule/>
|
<hrule/>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
|
|
|
@ -101,6 +101,7 @@ Started September 2000 by David Megginson, david@megginson.com
|
||||||
</distortion-factor>
|
</distortion-factor>
|
||||||
<color-fringe type="bool">false</color-fringe>
|
<color-fringe type="bool">false</color-fringe>
|
||||||
<color-fringe-factor type="float" userarchive="y">1.0</color-fringe-factor>
|
<color-fringe-factor type="float" userarchive="y">1.0</color-fringe-factor>
|
||||||
|
<film-wear type="bool">false</film-wear>
|
||||||
</cinema>
|
</cinema>
|
||||||
<exposure type="float" userarchive="y">1.0</exposure>
|
<exposure type="float" userarchive="y">1.0</exposure>
|
||||||
<use-color-for-depth type="bool">false</use-color-for-depth>
|
<use-color-for-depth type="bool">false</use-color-for-depth>
|
||||||
|
|
Loading…
Reference in a new issue