1
0
Fork 0

- Changed location of Compositor pipelines.

- 1-bit transparency for shadow mapping.
- Several effects ported to the Compositor.
- Miscellaneous fixes to Compositor Effects.
This commit is contained in:
Fernando García Liñán 2020-03-14 20:41:36 +01:00
parent d3e3c55fd6
commit dd2ac0a32e
17 changed files with 73 additions and 17 deletions

View file

@ -7,10 +7,13 @@
<lighting>false</lighting>
<color-mask type="vec4d">0 0 0 0</color-mask>
<cull-face>back</cull-face>
<program>
<vertex-shader>Shaders/Default/trivial.vert</vertex-shader>
<fragment-shader>Shaders/Default/trivial.frag</fragment-shader>
</program>
<blend>
<active>false</active>
</blend>
<alpha-test>
<comparison>greater</comparison>
<reference type="float">0.5</reference>
</alpha-test>
</pass>
</technique>
</PropertyList>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/bumpspec</name>
<inherits-from>Effects/model-default</inherits-from>
</PropertyList>

View file

@ -216,7 +216,7 @@
<program>
<vertex-shader n="1">Shaders/Default/forest.vert</vertex-shader>
<fragment-shader n="0">Shaders/Default/include_fog.frag</fragment-shader>
<fragment-shader n="1">Shaders/forest.frag.frag</fragment-shader>
<fragment-shader n="1">Shaders/Default/forest.frag</fragment-shader>
<attribute>
<name>tangent</name>
<index>6</index>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/light-cone</name>
</PropertyList>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/light-point</name>
</PropertyList>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/light-spot</name>
</PropertyList>

View file

@ -6,7 +6,6 @@ and fallback to plain transparency when the model shader is disabled.
<PropertyList>
<name>Effects/model-combined-transparent</name>
<inherits-from>Effects/model-combined</inherits-from>
<!-- Rembrandt rendering -->
<technique n="6">
<predicate>
<and>

View file

@ -843,7 +843,7 @@ please see Docs/README.model-combined.eff for documentation
</uniform>
</pass>
</technique>
<technique n="18">
<technique n="4">
<scheme>als-lighting</scheme>
<predicate>
<and>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/reflect</name>
<inherits-from>Effects/model-default</inherits-from>
</PropertyList>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/shadow-vol</name>
</PropertyList>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/shadow</name>
</PropertyList>

View file

@ -38,7 +38,7 @@ layout (std140) uniform SpotLightBlock {
vec3 addColors(vec3 a, vec3 b)
{
return 0.14 * log(exp(a/0.14) + exp(b/0.14));
return 0.14 * log(exp(a/0.14) + exp(b/0.14) - vec3(1.0));
}
// @param p Fragment position in view space.

View file

@ -1,5 +1,7 @@
#version 120
uniform bool shadows_enabled;
uniform mat4 fg_LightMatrix_csm0;
uniform mat4 fg_LightMatrix_csm1;
uniform mat4 fg_LightMatrix_csm2;
@ -10,6 +12,9 @@ varying vec4 lightSpacePos[4];
void setupShadows(vec4 eyeSpacePos)
{
if (!shadows_enabled)
return;
float normalOffset = 0.005;
float costheta = clamp(dot(gl_Normal, gl_LightSource[0].position.xyz), 0.0, 1.0);
@ -31,8 +36,8 @@ void setupShadows(vec4 eyeSpacePos)
lightSpacePos[3] = fg_LightMatrix_csm3 * eyeSpacePos;
// Offset only in UV space
lightSpacePos[0].xy = offsets[0].xy;
lightSpacePos[1].xy = offsets[1].xy;
lightSpacePos[2].xy = offsets[2].xy;
lightSpacePos[3].xy = offsets[3].xy;
// lightSpacePos[0].xy = offsets[0].xy;
// lightSpacePos[1].xy = offsets[1].xy;
// lightSpacePos[2].xy = offsets[2].xy;
// lightSpacePos[3].xy = offsets[3].xy;
}

View file

@ -10,6 +10,13 @@
<height>screen</height>
<format>rgba8</format>
</buffer>
<buffer>
<name>depth</name>
<type>2d</type>
<width>screen</width>
<height>screen</height>
<format>depth32f</format>
</buffer>
<buffer>
<name>sun-shadowmap-atlas</name>
<type>2d</type>
@ -27,7 +34,7 @@
<!-- Shadow mapping pre-passes -->
<pass include="csm.xml">
<pass include="ALS/csm.xml">
<name>csm0</name>
<near-m>0.1</near-m>
<far-m>3.0</far-m>
@ -38,7 +45,7 @@
<height>0.5</height>
</viewport>
</pass>
<pass include="csm.xml">
<pass include="ALS/csm.xml">
<name>csm1</name>
<near-m>3.0</near-m>
<far-m>50.0</far-m>
@ -49,7 +56,7 @@
<height>0.5</height>
</viewport>
</pass>
<pass include="csm.xml">
<pass include="ALS/csm.xml">
<name>csm2</name>
<near-m>50.0</near-m>
<far-m>150.0</far-m>
@ -60,7 +67,7 @@
<height>0.5</height>
</viewport>
</pass>
<pass include="csm.xml">
<pass include="ALS/csm.xml">
<name>csm3</name>
<near-m>150.0</near-m>
<far-m>1500.0</far-m>
@ -98,6 +105,12 @@
<component>color0</component>
<multisample-samples>4</multisample-samples>
<multisample-color-samples>4</multisample-color-samples>
</attachment>
<attachment>
<buffer>depth</buffer>
<component>depth</component>
<multisample-samples>4</multisample-samples>
<multisample-color-samples>4</multisample-color-samples>
</attachment>
</pass>

View file

@ -4,4 +4,4 @@
This Compositor is used by default when none has been specified in the
CameraGroup settings.
-->
<PropertyList include="LowSpec/low-spec.xml"/>
<PropertyList include="low-spec.xml"/>

View file

@ -53,6 +53,12 @@ Started September 2000 by David Megginson, david@megginson.com
<rendering>
<initialized type="bool">false</initialized>
<materials-file>Materials/regions/materials.xml</materials-file>
<als>
<shadows>
<enabled type="bool" userarchive="y">false</enabled>
<sun-atlas-size type="int" userarchive="y">1024</sun-atlas-size>
</shadows>
</als>
<rembrandt>
<enabled type="bool">false</enabled>
<renderer>default-pipeline</renderer>