Blender Git Loki
Git Commits -> Revision e91df65
Revision e91df65 by Clément Foucault (eevee-rewrite, temp-eevee-gpencil-rewrite, viewport-compositor) May 22, 2021, 22:39 (GMT) |
EEVEE: Material: Use weight to random sample closure per types This adds a new closure selection method. - In a first pass, weights are accumulated per output type (diffuse, reflection, refraction). - A random threshold is then generated before evaluating the BSDF nodes again. - During the evaluation pass the random threshold is decremented until it reaches 0. At this moment the current BSDF is sampled. For this to work, I splited the evaluation and the weighting in two functions for all BSDF. The `*_eval` nodes are generated as dangling nodes from the graph and only serialized after the rest of the graph. |
Commit Details:
Full Hash: e91df656f5bc2ec9c80915fd029127920172733d
Parent Commit: 10cf162
Lines Changed: +542, -178
34 Modified Paths:
/source/blender/draw/engines/eevee/eevee_sampling.hh (+1, -0) (Diff)
/source/blender/draw/engines/eevee/eevee_shader_shared.hh (+3, -2) (Diff)
/source/blender/draw/engines/eevee/eevee_shading.cc (+1, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_closure_lib.glsl (+66, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_nodetree_eval_lib.glsl (+27, -18) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl (+9, -1) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_forward_frag.glsl (+0, -2) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_lib.glsl (+1, -0) (Diff)
/source/blender/gpu/GPU_material.h (+10, -0) (Diff)
/source/blender/gpu/intern/gpu_codegen.cc (+77, -60) (Diff)
/source/blender/gpu/intern/gpu_material.c (+10, -0) (Diff)
/source/blender/gpu/intern/gpu_node_graph.c (+56, -9) (Diff)
/source/blender/gpu/intern/gpu_node_graph.h (+9, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl (+10, -2) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_diffuse.glsl (+9, -2) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl (+29, -9) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_glossy.glsl (+11, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl (+83, -32) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_refraction.glsl (+13, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_subsurface_scattering.glsl (+17, -3) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_toon.glsl (+11, -2) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_translucent.glsl (+10, -3) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_velvet.glsl (+9, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c (+6, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c (+20, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c (+3, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c (+27, -13) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c (+2, -1) (Diff)
/source/blender/draw/engines/eevee/eevee_shader_shared.hh (+3, -2) (Diff)
/source/blender/draw/engines/eevee/eevee_shading.cc (+1, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_closure_lib.glsl (+66, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_nodetree_eval_lib.glsl (+27, -18) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_deferred_frag.glsl (+9, -1) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_forward_frag.glsl (+0, -2) (Diff)
/source/blender/draw/engines/eevee/shaders/eevee_surface_lib.glsl (+1, -0) (Diff)
/source/blender/gpu/GPU_material.h (+10, -0) (Diff)
/source/blender/gpu/intern/gpu_codegen.cc (+77, -60) (Diff)
/source/blender/gpu/intern/gpu_material.c (+10, -0) (Diff)
/source/blender/gpu/intern/gpu_node_graph.c (+56, -9) (Diff)
/source/blender/gpu/intern/gpu_node_graph.h (+9, -0) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl (+10, -2) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_diffuse.glsl (+9, -2) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_glass.glsl (+29, -9) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_glossy.glsl (+11, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_principled.glsl (+83, -32) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_refraction.glsl (+13, -4) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_subsurface_scattering.glsl (+17, -3) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_toon.glsl (+11, -2) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_translucent.glsl (+10, -3) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_velvet.glsl (+9, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_anisotropic.c (+6, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.c (+20, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.c (+3, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.c (+27, -13) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_toon.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_translucent.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_bsdf_velvet.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_eevee_specular.c (+2, -1) (Diff)
/source/blender/nodes/shader/nodes/node_shader_subsurface_scattering.c (+2, -1) (Diff)