Merge branch 'master' into blender2.8
This commit is contained in:
commit
93e0e716f3
|
@ -565,6 +565,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||
('SHADOW', "Shadow", ""),
|
||||
('NORMAL', "Normal", ""),
|
||||
('UV', "UV", ""),
|
||||
('ROUGHNESS', "Roughness", ""),
|
||||
('EMIT', "Emit", ""),
|
||||
('ENVIRONMENT', "Environment", ""),
|
||||
('DIFFUSE', "Diffuse", ""),
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
import math
|
||||
|
||||
from bpy.app.handlers import persistent
|
||||
|
||||
|
@ -138,6 +139,56 @@ def displacement_principled_nodes(node):
|
|||
if node.subsurface_method != 'RANDOM_WALK':
|
||||
node.subsurface_method = 'BURLEY'
|
||||
|
||||
def square_roughness_node_insert(material, nodetree, traversed):
|
||||
if nodetree in traversed:
|
||||
return
|
||||
traversed.add(nodetree)
|
||||
|
||||
roughness_node_types = {
|
||||
'ShaderNodeBsdfAnisotropic',
|
||||
'ShaderNodeBsdfGlass',
|
||||
'ShaderNodeBsdfGlossy',
|
||||
'ShaderNodeBsdfRefraction'}
|
||||
|
||||
# Update default values
|
||||
for node in nodetree.nodes:
|
||||
if node.bl_idname == 'ShaderNodeGroup':
|
||||
square_roughness_node_insert(material, node.node_tree, traversed)
|
||||
elif node.bl_idname in roughness_node_types:
|
||||
roughness_input = node.inputs['Roughness']
|
||||
roughness_input.default_value = math.sqrt(max(roughness_input.default_value, 0.0))
|
||||
|
||||
# Gather roughness links to replace
|
||||
roughness_links = []
|
||||
for link in nodetree.links:
|
||||
if link.to_node.bl_idname in roughness_node_types and \
|
||||
link.to_socket.identifier == 'Roughness':
|
||||
roughness_links.append(link)
|
||||
|
||||
# Replace links with sqrt node
|
||||
for link in roughness_links:
|
||||
from_node = link.from_node
|
||||
from_socket = link.from_socket
|
||||
to_node = link.to_node
|
||||
to_socket = link.to_socket
|
||||
|
||||
nodetree.links.remove(link)
|
||||
|
||||
node = nodetree.nodes.new(type='ShaderNodeMath')
|
||||
node.operation = 'POWER'
|
||||
node.location[0] = 0.5 * (from_node.location[0] + to_node.location[0]);
|
||||
node.location[1] = 0.5 * (from_node.location[1] + to_node.location[1]);
|
||||
|
||||
nodetree.links.new(from_socket, node.inputs[0])
|
||||
node.inputs[1].default_value = 0.5
|
||||
nodetree.links.new(node.outputs['Value'], to_socket)
|
||||
|
||||
def square_roughness_nodes_insert():
|
||||
traversed = set()
|
||||
for material in bpy.data.materials:
|
||||
if check_is_new_shading_material(material):
|
||||
square_roughness_node_insert(material, material.node_tree, traversed)
|
||||
|
||||
|
||||
def mapping_node_order_flip(node):
|
||||
"""
|
||||
|
@ -377,3 +428,8 @@ def do_versions(self):
|
|||
cmat.displacement_method = 'BUMP'
|
||||
|
||||
foreach_cycles_node(displacement_principled_nodes)
|
||||
|
||||
if bpy.data.version <= (2, 79, 3) or \
|
||||
(bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 4)):
|
||||
# Switch to squared roughness convention
|
||||
square_roughness_nodes_insert()
|
||||
|
|
|
@ -241,6 +241,8 @@ static ShaderEvalType get_shader_type(const string& pass_type)
|
|||
return SHADER_EVAL_NORMAL;
|
||||
else if(strcmp(shader_type, "UV")==0)
|
||||
return SHADER_EVAL_UV;
|
||||
else if(strcmp(shader_type, "ROUGHNESS")==0)
|
||||
return SHADER_EVAL_ROUGHNESS;
|
||||
else if(strcmp(shader_type, "DIFFUSE_COLOR")==0)
|
||||
return SHADER_EVAL_DIFFUSE_COLOR;
|
||||
else if(strcmp(shader_type, "GLOSSY_COLOR")==0)
|
||||
|
|
|
@ -330,15 +330,30 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
|
|||
switch(type) {
|
||||
/* data passes */
|
||||
case SHADER_EVAL_NORMAL:
|
||||
case SHADER_EVAL_ROUGHNESS:
|
||||
case SHADER_EVAL_EMISSION:
|
||||
{
|
||||
float3 N = sd.N;
|
||||
if((sd.flag & SD_HAS_BUMP)) {
|
||||
shader_eval_surface(kg, &sd, &state, 0);
|
||||
N = shader_bsdf_average_normal(kg, &sd);
|
||||
if(type != SHADER_EVAL_NORMAL || (sd.flag & SD_HAS_BUMP)) {
|
||||
int path_flag = (type == SHADER_EVAL_EMISSION) ? PATH_RAY_EMISSION : 0;
|
||||
shader_eval_surface(kg, &sd, &state, path_flag);
|
||||
}
|
||||
|
||||
/* encoding: normal = (2 * color) - 1 */
|
||||
out = N * 0.5f + make_float3(0.5f, 0.5f, 0.5f);
|
||||
if(type == SHADER_EVAL_NORMAL) {
|
||||
float3 N = sd.N;
|
||||
if(sd.flag & SD_HAS_BUMP) {
|
||||
N = shader_bsdf_average_normal(kg, &sd);
|
||||
}
|
||||
|
||||
/* encoding: normal = (2 * color) - 1 */
|
||||
out = N * 0.5f + make_float3(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
else if(type == SHADER_EVAL_ROUGHNESS) {
|
||||
float roughness = shader_bsdf_average_roughness(&sd);
|
||||
out = make_float3(roughness, roughness, roughness);
|
||||
}
|
||||
else {
|
||||
out = shader_emissive_eval(kg, &sd);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SHADER_EVAL_UV:
|
||||
|
@ -346,13 +361,6 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
|
|||
out = primitive_uv(kg, &sd);
|
||||
break;
|
||||
}
|
||||
case SHADER_EVAL_EMISSION:
|
||||
{
|
||||
shader_eval_surface(kg, &sd, &state, PATH_RAY_EMISSION);
|
||||
out = shader_emissive_eval(kg, &sd);
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef __PASSES__
|
||||
/* light passes */
|
||||
case SHADER_EVAL_AO:
|
||||
|
|
|
@ -763,6 +763,26 @@ ccl_device int shader_bsdf_sample_closure(KernelGlobals *kg, ShaderData *sd,
|
|||
return label;
|
||||
}
|
||||
|
||||
ccl_device float shader_bsdf_average_roughness(ShaderData *sd)
|
||||
{
|
||||
float roughness = 0.0f;
|
||||
float sum_weight = 0.0f;
|
||||
|
||||
for(int i = 0; i < sd->num_closure; i++) {
|
||||
ShaderClosure *sc = &sd->closure[i];
|
||||
|
||||
if(CLOSURE_IS_BSDF(sc->type)) {
|
||||
/* sqrt once to undo the squaring from multiplying roughness on the
|
||||
* two axes, and once for the squared roughness convention. */
|
||||
float weight = fabsf(average(sc->weight));
|
||||
roughness += weight * sqrtf(safe_sqrtf(bsdf_get_roughness_squared(sc)));
|
||||
sum_weight += weight;
|
||||
}
|
||||
}
|
||||
|
||||
return (sum_weight > 0.0f) ? roughness / sum_weight : 0.0f;
|
||||
}
|
||||
|
||||
ccl_device void shader_bsdf_blur(KernelGlobals *kg, ShaderData *sd, float roughness)
|
||||
{
|
||||
for(int i = 0; i < sd->num_closure; i++) {
|
||||
|
@ -875,7 +895,7 @@ ccl_device float3 shader_bsdf_average_normal(KernelGlobals *kg, ShaderData *sd)
|
|||
for(int i = 0; i < sd->num_closure; i++) {
|
||||
ShaderClosure *sc = &sd->closure[i];
|
||||
if(CLOSURE_IS_BSDF_OR_BSSRDF(sc->type))
|
||||
N += sc->N*average(sc->weight);
|
||||
N += sc->N*fabsf(average(sc->weight));
|
||||
}
|
||||
|
||||
return (is_zero(N))? sd->N : normalize(N);
|
||||
|
@ -892,11 +912,11 @@ ccl_device float3 shader_bsdf_ao(KernelGlobals *kg, ShaderData *sd, float ao_fac
|
|||
if(CLOSURE_IS_BSDF_DIFFUSE(sc->type)) {
|
||||
const DiffuseBsdf *bsdf = (const DiffuseBsdf*)sc;
|
||||
eval += sc->weight*ao_factor;
|
||||
N += bsdf->N*average(sc->weight);
|
||||
N += bsdf->N*fabsf(average(sc->weight));
|
||||
}
|
||||
else if(CLOSURE_IS_AMBIENT_OCCLUSION(sc->type)) {
|
||||
eval += sc->weight;
|
||||
N += sd->N*average(sc->weight);
|
||||
N += sd->N*fabsf(average(sc->weight));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -263,6 +263,7 @@ typedef enum ShaderEvalType {
|
|||
/* data passes */
|
||||
SHADER_EVAL_NORMAL,
|
||||
SHADER_EVAL_UV,
|
||||
SHADER_EVAL_ROUGHNESS,
|
||||
SHADER_EVAL_DIFFUSE_COLOR,
|
||||
SHADER_EVAL_GLOSSY_COLOR,
|
||||
SHADER_EVAL_TRANSMISSION_COLOR,
|
||||
|
|
|
@ -33,27 +33,28 @@ shader node_anisotropic_bsdf(
|
|||
T = rotate(T, Rotation * M_2PI, point(0.0, 0.0, 0.0), Normal);
|
||||
|
||||
/* compute roughness */
|
||||
float RoughnessU, RoughnessV;
|
||||
float roughness = Roughness * Roughness;
|
||||
float roughness_u, roughness_v;
|
||||
float aniso = clamp(Anisotropy, -0.99, 0.99);
|
||||
|
||||
if (aniso < 0.0) {
|
||||
RoughnessU = Roughness / (1.0 + aniso);
|
||||
RoughnessV = Roughness * (1.0 + aniso);
|
||||
roughness_u = roughness / (1.0 + aniso);
|
||||
roughness_v = roughness * (1.0 + aniso);
|
||||
}
|
||||
else {
|
||||
RoughnessU = Roughness * (1.0 - aniso);
|
||||
RoughnessV = Roughness / (1.0 - aniso);
|
||||
roughness_u = roughness * (1.0 - aniso);
|
||||
roughness_v = roughness / (1.0 - aniso);
|
||||
}
|
||||
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * reflection(Normal);
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * microfacet_beckmann_aniso(Normal, T, RoughnessU, RoughnessV);
|
||||
BSDF = Color * microfacet_beckmann_aniso(Normal, T, roughness_u, roughness_v);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * microfacet_ggx_aniso(Normal, T, RoughnessU, RoughnessV);
|
||||
BSDF = Color * microfacet_ggx_aniso(Normal, T, roughness_u, roughness_v);
|
||||
else if (distribution == "Multiscatter GGX")
|
||||
BSDF = Color * microfacet_multi_ggx_aniso(Normal, T, RoughnessU, RoughnessV, Color);
|
||||
BSDF = Color * microfacet_multi_ggx_aniso(Normal, T, roughness_u, roughness_v, Color);
|
||||
else
|
||||
BSDF = Color * ashikhmin_shirley(Normal, T, RoughnessU, RoughnessV);
|
||||
BSDF = Color * ashikhmin_shirley(Normal, T, roughness_u, roughness_v);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,16 +29,17 @@ shader node_glass_bsdf(
|
|||
float eta = backfacing() ? 1.0 / f : f;
|
||||
float cosi = dot(I, Normal);
|
||||
float Fr = fresnel_dielectric_cos(cosi, eta);
|
||||
float roughness = Roughness * Roughness;
|
||||
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * (Fr * reflection(Normal) + (1.0 - Fr) * refraction(Normal, eta));
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * (Fr * microfacet_beckmann(Normal, Roughness) +
|
||||
(1.0 - Fr) * microfacet_beckmann_refraction(Normal, Roughness, eta));
|
||||
BSDF = Color * (Fr * microfacet_beckmann(Normal, roughness) +
|
||||
(1.0 - Fr) * microfacet_beckmann_refraction(Normal, roughness, eta));
|
||||
else if (distribution == "Multiscatter GGX")
|
||||
BSDF = Color * microfacet_multi_ggx_glass(Normal, Roughness, eta, Color);
|
||||
BSDF = Color * microfacet_multi_ggx_glass(Normal, roughness, eta, Color);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * (Fr * microfacet_ggx(Normal, Roughness) +
|
||||
(1.0 - Fr) * microfacet_ggx_refraction(Normal, Roughness, eta));
|
||||
BSDF = Color * (Fr * microfacet_ggx(Normal, roughness) +
|
||||
(1.0 - Fr) * microfacet_ggx_refraction(Normal, roughness, eta));
|
||||
}
|
||||
|
||||
|
|
|
@ -24,16 +24,18 @@ shader node_glossy_bsdf(
|
|||
normal Normal = N,
|
||||
output closure color BSDF = 0)
|
||||
{
|
||||
float roughness = Roughness * Roughness;
|
||||
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * reflection(Normal);
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * microfacet_beckmann(Normal, Roughness);
|
||||
BSDF = Color * microfacet_beckmann(Normal, roughness);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * microfacet_ggx(Normal, Roughness);
|
||||
BSDF = Color * microfacet_ggx(Normal, roughness);
|
||||
else if (distribution == "Multiscatter GGX")
|
||||
BSDF = Color * microfacet_multi_ggx(Normal, Roughness, Color);
|
||||
BSDF = Color * microfacet_multi_ggx(Normal, roughness, Color);
|
||||
else
|
||||
BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), Roughness, Roughness);
|
||||
BSDF = Color * ashikhmin_shirley(Normal, vector(0, 0, 0), roughness, roughness);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -26,12 +26,13 @@ shader node_refraction_bsdf(
|
|||
{
|
||||
float f = max(IOR, 1e-5);
|
||||
float eta = backfacing() ? 1.0 / f : f;
|
||||
float roughness = Roughness * Roughness;
|
||||
|
||||
if (distribution == "sharp")
|
||||
BSDF = Color * refraction(Normal, eta);
|
||||
else if (distribution == "beckmann")
|
||||
BSDF = Color * microfacet_beckmann_refraction(Normal, Roughness, eta);
|
||||
BSDF = Color * microfacet_beckmann_refraction(Normal, roughness, eta);
|
||||
else if (distribution == "GGX")
|
||||
BSDF = Color * microfacet_ggx_refraction(Normal, Roughness, eta);
|
||||
BSDF = Color * microfacet_ggx_refraction(Normal, roughness, eta);
|
||||
}
|
||||
|
||||
|
|
|
@ -468,10 +468,12 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
|
|||
break;
|
||||
}
|
||||
|
||||
float roughness = sqr(param1);
|
||||
|
||||
bsdf->N = N;
|
||||
bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
|
||||
bsdf->alpha_x = param1;
|
||||
bsdf->alpha_y = param1;
|
||||
bsdf->alpha_x = roughness;
|
||||
bsdf->alpha_y = roughness;
|
||||
bsdf->ior = 0.0f;
|
||||
bsdf->extra = NULL;
|
||||
|
||||
|
@ -525,8 +527,9 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
|
|||
sd->flag |= bsdf_refraction_setup(bsdf);
|
||||
}
|
||||
else {
|
||||
bsdf->alpha_x = param1;
|
||||
bsdf->alpha_y = param1;
|
||||
float roughness = sqr(param1);
|
||||
bsdf->alpha_x = roughness;
|
||||
bsdf->alpha_y = roughness;
|
||||
bsdf->ior = eta;
|
||||
|
||||
if(type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID)
|
||||
|
@ -557,7 +560,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
|
|||
/* fresnel */
|
||||
float cosNO = dot(N, sd->I);
|
||||
float fresnel = fresnel_dielectric_cos(cosNO, eta);
|
||||
float roughness = param1;
|
||||
float roughness = sqr(param1);
|
||||
|
||||
/* reflection */
|
||||
#ifdef __CAUSTICS_TRICKS__
|
||||
|
@ -611,8 +614,9 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
|
|||
bsdf->extra = extra;
|
||||
bsdf->T = make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
||||
bsdf->alpha_x = param1;
|
||||
bsdf->alpha_y = param1;
|
||||
float roughness = sqr(param1);
|
||||
bsdf->alpha_x = roughness;
|
||||
bsdf->alpha_y = roughness;
|
||||
float eta = fmaxf(param2, 1e-5f);
|
||||
bsdf->ior = (sd->flag & SD_BACKFACING)? 1.0f/eta: eta;
|
||||
|
||||
|
@ -648,7 +652,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
|
|||
bsdf->T = rotate_around_axis(bsdf->T, bsdf->N, rotation * M_2PI_F);
|
||||
|
||||
/* compute roughness */
|
||||
float roughness = param1;
|
||||
float roughness = sqr(param1);
|
||||
float anisotropy = clamp(param2, -0.99f, 0.99f);
|
||||
|
||||
if(anisotropy < 0.0f) {
|
||||
|
|
|
@ -247,7 +247,7 @@ void BakeManager::device_free(Device * /*device*/, DeviceScene * /*dscene*/)
|
|||
|
||||
int BakeManager::aa_samples(Scene *scene, BakeData *bake_data, ShaderEvalType type)
|
||||
{
|
||||
if(type == SHADER_EVAL_UV) {
|
||||
if(type == SHADER_EVAL_UV || type == SHADER_EVAL_ROUGHNESS) {
|
||||
return 1;
|
||||
}
|
||||
else if(type == SHADER_EVAL_NORMAL) {
|
||||
|
|
|
@ -1858,7 +1858,7 @@ NODE_DEFINE(AnisotropicBsdfNode)
|
|||
|
||||
SOCKET_IN_VECTOR(tangent, "Tangent", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_TANGENT);
|
||||
|
||||
SOCKET_IN_FLOAT(roughness, "Roughness", 0.2f);
|
||||
SOCKET_IN_FLOAT(roughness, "Roughness", 0.5f);
|
||||
SOCKET_IN_FLOAT(anisotropy, "Anisotropy", 0.5f);
|
||||
SOCKET_IN_FLOAT(rotation, "Rotation", 0.0f);
|
||||
|
||||
|
@ -1918,7 +1918,7 @@ NODE_DEFINE(GlossyBsdfNode)
|
|||
distribution_enum.insert("ashikhmin_shirley", CLOSURE_BSDF_ASHIKHMIN_SHIRLEY_ID);
|
||||
distribution_enum.insert("Multiscatter GGX", CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID);
|
||||
SOCKET_ENUM(distribution, "Distribution", distribution_enum, CLOSURE_BSDF_MICROFACET_GGX_ID);
|
||||
SOCKET_IN_FLOAT(roughness, "Roughness", 0.2f);
|
||||
SOCKET_IN_FLOAT(roughness, "Roughness", 0.5f);
|
||||
|
||||
SOCKET_OUT_CLOSURE(BSDF, "BSDF");
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* and keep comment above the defines.
|
||||
* Use STRINGIFY() rather than defining with quotes */
|
||||
#define BLENDER_VERSION 280
|
||||
#define BLENDER_SUBVERSION 4
|
||||
#define BLENDER_SUBVERSION 5
|
||||
/* Several breakages with 270, e.g. constraint deg vs rad */
|
||||
#define BLENDER_MINVERSION 270
|
||||
#define BLENDER_MINSUBVERSION 6
|
||||
|
|
|
@ -2690,7 +2690,6 @@ void node_bsdf_glossy(vec4 color, float roughness, vec3 N, float ssr_id, out Clo
|
|||
{
|
||||
#ifdef EEVEE_ENGINE
|
||||
vec3 out_spec, ssr_spec;
|
||||
roughness = sqrt(roughness);
|
||||
eevee_closure_glossy(N, vec3(1.0), int(ssr_id), roughness, 1.0, out_spec, ssr_spec);
|
||||
vec3 vN = normalize(mat3(ViewMatrix) * N);
|
||||
result = CLOSURE_DEFAULT;
|
||||
|
@ -2712,7 +2711,8 @@ void node_bsdf_glossy(vec4 color, float roughness, vec3 N, float ssr_id, out Clo
|
|||
vec3 light_specular = glLightSource[i].specular.rgb;
|
||||
|
||||
/* we mix in some diffuse so low roughness still shows up */
|
||||
float bsdf = 0.5 * pow(max(dot(N, H), 0.0), 1.0 / roughness);
|
||||
float r2 = roughness * roughness;
|
||||
float bsdf = 0.5 * pow(max(dot(N, H), 0.0), 1.0 / r2);
|
||||
bsdf += 0.5 * max(dot(N, light_position), 0.0);
|
||||
L += light_specular * bsdf;
|
||||
}
|
||||
|
@ -2732,7 +2732,6 @@ void node_bsdf_glass(vec4 color, float roughness, float ior, vec3 N, float ssr_i
|
|||
{
|
||||
#ifdef EEVEE_ENGINE
|
||||
vec3 out_spec, out_refr, ssr_spec;
|
||||
roughness = sqrt(roughness);
|
||||
vec3 refr_color = (refractionDepth > 0.0) ? color.rgb * color.rgb : color.rgb; /* Simulate 2 transmission event */
|
||||
eevee_closure_glass(N, vec3(1.0), int(ssr_id), roughness, 1.0, ior, out_spec, out_refr, ssr_spec);
|
||||
out_refr *= refr_color;
|
||||
|
@ -2971,7 +2970,6 @@ void node_bsdf_refraction(vec4 color, float roughness, float ior, vec3 N, out Cl
|
|||
#ifdef EEVEE_ENGINE
|
||||
vec3 out_refr;
|
||||
color.rgb *= (refractionDepth > 0.0) ? color.rgb : vec3(1.0); /* Simulate 2 absorption event. */
|
||||
roughness = sqrt(roughness);
|
||||
eevee_closure_refraction(N, roughness, ior, out_refr);
|
||||
vec3 vN = normalize(mat3(ViewMatrix) * N);
|
||||
result = CLOSURE_DEFAULT;
|
||||
|
|
|
@ -243,6 +243,7 @@ typedef enum eScenePassType {
|
|||
SCE_PASS_SUBSURFACE_DIRECT = (1 << 28),
|
||||
SCE_PASS_SUBSURFACE_INDIRECT = (1 << 29),
|
||||
SCE_PASS_SUBSURFACE_COLOR = (1 << 30),
|
||||
SCE_PASS_ROUGHNESS = (1 << 31),
|
||||
} eScenePassType;
|
||||
|
||||
#define RE_PASSNAME_COMBINED "Combined"
|
||||
|
|
|
@ -91,6 +91,7 @@ const EnumPropertyItem rna_enum_bake_pass_type_items[] = {
|
|||
{SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
|
||||
{SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
|
||||
{SCE_PASS_UV, "UV", 0, "UV", ""},
|
||||
{SCE_PASS_ROUGHNESS, "ROUGHNESS", 0, "ROUGHNESS", ""},
|
||||
{SCE_PASS_EMIT, "EMIT", 0, "Emit", ""},
|
||||
{SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
|
||||
{SCE_PASS_DIFFUSE_COLOR, "DIFFUSE", 0, "Diffuse", ""},
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_FLOAT, 1, N_("Anisotropy"), 0.5f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Rotation"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
static bNodeSocketTemplate sh_node_bsdf_glossy_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue