Output debugger - Use built-in shaders
This commit is contained in:
parent
8e73f81ecd
commit
d846fac3f6
11 changed files with 96 additions and 33 deletions
15
toolshaders/copy.glsl
Normal file
15
toolshaders/copy.glsl
Normal file
|
@ -0,0 +1,15 @@
|
|||
#version 450 core
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_InputTexture;
|
||||
layout( location = 1 ) uniform int u_LOD;
|
||||
layout( location = 2 ) uniform vec2 u_OutputSize;
|
||||
|
||||
layout( location = 0 ) out vec4 o_Color;
|
||||
|
||||
void main( void )
|
||||
{
|
||||
vec2 ts = textureSize( u_InputTexture , u_LOD );
|
||||
ivec2 pos = ivec2( ts * gl_FragCoord.xy / u_OutputSize );
|
||||
o_Color = vec4( texelFetch( u_InputTexture , pos , u_LOD ).rgb , 1 );
|
||||
}
|
||||
|
16
toolshaders/dbg-alpha.glsl
Normal file
16
toolshaders/dbg-alpha.glsl
Normal file
|
@ -0,0 +1,16 @@
|
|||
#version 450 core
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_InputTexture;
|
||||
layout( location = 1 ) uniform int u_LOD;
|
||||
layout( location = 2 ) uniform vec2 u_OutputSize;
|
||||
|
||||
layout( location = 0 ) out vec4 o_Color;
|
||||
|
||||
void main( void )
|
||||
{
|
||||
vec2 ts = textureSize( u_InputTexture , u_LOD );
|
||||
ivec2 pos = ivec2( ts * gl_FragCoord.xy / u_OutputSize );
|
||||
o_Color = vec4( vec3( texelFetch( u_InputTexture , pos , u_LOD ).a ) ,
|
||||
1 );
|
||||
}
|
||||
|
18
toolshaders/dbg-depth-linear.glsl
Normal file
18
toolshaders/dbg-depth-linear.glsl
Normal file
|
@ -0,0 +1,18 @@
|
|||
#version 450 core
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_InputTexture;
|
||||
layout( location = 1 ) uniform int u_LOD;
|
||||
layout( location = 2 ) uniform vec2 u_OutputSize;
|
||||
layout( location = 3 ) uniform float u_Factor;
|
||||
|
||||
layout( location = 0 ) out vec4 o_Color;
|
||||
|
||||
void main( void )
|
||||
{
|
||||
vec2 ts = textureSize( u_InputTexture , u_LOD );
|
||||
ivec2 pos = ivec2( ts * gl_FragCoord.xy / u_OutputSize );
|
||||
float depth = texelFetch( u_InputTexture , pos , u_LOD ).x
|
||||
* u_Factor;
|
||||
o_Color = vec4( vec3( depth ) , 1 );
|
||||
}
|
||||
|
16
toolshaders/dbg-depth-reinhard.glsl
Normal file
16
toolshaders/dbg-depth-reinhard.glsl
Normal file
|
@ -0,0 +1,16 @@
|
|||
#version 450 core
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_InputTexture;
|
||||
layout( location = 1 ) uniform int u_LOD;
|
||||
layout( location = 2 ) uniform vec2 u_OutputSize;
|
||||
|
||||
layout( location = 0 ) out vec4 o_Color;
|
||||
|
||||
void main( void )
|
||||
{
|
||||
vec2 ts = textureSize( u_InputTexture , u_LOD );
|
||||
ivec2 pos = ivec2( ts * gl_FragCoord.xy / u_OutputSize );
|
||||
vec3 c = vec3( texelFetch( u_InputTexture , pos , u_LOD ).r );
|
||||
o_Color = vec4( 1 - c / ( c + 1 ) , 1 );
|
||||
}
|
||||
|
16
toolshaders/dbg-reinhard.glsl
Normal file
16
toolshaders/dbg-reinhard.glsl
Normal file
|
@ -0,0 +1,16 @@
|
|||
#version 450 core
|
||||
|
||||
layout( location = 0 ) uniform sampler2D u_InputTexture;
|
||||
layout( location = 1 ) uniform int u_LOD;
|
||||
layout( location = 2 ) uniform vec2 u_OutputSize;
|
||||
|
||||
layout( location = 0 ) out vec4 o_Color;
|
||||
|
||||
void main( void )
|
||||
{
|
||||
vec2 ts = textureSize( u_InputTexture , u_LOD );
|
||||
ivec2 pos = ivec2( ts * gl_FragCoord.xy / u_OutputSize );
|
||||
vec3 c = texelFetch( u_InputTexture , pos , u_LOD ).rgb;
|
||||
o_Color = vec4( c / ( c + 1 ) , 1 );
|
||||
}
|
||||
|
2
toolshaders/fullscreen.glsl
Normal file
2
toolshaders/fullscreen.glsl
Normal file
|
@ -0,0 +1,2 @@
|
|||
#version 450 core
|
||||
out gl_PerVertex{vec4 gl_Position;}; void main(){gl_Position=vec4(vec2(gl_VertexID>>1,gl_VertexID&1)*2-1,0,1);}
|
Loading…
Add table
Add a link
Reference in a new issue