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>
|
||||
<internal-format>normalized</internal-format>
|
||||
</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>
|
||||
<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>
|
||||
<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>
|
||||
<film-wear><use>/sim/rendering/rembrandt/cinema/film-wear</use></film-wear>
|
||||
</cinema>
|
||||
|
||||
<buffer-nw-enabled><use>/sim/rendering/rembrandt/debug-buffer[0]/enabled</use></buffer-nw-enabled>
|
||||
|
@ -157,6 +165,14 @@
|
|||
<type>buffer</type>
|
||||
<name>bloom-3</name>
|
||||
</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>
|
||||
<vertex-shader>Shaders/fullscreen.vert</vertex-shader>
|
||||
|
@ -172,6 +188,11 @@
|
|||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>film_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>bloomEnabled</name>
|
||||
|
@ -246,6 +267,12 @@
|
|||
<type>float</type>
|
||||
<value><use>cinema/color-fringe-factor</use></value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>filmWear</name>
|
||||
<type>bool</type>
|
||||
<value><use>cinema/film-wear</use></value>
|
||||
</uniform>
|
||||
</pass>
|
||||
</technique>
|
||||
<technique n="11">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
uniform sampler2D lighting_tex;
|
||||
uniform sampler2D bloom_tex;
|
||||
uniform sampler2D film_tex;
|
||||
|
||||
uniform bool colorShift;
|
||||
uniform vec3 redShift;
|
||||
|
@ -16,8 +17,10 @@ uniform vec3 distortionFactor;
|
|||
uniform bool colorFringe;
|
||||
uniform float colorFringeFactor;
|
||||
|
||||
uniform bool filmWear;
|
||||
|
||||
uniform vec2 fg_BufferSize;
|
||||
// uniform float osg_SimulationTime;
|
||||
uniform float osg_SimulationTime;
|
||||
// uniform float shutterFreq;
|
||||
// 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 );
|
||||
if (bloomEnabled && bloomBuffers)
|
||||
color += bloomStrength * texture2D( bloom_tex, c1 );
|
||||
|
@ -77,10 +85,10 @@ void main() {
|
|||
c = c * vec2( 1.0, fg_BufferSize.y / fg_BufferSize.x );
|
||||
float l = length(c);
|
||||
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)
|
||||
// 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>
|
||||
</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/>
|
||||
|
||||
<group>
|
||||
|
|
|
@ -101,6 +101,7 @@ Started September 2000 by David Megginson, david@megginson.com
|
|||
</distortion-factor>
|
||||
<color-fringe type="bool">false</color-fringe>
|
||||
<color-fringe-factor type="float" userarchive="y">1.0</color-fringe-factor>
|
||||
<film-wear type="bool">false</film-wear>
|
||||
</cinema>
|
||||
<exposure type="float" userarchive="y">1.0</exposure>
|
||||
<use-color-for-depth type="bool">false</use-color-for-depth>
|
||||
|
|
Loading…
Reference in a new issue