diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-02 17:58:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-02 17:58:07 +0300 |
commit | b18c2a3c413b7741b2a854b7bd25721352be2589 (patch) | |
tree | 7dbdc9556a5eb4ff8f4d52afae01a9d3c47f7951 /source/blender/nodes | |
parent | b82cb0ad3241ead3faee699847bc3e0065e304cd (diff) |
EEVEE: Refactor of eevee_material.c
These are the modifications:
-With DRW modification we reduce the number of passes we need to populate.
-Rename passes for consistent naming.
-Reduce complexity in code compilation
-Cleanup how renderpass accumulation passes are setup, using pass instances.
-Make sculpt mode compatible with shadows
-Make hair passes compatible with SSS
-Error shader and lookdev materials now use standalone materials.
-Support default shader (world and material) using a default nodetree internally.
-Change BLEND_CLIP to be emulated by gpu nodetree. Making less shader variations.
-Use BLI_memblock for cache memory allocation.
-Renderpasses are handled by switching a UBO ref bind.
One major hack in this patch is the use of modified pointer as ghash keys.
This rely on the assumption that the keys will never overlap because the
number of options per key will never be bigger than the pointed struct.
The use of one single nodetree to support default material is also a bit hacky
since it won't support concurent usage of this nodetree.
(see EEVEE_shader_default_surface_nodetree)
Another change is that objects with shader errors now appear solid magenta instead
of shaded magenta. This is only because of code reuse purpose but could be changed
if really needed.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D7642
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_output_material.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_material.c b/source/blender/nodes/shader/nodes/node_shader_output_material.c index 4b7bd964052..578262e9f17 100644 --- a/source/blender/nodes/shader/nodes/node_shader_output_material.c +++ b/source/blender/nodes/shader/nodes/node_shader_output_material.c @@ -45,9 +45,18 @@ static int node_shader_gpu_output_material(GPUMaterial *mat, GPUNodeStack *in, GPUNodeStack *out) { - GPUNodeLink *outlink; + GPUNodeLink *outlink, *alpha_threshold_link; - GPU_stack_link(mat, node, "node_output_material", in, out, &outlink); + Material *ma = GPU_material_get_material(mat); + if (ma && ma->blend_method == MA_BM_CLIP) { + alpha_threshold_link = GPU_uniform(&ma->alpha_threshold); + } + else { + static float no_alpha_threshold = -1.0f; + alpha_threshold_link = GPU_uniform(&no_alpha_threshold); + } + + GPU_stack_link(mat, node, "node_output_material", in, out, alpha_threshold_link, &outlink); GPU_material_output_link(mat, outlink); return true; |