[Bf-blender-cvs] [41cc2ae6263] blender2.8: Merge branch 'master' into blender2.8
Brecht Van Lommel
noreply at git.blender.org
Tue Jan 23 13:24:24 CET 2018
Commit: 41cc2ae62639bc6c8480beef86269c5b7fbd11fa
Author: Brecht Van Lommel
Date: Tue Jan 23 13:11:02 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB41cc2ae62639bc6c8480beef86269c5b7fbd11fa
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc intern/cycles/blender/addon/version_update.py
index efd794461d6,26cdecd2d52..2075bdba8c5
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@@ -315,3 -356,6 +356,6 @@@ def do_versions(self)
cscene.blur_glossy = 0.0
if not cscene.is_property_set("sample_clamp_indirect"):
cscene.sample_clamp_indirect = 0.0
+
- if bpy.data.version <= (2, 79, 1):
++ if bpy.data.version <= (2, 80, 3):
+ displacement_nodes_insert()
diff --cc source/blender/blenkernel/BKE_blender_version.h
index 27223afe4ff,c99da724794..ceb466ebdcd
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@@ -27,8 -27,8 +27,8 @@@
/* these lines are grep'd, watch out for our not-so-awesome regex
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
-#define BLENDER_VERSION 279
-#define BLENDER_SUBVERSION 2
+#define BLENDER_VERSION 280
- #define BLENDER_SUBVERSION 3
++#define BLENDER_SUBVERSION 4
/* Several breakages with 270, e.g. constraint deg vs rad */
#define BLENDER_MINVERSION 270
#define BLENDER_MINSUBVERSION 6
diff --cc source/blender/blenkernel/BKE_node.h
index 5eec50019a9,854a3e64acc..4e30cb076d4
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -798,8 -789,8 +798,9 @@@ struct ShadeResult
#define SH_NODE_UVALONGSTROKE 191
#define SH_NODE_TEX_POINTDENSITY 192
#define SH_NODE_BSDF_PRINCIPLED 193
+#define SH_NODE_EEVEE_SPECULAR 195
#define SH_NODE_BEVEL 197
+ #define SH_NODE_DISPLACEMENT 198
/* custom defines options for Material node */
#define SH_NODE_MAT_DIFF 1
diff --cc source/blender/gpu/shaders/gpu_shader_material.glsl
index 07c3b1e782b,b54bd213b74..780f4f59fb9
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@@ -4135,63 -3816,23 +4135,68 @@@ void node_bevel(float radius, vec3 N, o
result = N;
}
+ void node_displacement(float height, float dist, vec3 N, out vec3 result)
+ {
+ result = height * dist * N;
+ }
+
/* output */
- void node_output_material(Closure surface, Closure volume, float displacement, out Closure result)
-void node_output_material(vec4 surface, vec4 volume, vec3 displacement, out vec4 result)
++void node_output_material(Closure surface, Closure volume, vec3 displacement, out Closure result)
{
+#ifdef VOLUMETRICS
+ result = volume;
+#else
result = surface;
+#endif
}
-void node_output_world(vec4 surface, vec4 volume, out vec4 result)
+uniform float backgroundAlpha;
+
+void node_output_world(Closure surface, Closure volume, out Closure result)
{
- result = surface;
+#ifndef VOLUMETRICS
+#ifdef EEVEE_ENGINE
+ result.radiance = surface.radiance;
+ result.opacity = backgroundAlpha;
+#else
+ result = Closure(surface.radiance, backgroundAlpha);
+#endif
+#else
+ result = volume;
+#endif /* VOLUMETRICS */
+}
+
+#ifndef VOLUMETRICS
+/* TODO : clean this ifdef mess */
+/* EEVEE output */
+#ifdef EEVEE_ENGINE
+void world_normals_get(out vec3 N)
+{
+ N = gl_FrontFacing ? worldNormal : -worldNormal;
+}
+
+void node_eevee_specular(
+ vec4 diffuse, vec4 specular, float roughness, vec4 emissive, float transp, vec3 normal,
+ float clearcoat, float clearcoat_roughness, vec3 clearcoat_normal,
+ float occlusion, float ssr_id, out Closure result)
+{
+ vec3 out_diff, out_spec, ssr_spec;
+ eevee_closure_default(normal, diffuse.rgb, specular.rgb, int(ssr_id), roughness, occlusion,
+ out_diff, out_spec, ssr_spec);
+
+ vec3 vN = normalize(mat3(ViewMatrix) * normal);
+ result = CLOSURE_DEFAULT;
+ result.radiance = out_diff * diffuse.rgb + out_spec + emissive.rgb;
+ result.opacity = 1.0 - transp;
+ result.ssr_data = vec4(ssr_spec, roughness);
+ result.ssr_normal = normal_encode(vN, viewCameraVec);
+ result.ssr_id = int(ssr_id);
}
+#endif /* EEVEE_ENGINE */
+#endif /* VOLUMETRICS */
+
/* ********************** matcap style render ******************** */
void material_preview_matcap(vec4 color, sampler2D ima, vec4 N, vec4 mask, out vec4 result)
diff --cc source/blender/nodes/shader/nodes/node_shader_displacement.c
index 0418b039337,bcd11b758f8..d5c191b3966
--- a/source/blender/nodes/shader/nodes/node_shader_displacement.c
+++ b/source/blender/nodes/shader/nodes/node_shader_displacement.c
@@@ -38,19 -36,22 +36,22 @@@ static bNodeSocketTemplate sh_node_disp
{ -1, 0, "" }
};
- static int node_shader_gpu_output_material(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
- {
- GPUNodeLink *outlink;
+ static bNodeSocketTemplate sh_node_displacement_out[] = {
+ { SOCK_VECTOR, 0, N_("Displacement"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { -1, 0, "" }
+ };
- GPU_stack_link(mat, node, "node_output_material", in, out, &outlink);
- GPU_material_output_link(mat, outlink);
-static int gpu_shader_displacement(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
++static int gpu_shader_displacement(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
+ {
+ if (!in[2].link) {
+ GPU_link(mat, "direction_transform_m4v3", GPU_builtin(GPU_VIEW_NORMAL), GPU_builtin(GPU_INVERSE_VIEW_MATRIX), &in[2].link);
+ }
- return true;
- return GPU_stack_link(mat, "node_displacement", in, out);
++ return GPU_stack_link(mat, node, "node_displacement", in, out);
}
-
/* node type definition */
- void register_node_type_sh_output_material(void)
+ void register_node_type_sh_displacement(void)
{
static bNodeType ntype;
More information about the Bf-blender-cvs
mailing list