HDR: Port chrome.eff
This commit is contained in:
parent
356ff8ff34
commit
55410e9d35
3 changed files with 56 additions and 0 deletions
|
@ -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>
|
||||
|
|
16
Shaders/HDR/geometry-chrome.frag
Normal file
16
Shaders/HDR/geometry-chrome.frag
Normal 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);
|
||||
}
|
15
Shaders/HDR/geometry-chrome.vert
Normal file
15
Shaders/HDR/geometry-chrome.vert
Normal 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);
|
||||
}
|
Loading…
Add table
Reference in a new issue