Differential D10414 Diff 33970 source/blender/draw/engines/workbench/shaders/workbench_effect_smaa_frag.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/workbench/shaders/workbench_effect_smaa_frag.glsl
| uniform sampler2D edgesTex; | uniform sampler2D edgesTex; | ||||
| uniform sampler2D areaTex; | uniform sampler2D areaTex; | ||||
| uniform sampler2D searchTex; | uniform sampler2D searchTex; | ||||
| uniform sampler2D blendTex; | uniform sampler2D blendTex; | ||||
| uniform sampler2D colorTex; | uniform sampler2D colorTex; | ||||
| uniform float mixFactor; | uniform float mixFactor; | ||||
| uniform float taaSampleCountInv; | uniform float taaAccumulatedWeight; | ||||
| in vec2 uvs; | in vec2 uvs; | ||||
| in vec2 pixcoord; | in vec2 pixcoord; | ||||
| in vec4 offset[3]; | in vec4 offset[3]; | ||||
| #if SMAA_STAGE == 0 | #if SMAA_STAGE == 0 | ||||
| out vec2 fragColor; | out vec2 fragColor; | ||||
| #else | #else | ||||
| Show All 17 Lines | |||||
| #elif SMAA_STAGE == 2 | #elif SMAA_STAGE == 2 | ||||
| fragColor = vec4(0.0); | fragColor = vec4(0.0); | ||||
| if (mixFactor > 0.0) { | if (mixFactor > 0.0) { | ||||
| fragColor += SMAANeighborhoodBlendingPS(uvs, offset[0], colorTex, blendTex) * mixFactor; | fragColor += SMAANeighborhoodBlendingPS(uvs, offset[0], colorTex, blendTex) * mixFactor; | ||||
| } | } | ||||
| if (mixFactor < 1.0) { | if (mixFactor < 1.0) { | ||||
| fragColor += texture(colorTex, uvs) * (1.0 - mixFactor); | fragColor += texture(colorTex, uvs) * (1.0 - mixFactor); | ||||
| } | } | ||||
| fragColor *= taaSampleCountInv; | fragColor /= taaAccumulatedWeight; | ||||
| fragColor = exp2(fragColor) - 0.5; | |||||
| /* Avoid float precision issue. */ | |||||
| if (fragColor.a > 0.999) { | |||||
| fragColor.a = 1.0; | |||||
| } | |||||
| #endif | #endif | ||||
| } | } | ||||