forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
@ -0,0 +1,32 @@
|
||||
// Exclusive to SSR for now
|
||||
#version 450
|
||||
|
||||
#include "compiled.inc"
|
||||
#include "std/gbuffer.glsl"
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D gbuffer0; // Roughness
|
||||
|
||||
uniform vec2 dirInv;
|
||||
|
||||
in vec2 texCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
float roughness = textureLod(gbuffer0, texCoord, 0.0).b;
|
||||
// if (roughness == 0.0) { // Always blur for now, non blured output can produce noise
|
||||
// fragColor.rgb = textureLod(tex, texCoord).rgb;
|
||||
// return;
|
||||
// }
|
||||
if (roughness >= 0.8) { // No reflections
|
||||
fragColor.rgb = textureLod(tex, texCoord, 0.0).rgb;
|
||||
return;
|
||||
}
|
||||
|
||||
fragColor.rgb = textureLod(tex, texCoord + dirInv * 2.5, 0.0).rgb;
|
||||
fragColor.rgb += textureLod(tex, texCoord + dirInv * 1.5, 0.0).rgb;
|
||||
fragColor.rgb += textureLod(tex, texCoord, 0.0).rgb;
|
||||
fragColor.rgb += textureLod(tex, texCoord - dirInv * 1.5, 0.0).rgb;
|
||||
fragColor.rgb += textureLod(tex, texCoord - dirInv * 2.5, 0.0).rgb;
|
||||
fragColor.rgb /= vec3(5.0);
|
||||
}
|
84
leenkx/Shaders/blur_adaptive_pass/blur_adaptive_pass.json
Normal file
84
leenkx/Shaders/blur_adaptive_pass/blur_adaptive_pass.json
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"contexts": [
|
||||
{
|
||||
"name": "blur_adaptive_pass_x",
|
||||
"depth_write": false,
|
||||
"compare_mode": "always",
|
||||
"cull_mode": "none",
|
||||
"links": [
|
||||
{
|
||||
"name": "dirInv",
|
||||
"link": "_vec2xInv"
|
||||
}
|
||||
],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "../include/pass.vert.glsl",
|
||||
"fragment_shader": "blur_adaptive_pass.frag.glsl"
|
||||
},
|
||||
{
|
||||
"name": "blur_adaptive_pass_y",
|
||||
"depth_write": false,
|
||||
"compare_mode": "always",
|
||||
"cull_mode": "none",
|
||||
"links": [
|
||||
{
|
||||
"name": "dirInv",
|
||||
"link": "_vec2yInv"
|
||||
}
|
||||
],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "../include/pass.vert.glsl",
|
||||
"fragment_shader": "blur_adaptive_pass.frag.glsl"
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"name": "blur_adaptive_pass_x2",
|
||||
"depth_write": false,
|
||||
"compare_mode": "always",
|
||||
"cull_mode": "none",
|
||||
"links": [
|
||||
{
|
||||
"name": "dirInv",
|
||||
"link": "_vec2x2Inv"
|
||||
}
|
||||
],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "../include/pass.vert.glsl",
|
||||
"fragment_shader": "blur_adaptive_pass.frag.glsl"
|
||||
},
|
||||
{
|
||||
"name": "blur_adaptive_pass_y3",
|
||||
"depth_write": false,
|
||||
"compare_mode": "always",
|
||||
"cull_mode": "none",
|
||||
"links": [
|
||||
{
|
||||
"name": "dirInv",
|
||||
"link": "_vec2y3Inv"
|
||||
}
|
||||
],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "../include/pass.vert.glsl",
|
||||
"fragment_shader": "blur_adaptive_pass.frag.glsl"
|
||||
},
|
||||
{
|
||||
"name": "blur_adaptive_pass_y3_blend",
|
||||
"depth_write": false,
|
||||
"compare_mode": "always",
|
||||
"cull_mode": "none",
|
||||
"blend_source": "blend_one",
|
||||
"blend_destination": "blend_one",
|
||||
"blend_operation": "add",
|
||||
"links": [
|
||||
{
|
||||
"name": "dirInv",
|
||||
"link": "_vec2y3Inv"
|
||||
}
|
||||
],
|
||||
"texture_params": [],
|
||||
"vertex_shader": "../include/pass.vert.glsl",
|
||||
"fragment_shader": "blur_adaptive_pass.frag.glsl"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user