Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-11-08 18:47:33 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-11-28 11:12:28 +0300
commit320d8ab1556f1bc76cd9f654476250aebdec101e (patch)
treec627f82f76ddc6286ad21b98d54eb4a81cf51b63 /source/blender/draw/engines/eevee/shaders
parentffcf39e3b5dbe7f12d04a350c629055ad21d40ce (diff)
EEVEE: Viewport Renderpasses
This patch will allow the user to select the EEVEE renderpass to be shown in the viewport by default the combined pass will be shown. Limitations: * Viewport rendering stores the result in a `RenderResult`. RenderResult is not aware of the type of data it holds. In many places where RenderResult is used it is assumed that it stores a combined pass and the display+view transform are applied. I will propose to fix this in a future patch. But that is still being designed and discussed. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6319
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders')
-rw-r--r--source/blender/draw/engines/eevee/shaders/renderpass_postprocess_frag.glsl11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/renderpass_postprocess_frag.glsl b/source/blender/draw/engines/eevee/shaders/renderpass_postprocess_frag.glsl
index 8a543f13fbc..5a738d0f130 100644
--- a/source/blender/draw/engines/eevee/shaders/renderpass_postprocess_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/renderpass_postprocess_frag.glsl
@@ -34,27 +34,28 @@ void main()
}
else if (renderpassType == SCE_PASS_NORMAL) {
+ float depth = texelFetch(depthBuffer, texel, 0).r;
vec2 encoded_normal = texelFetch(inputBuffer, texel, 0).rg;
/* decode the normals only when they are valid. otherwise the result buffer will be filled with
* NaN's */
- if (any(notEqual(encoded_normal, vec2(0.0)))) {
+ if (depth != 1.0 && any(notEqual(encoded_normal, vec2(0.0)))) {
vec3 decoded_normal = normal_decode(texelFetch(inputBuffer, texel, 0).rg, vec3(0.0));
vec3 world_normal = mat3(ViewMatrixInverse) * decoded_normal;
- fragColor = vec4(world_normal, 0.0);
+ fragColor = vec4(world_normal, 1.0);
}
else {
- fragColor = vec4(0.0);
+ fragColor = vec4(0.0, 0.0, 0.0, 1.0);
}
}
else if ((renderpassType & ACCUMULATED_VALUE_PASSES) != 0) {
float accumulated_value = texelFetch(inputBuffer, texel, 0).r;
- fragColor.r = accumulated_value / currentSample;
+ fragColor = vec4(vec3(accumulated_value / currentSample), 1.0);
}
else if ((renderpassType & ACCUMULATED_COLOR_PASSES) != 0) {
vec3 accumulated_color = texelFetch(inputBuffer, texel, 0).rgb;
- fragColor.rgb = accumulated_color / currentSample;
+ fragColor = vec4(accumulated_color / currentSample, 1.0);
}
else {