1
0
Fork 0
fgdata/Effects/HDR/lighting.eff
Fernando García Liñán 9f39644199 HDR: Optimize the G-Buffer and do not separate the occlusion texture
- The G-Buffer layout has been redesigned to be 96 bits per pixel. There are 24
unused bits that can be used for extra material parameters later (like
clearcoat).
- Add better debug views for the G-Buffer.
- Use octahedron normal encoding. This yields the same results as the previous
method but uses 16 bits less.
- Use rg11fb10f for the environment mapping cubemaps.
- Tweak the shadow mapping parameters and add a colored debug mode.
- Only render shadow maps for objects that inherit from model-default.eff or
model-pbr.eff instead of having a fallback Effect. Now transparent objects
should be ignored (if they are marked as such with model-transparent or
similar).
- Remove the separate occlusion texture. Now the PBR Effect expects a single
texture where R=occlusion, G=roughness and B=metallic.
2021-08-27 00:03:43 +02:00

102 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/HDR/lighting</name>
<parameters>
<texture n="8">
<image>Textures/PBR/dfg_lut.dds</image>
<type>2d</type>
<filter>linear</filter>
<mag-filter>linear</mag-filter>
<wrap-s>clamp-to-edge</wrap-s>
<wrap-t>clamp-to-edge</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<show-shadow-cascades>
<use>/sim/rendering/hdr/debug/show-shadow-cascades</use>
</show-shadow-cascades>
</parameters>
<technique n="1">
<pass>
<stencil>
<function>less-or-equal</function>
<value>8</value>
</stencil>
<texture-unit>
<unit>8</unit>
<image><use>texture[8]/image</use></image>
<type><use>texture[8]/type</use></type>
<filter><use>texture[8]/filter</use></filter>
<mag-filter><use>texture[8]/mag-filter</use></mag-filter>
<wrap-s><use>texture[8]/wrap-s</use></wrap-s>
<wrap-t><use>texture[8]/wrap-t</use></wrap-t>
<internal-format><use>texture[8]/internal-format</use></internal-format>
</texture-unit>
<program>
<vertex-shader>Shaders/HDR/trivial.vert</vertex-shader>
<fragment-shader>Shaders/HDR/lighting.frag</fragment-shader>
<fragment-shader>Shaders/HDR/gbuffer-include.frag</fragment-shader>
<fragment-shader>Shaders/HDR/shadows-include.frag</fragment-shader>
<fragment-shader>Shaders/HDR/lighting-include.frag</fragment-shader>
<fragment-shader>Shaders/HDR/aerial-perspective-include.frag</fragment-shader>
</program>
<uniform>
<name>gbuffer0_tex</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>gbuffer1_tex</name>
<type>sampler-2d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>gbuffer2_tex</name>
<type>sampler-2d</type>
<value type="int">2</value>
</uniform>
<uniform>
<name>depth_tex</name>
<type>sampler-2d</type>
<value type="int">3</value>
</uniform>
<uniform>
<name>ao_tex</name>
<type>sampler-2d</type>
<value type="int">7</value>
</uniform>
<uniform>
<name>debug_shadow_cascades</name>
<type>bool</type>
<value><use>show-shadow-cascades</use></value>
</uniform>
<!-- Shadows include -->
<uniform>
<name>shadow_tex</name>
<type>sampler-2d-shadow</type>
<value type="int">10</value>
</uniform>
<!-- Lighting include -->
<uniform>
<name>dfg_lut</name>
<type>sampler-2d</type>
<value type="int">8</value>
</uniform>
<uniform>
<name>prefiltered_envmap</name>
<type>sampler-cube</type>
<value type="int">9</value>
</uniform>
<!-- Aerial perspective include -->
<uniform>
<name>aerial_perspective_lut</name>
<type>sampler-2d</type>
<value type="int">11</value>
</uniform>
<uniform>
<name>transmittance_lut</name>
<type>sampler-2d</type>
<value type="int">12</value>
</uniform>
</pass>
</technique>
</PropertyList>