1
0
Fork 0

HDR: Port chrome.eff

This commit is contained in:
Fernando García Liñán 2021-08-25 14:32:22 +02:00
parent 356ff8ff34
commit 55410e9d35
3 changed files with 56 additions and 0 deletions

View file

@ -64,4 +64,29 @@
</texture-unit>
</pass>
</technique>
<technique n="109">
<scheme>hdr-geometry</scheme>
<pass>
<!-- Reverse floating point depth buffer -->
<depth>
<function>gequal</function>
<near>1.0</near>
<far>0.0</far>
</depth>
<stencil>
<function>always</function>
<value>8</value>
<pass>replace</pass>
</stencil>
<blend>0</blend>
<rendering-hint>opaque</rendering-hint>
<cull-face><use>cull-face</use></cull-face>
<program>
<vertex-shader>Shaders/HDR/geometry-chrome.vert</vertex-shader>
<fragment-shader>Shaders/HDR/geometry-chrome.frag</fragment-shader>
<fragment-shader>Shaders/HDR/gbuffer-include.frag</fragment-shader>
</program>
</pass>
</technique>
</PropertyList>

View file

@ -0,0 +1,16 @@
#version 330 core
layout(location = 0) out vec4 gbuffer0;
layout(location = 1) out vec2 gbuffer1;
layout(location = 2) out vec4 gbuffer2;
in vec3 normalVS;
vec2 encodeNormal(vec3 n);
void main()
{
gbuffer0 = vec4(1.0);
gbuffer1 = encodeNormal(normalVS);
gbuffer2 = vec4(1.0, 0.1, 0.0, 0.0);
}

View file

@ -0,0 +1,15 @@
#version 330 core
layout(location = 0) in vec4 pos;
layout(location = 1) in vec3 normal;
out vec3 normalVS;
uniform mat4 osg_ModelViewProjectionMatrix;
uniform mat3 osg_NormalMatrix;
void main()
{
gl_Position = osg_ModelViewProjectionMatrix * pos;
normalVS = normalize(osg_NormalMatrix * normal);
}