Last active
September 23, 2018 13:26
-
-
Save Bananaft/461c78495a2878cb132676ccab9535a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Uniforms.glsl" | |
#include "Samplers.glsl" | |
#include "Transform.glsl" | |
#include "ScreenPos.glsl" | |
varying vec2 vScreenPos; | |
uniform float cBlurness; | |
void VS() | |
{ | |
mat4 modelMatrix = iModelMatrix; | |
vec3 worldPos = GetWorldPos(modelMatrix); | |
gl_Position = GetClipPos(worldPos); | |
vScreenPos = GetScreenPosPreDiv(gl_Position); | |
} | |
void PS() | |
{ | |
vec4 viewport = texture2D(sDiffMap, vScreenPos); | |
vec4 prevFrame = texture2D(sSpecMap, vScreenPos); | |
vec4 Col = viewport*(1.-cBlurness) + prevFrame * cBlurness; | |
gl_FragColor = Col; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<renderpath> | |
<rendertarget name="copyframe" sizedivisor="1 1" tag="Blur" format="rgba"/> | |
<command type="quad" tag="Blur" vs="copyblur" ps="copyblur"> | |
<texture unit="diffuse" name="viewport" /> | |
<texture unit="specular" name="copyframe" /> | |
<output index="0" name="viewport" /> | |
<output index="1" name="copyframe" /> | |
<parameter name="Blurness" value="0.7" /> | |
</command> | |
</renderpath> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment