diff options
7 files changed, 169 insertions, 178 deletions
diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index 5ce180f6be7..6a8a7d188c2 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -68,16 +68,7 @@ class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel): col.template_override_property(collection_props, scene_props, "ssao_factor_edge") col.template_override_property(collection_props, scene_props, "ssao_distance") col.template_override_property(collection_props, scene_props, "ssao_attenuation") - col.template_override_property(collection_props, scene_props, "world_intensity") - - col.separator() - col.label("Hair Settings:") - col.template_override_property(collection_props, scene_props, "diffuse_intensity") - col.template_override_property(collection_props, scene_props, "specular_intensity") - col.template_override_property(collection_props, scene_props, "specular_hardness") col.template_override_property(collection_props, scene_props, "color_randomicity") - col.template_override_property(collection_props, scene_props, "hair_diffuse_color") - col.template_override_property(collection_props, scene_props, "hair_specular_color") class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index e56c559a163..1bda0e65a98 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -614,16 +614,7 @@ class RENDER_PT_clay_collection_settings(RenderButtonsPanel, Panel): col.prop(props, "ssao_factor_edge") col.prop(props, "ssao_distance") col.prop(props, "ssao_attenuation") - - col.separator() - col.label("Hair Settings:") - col.prop(props, "world_intensity") - col.prop(props, "diffuse_intensity") - col.prop(props, "specular_intensity") - col.prop(props, "specular_hardness") col.prop(props, "color_randomicity") - col.prop(props, "hair_diffuse_color") - col.prop(props, "hair_specular_color") class RENDER_PT_eevee_poststack_settings(RenderButtonsPanel, Panel): bl_label = "Post Process Stack" diff --git a/source/blender/draw/engines/clay/clay_engine.c b/source/blender/draw/engines/clay/clay_engine.c index f7cb606b7ae..7927b3df390 100644 --- a/source/blender/draw/engines/clay/clay_engine.c +++ b/source/blender/draw/engines/clay/clay_engine.c @@ -65,16 +65,11 @@ typedef struct CLAY_UBO_Material { BLI_STATIC_ASSERT_ALIGN(CLAY_UBO_Material, 16); typedef struct CLAY_HAIR_UBO_Material { - float hair_world; - float hair_diffuse; - float hair_specular; - float hair_hardness; float hair_randomicity; - float pad1[3]; - float hair_diffuse_color[3]; - float pad2; - float hair_specular_color[3]; - float pad3; + float matcap_id; + float matcap_rot[2]; + float matcap_hsv[3]; + float pad; } CLAY_HAIR_UBO_Material; /* 48 bytes */ #define MAX_CLAY_MAT 512 /* 512 = 9 bit material id */ @@ -157,9 +152,6 @@ static struct { struct GPUTexture *jitter_tx; struct GPUTexture *sampling_tx; - /* hair */ - float hair_light[3]; - /* Just a serie of int from 0 to MAX_CLAY_MAT-1 */ int ubo_mat_idxs[MAX_CLAY_MAT]; int hair_ubo_mat_idxs[MAX_CLAY_MAT]; @@ -454,13 +446,6 @@ static void CLAY_engine_init(void *vedata) e_data.cached_sample_num = ssao_samples; } } - - /* hair setup */ - { - e_data.hair_light[0] = 1.0f; - e_data.hair_light[1] = -0.5f; - e_data.hair_light[2] = -0.7f; - } } static DRWShadingGroup *CLAY_shgroup_create(CLAY_Data *vedata, DRWPass *pass, int *material_id) @@ -489,7 +474,7 @@ static DRWShadingGroup *CLAY_hair_shgroup_create(DRWPass *pass, int *material_id { DRWShadingGroup *grp = DRW_shgroup_create(e_data.hair_sh, pass); - DRW_shgroup_uniform_vec3(grp, "light", e_data.hair_light, 1); + DRW_shgroup_uniform_texture(grp, "matcaps", e_data.matcap_array); DRW_shgroup_uniform_int(grp, "mat_id", material_id, 1); return grp; @@ -522,28 +507,20 @@ static int search_mat_to_ubo( return -1; } -static int search_hair_mat_to_ubo(CLAY_Storage *storage, float hair_world, float hair_diffuse, float hair_specular, - float hair_hardness, float hair_randomicity, const float *hair_diff_color, - const float *hair_spec_color) +static int search_hair_mat_to_ubo(CLAY_Storage *storage, float matcap_rot, float matcap_hue, float matcap_sat, + float matcap_val, float hair_randomicity, int matcap_icon) { /* For now just use a linear search and test all parameters */ /* TODO make a hash table */ for (int i = 0; i < storage->hair_ubo_current_id; ++i) { CLAY_HAIR_UBO_Material *ubo = &storage->hair_mat_storage.materials[i]; - if ((ubo->hair_world == hair_world) && - (ubo->hair_diffuse == hair_diffuse) && - (ubo->hair_specular == hair_specular) && - (ubo->hair_hardness == hair_hardness) && + if ((ubo->matcap_rot[0] == cosf(matcap_rot * 3.14159f * 2.0f)) && + (ubo->matcap_hsv[0] == matcap_hue + 0.5f) && + (ubo->matcap_hsv[1] == matcap_sat * 2.0f) && + (ubo->matcap_hsv[2] == matcap_val * 2.0f) && (ubo->hair_randomicity == hair_randomicity) && - (ubo->hair_diffuse_color[0] == hair_diff_color[0]) && - (ubo->hair_diffuse_color[1] == hair_diff_color[1]) && - (ubo->hair_diffuse_color[2] == hair_diff_color[2]) && - (ubo->hair_diffuse_color[3] == hair_diff_color[3]) && - (ubo->hair_specular_color[0] == hair_spec_color[0]) && - (ubo->hair_specular_color[1] == hair_spec_color[1]) && - (ubo->hair_specular_color[2] == hair_spec_color[2]) && - (ubo->hair_specular_color[3] == hair_spec_color[3])) + (ubo->matcap_id == matcap_to_index(matcap_icon))) { return i; } @@ -579,26 +556,22 @@ static int push_mat_to_ubo(CLAY_Storage *storage, float matcap_rot, float matcap return id; } -static int push_hair_mat_to_ubo(CLAY_Storage *storage, float hair_world, float hair_diffuse, float hair_specular, - float hair_hardness, float hair_randomicity, const float *hair_diff_color, - const float *hair_spec_color) +static int push_hair_mat_to_ubo(CLAY_Storage *storage, float matcap_rot, float matcap_hue, float matcap_sat, + float matcap_val, float hair_randomicity, int matcap_icon) { int id = storage->hair_ubo_current_id; CLAY_HAIR_UBO_Material *ubo = &storage->hair_mat_storage.materials[id]; - ubo->hair_world = hair_world; - ubo->hair_diffuse = hair_diffuse; - ubo->hair_specular = hair_specular; - ubo->hair_hardness = hair_hardness; + ubo->matcap_rot[0] = cosf(matcap_rot * 3.14159f * 2.0f); + ubo->matcap_rot[1] = sinf(matcap_rot * 3.14159f * 2.0f); + + ubo->matcap_hsv[0] = matcap_hue + 0.5f; + ubo->matcap_hsv[1] = matcap_sat * 2.0f; + ubo->matcap_hsv[2] = matcap_val * 2.0f; + ubo->hair_randomicity = hair_randomicity; - ubo->hair_diffuse_color[0] = hair_diff_color[0]; - ubo->hair_diffuse_color[1] = hair_diff_color[1]; - ubo->hair_diffuse_color[2] = hair_diff_color[2]; - ubo->hair_diffuse_color[3] = hair_diff_color[3]; - ubo->hair_specular_color[0] = hair_spec_color[0]; - ubo->hair_specular_color[1] = hair_spec_color[1]; - ubo->hair_specular_color[2] = hair_spec_color[2]; - ubo->hair_specular_color[3] = hair_spec_color[3]; + + ubo->matcap_id = matcap_to_index(matcap_icon); storage->hair_ubo_current_id++; @@ -624,18 +597,17 @@ static int mat_in_ubo(CLAY_Storage *storage, float matcap_rot, float matcap_hue, return id; } -static int hair_mat_in_ubo(CLAY_Storage *storage, float hair_world, float hair_diffuse, float hair_specular, - float hair_hardness, float hair_randomicity, const float *hair_diff_color, - const float *hair_spec_color) +static int hair_mat_in_ubo(CLAY_Storage *storage, float matcap_rot, float matcap_hue, float matcap_sat, + float matcap_val, float hair_randomicity, int matcap_icon) { /* Search material in UBO */ - int id = search_hair_mat_to_ubo(storage, hair_world, hair_diffuse, hair_specular, - hair_hardness, hair_randomicity, hair_diff_color, hair_spec_color); + int id = search_hair_mat_to_ubo(storage, matcap_rot, matcap_hue, matcap_sat, + matcap_val, hair_randomicity, matcap_icon); /* if not found create it */ if (id == -1) { - id = push_hair_mat_to_ubo(storage, hair_world, hair_diffuse, hair_specular, - hair_hardness, hair_randomicity, hair_diff_color, hair_spec_color); + id = push_hair_mat_to_ubo(storage, matcap_rot, matcap_hue, matcap_sat, + matcap_val, hair_randomicity, matcap_icon); } return id; @@ -678,16 +650,15 @@ static DRWShadingGroup *CLAY_hair_shgrp_get(Object *ob, CLAY_StorageList *stl, C IDProperty *props = BKE_layer_collection_engine_evaluated_get(ob, COLLECTION_MODE_NONE, RE_engine_id_BLENDER_CLAY); /* Default Settings */ - float hair_world = BKE_collection_engine_property_value_get_float(props, "world_intensity"); - float hair_diffuse = BKE_collection_engine_property_value_get_float(props, "diffuse_intensity"); - float hair_specular = BKE_collection_engine_property_value_get_float(props, "specular_intensity"); - float hair_hardness = BKE_collection_engine_property_value_get_float(props, "specular_hardness"); + float matcap_rot = BKE_collection_engine_property_value_get_float(props, "matcap_rotation"); + float matcap_hue = BKE_collection_engine_property_value_get_float(props, "matcap_hue"); + float matcap_sat = BKE_collection_engine_property_value_get_float(props, "matcap_saturation"); + float matcap_val = BKE_collection_engine_property_value_get_float(props, "matcap_value"); float hair_randomicity = BKE_collection_engine_property_value_get_float(props, "color_randomicity"); - const float *hair_diff_color = BKE_collection_engine_property_value_get_float_array(props, "hair_diffuse_color"); - const float *hair_spec_color = BKE_collection_engine_property_value_get_float_array(props, "hair_specular_color"); + int matcap_icon = BKE_collection_engine_property_value_get_int(props, "matcap_icon"); - int hair_id = hair_mat_in_ubo(stl->storage, hair_world, hair_diffuse, hair_specular, - hair_hardness, hair_randomicity, hair_diff_color, hair_spec_color); + int hair_id = hair_mat_in_ubo(stl->storage, matcap_rot, matcap_hue, matcap_sat, + matcap_val, hair_randomicity, matcap_icon); if (hair_shgrps[hair_id] == NULL) { hair_shgrps[hair_id] = CLAY_hair_shgroup_create(psl->hair_pass, &e_data.hair_ubo_mat_idxs[hair_id]); @@ -838,9 +809,6 @@ static void CLAY_layer_collection_settings_create(RenderEngine *UNUSED(engine), props->type == IDP_GROUP && props->subtype == IDP_GROUP_SUB_ENGINE_RENDER); - static float default_hair_diffuse_color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - static float default_hair_specular_color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - BKE_collection_engine_property_add_int(props, "matcap_icon", ICON_MATCAP_01); BKE_collection_engine_property_add_int(props, "type", CLAY_MATCAP_NONE); BKE_collection_engine_property_add_float(props, "matcap_rotation", 0.0f); @@ -850,13 +818,7 @@ static void CLAY_layer_collection_settings_create(RenderEngine *UNUSED(engine), BKE_collection_engine_property_add_float(props, "ssao_distance", 0.2f); BKE_collection_engine_property_add_float(props, "ssao_attenuation", 1.0f); BKE_collection_engine_property_add_float(props, "ssao_factor_cavity", 1.0f); - BKE_collection_engine_property_add_float(props, "world_intensity", 0.1f); - BKE_collection_engine_property_add_float(props, "diffuse_intensity", 0.2f); - BKE_collection_engine_property_add_float(props, "specular_intensity", 0.3f); - BKE_collection_engine_property_add_float(props, "specular_hardness", 4.0f); BKE_collection_engine_property_add_float(props, "color_randomicity", 0.0f); - BKE_collection_engine_property_add_float_array(props, "hair_diffuse_color", default_hair_diffuse_color, 4); - BKE_collection_engine_property_add_float_array(props, "hair_specular_color", default_hair_specular_color, 4); } static void CLAY_scene_layer_settings_create(RenderEngine *UNUSED(engine), IDProperty *props) diff --git a/source/blender/draw/engines/clay/shaders/particle_strand_frag.glsl b/source/blender/draw/engines/clay/shaders/particle_strand_frag.glsl index f1ce3a55699..2e69890a32d 100644 --- a/source/blender/draw/engines/clay/shaders/particle_strand_frag.glsl +++ b/source/blender/draw/engines/clay/shaders/particle_strand_frag.glsl @@ -1,46 +1,143 @@ -uniform vec3 light; - /* Material Parameters packed in an UBO */ struct Material { vec4 one; vec4 two; - vec4 hair_diffuse_color; - vec4 hair_specular_color; }; layout(std140) uniform material_block { Material shader_param[MAX_MATERIAL]; }; +uniform sampler2DArray matcaps; uniform int mat_id; -#define world shader_param[mat_id].one.x -#define diffuse shader_param[mat_id].one.y -#define specular shader_param[mat_id].one.z -#define hardness shader_param[mat_id].one.w -#define randomicity shader_param[mat_id].two.x -#define diffColor shader_param[mat_id].hair_diffuse_color -#define specColor shader_param[mat_id].hair_specular_color +#define randomicity shader_param[mat_id].one.x +#define matcap_index shader_param[mat_id].one.y +#define matcap_rotation shader_param[mat_id].one.zw +#define matcap_hsv shader_param[mat_id].two.xyz -in vec3 normal; +in vec3 tangent; in vec3 viewPosition; flat in float colRand; out vec4 fragColor; +vec3 rotate(vec3 norm, vec3 ortho, float ang) +{ + return norm * cos(ang) + ortho * sin(ang); +} + +void rgb_to_hsv(vec3 rgb, out vec3 outcol) +{ + float cmax, cmin, h, s, v, cdelta; + vec3 c; + + cmax = max(rgb[0], max(rgb[1], rgb[2])); + cmin = min(rgb[0], min(rgb[1], rgb[2])); + cdelta = cmax - cmin; + + v = cmax; + if (cmax != 0.0) + s = cdelta / cmax; + else { + s = 0.0; + h = 0.0; + } + + if (s == 0.0) { + h = 0.0; + } + else { + c = (vec3(cmax, cmax, cmax) - rgb.xyz) / cdelta; + + if (rgb.x == cmax) h = c[2] - c[1]; + else if (rgb.y == cmax) h = 2.0 + c[0] - c[2]; + else h = 4.0 + c[1] - c[0]; + + h /= 6.0; + + if (h < 0.0) + h += 1.0; + } + + outcol = vec3(h, s, v); +} + +void hsv_to_rgb(vec3 hsv, out vec3 outcol) +{ + float i, f, p, q, t, h, s, v; + vec3 rgb; + + h = hsv[0]; + s = hsv[1]; + v = hsv[2]; + + if (s == 0.0) { + rgb = vec3(v, v, v); + } + else { + if (h == 1.0) + h = 0.0; + + h *= 6.0; + i = floor(h); + f = h - i; + rgb = vec3(f, f, f); + p = v * (1.0 - s); + q = v * (1.0 - (s * f)); + t = v * (1.0 - (s * (1.0 - f))); + + if (i == 0.0) rgb = vec3(v, t, p); + else if (i == 1.0) rgb = vec3(q, v, p); + else if (i == 2.0) rgb = vec3(p, v, t); + else if (i == 3.0) rgb = vec3(p, q, v); + else if (i == 4.0) rgb = vec3(t, p, v); + else rgb = vec3(v, p, q); + } + + outcol = rgb; +} + +void hue_sat(float hue, float sat, float value, inout vec3 col) +{ + vec3 hsv; + + rgb_to_hsv(col, hsv); + + hsv.x += hue; + hsv.x -= floor(hsv.x); + hsv.y *= sat; + hsv.y = clamp(hsv.y, 0.0, 1.0); + hsv.z *= value; + hsv.z = clamp(hsv.z, 0.0, 1.0); + + hsv_to_rgb(hsv, col); +} + void main() { - vec3 normal = normalize(normal); - vec3 specVec = normalize(normalize(light) + normalize(viewPosition)); - float specCos = dot(specVec, normal); - float diffCos = dot(normalize(light), normal); - float maxChan = max(max(diffColor.r, diffColor.g), diffColor.b); - float diff; - float spec; - diff = world; /* world */ - diff += sqrt(1.0 - diffCos*diffCos) * diffuse; /* diffuse */ - spec = pow(1.0 - abs(specCos), hardness) * specular; /* specular */ - fragColor = (diffColor - (colRand * maxChan * randomicity)) * diff; /* add diffuse */ - fragColor += specColor * spec; /* add specular */ - fragColor = clamp(fragColor, 0.0, 1.0); + vec3 viewvec = normalize(viewPosition); + vec3 ortho = normalize(cross(viewPosition, tangent)); + vec3 norm = normalize(cross(ortho, tangent)); + + vec3 col = vec3(0); + + vec2 rotY = vec2(-matcap_rotation.y, matcap_rotation.x); + + for (int i = 0; i < 9; i++) { + vec3 rotNorm = rotate(norm, ortho, -0.5 + (i * 0.125)); + vec3 ray = viewvec - ((2.0 * dot(viewvec, rotNorm)) * rotNorm); + vec2 texco = abs(vec2(dot(ray.xy, matcap_rotation), dot(ray.xy, rotY)) * .49 + 0.5); + + col += texture(matcaps, vec3(texco, matcap_index)).rgb / 9.0; + } + + hue_sat(matcap_hsv.x, matcap_hsv.y, matcap_hsv.z, col); + + float maxChan = max(max(col.r, col.g), col.b); + + col += (colRand * maxChan * randomicity * 2.0) - (maxChan * randomicity); + + fragColor.rgb = col; + fragColor.a = 1.0; } diff --git a/source/blender/draw/engines/clay/shaders/particle_vert.glsl b/source/blender/draw/engines/clay/shaders/particle_vert.glsl index c10cade330c..ab47caabc11 100644 --- a/source/blender/draw/engines/clay/shaders/particle_vert.glsl +++ b/source/blender/draw/engines/clay/shaders/particle_vert.glsl @@ -4,9 +4,9 @@ uniform mat3 NormalMatrix; uniform mat4 ModelViewMatrix; in vec3 pos; -in vec3 nor; +in vec3 tang; in int ind; -out vec3 normal; +out vec3 tangent; out vec3 viewPosition; flat out float colRand; @@ -28,7 +28,7 @@ float rand(int seed) void main() { gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); - normal = normalize(NormalMatrix * nor); + tangent = normalize(NormalMatrix * tang); viewPosition = (ModelViewMatrix * vec4(pos, 1.0)).xyz; colRand = rand(ind); } diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 779f2f78c1f..b6c532d62e5 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -174,7 +174,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys, Partic { if (cache->pos == NULL || cache->segments == NULL) { static VertexFormat format = { 0 }; - static unsigned pos_id, nor_id, ind_id; + static unsigned pos_id, tan_id, ind_id; int curr_point = 0; VERTEXBUFFER_DISCARD_SAFE(cache->pos); @@ -183,7 +183,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys, Partic if (format.attrib_ct == 0) { /* initialize vertex format */ pos_id = VertexFormat_add_attrib(&format, "pos", COMP_F32, 3, KEEP_FLOAT); - nor_id = VertexFormat_add_attrib(&format, "nor", COMP_F32, 3, KEEP_FLOAT); + tan_id = VertexFormat_add_attrib(&format, "tang", COMP_F32, 3, KEEP_FLOAT); ind_id = VertexFormat_add_attrib(&format, "ind", COMP_I32, 1, KEEP_INT); } @@ -209,7 +209,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys, Partic } VertexBuffer_set_attrib(cache->pos, pos_id, curr_point, path[j].co); - VertexBuffer_set_attrib(cache->pos, nor_id, curr_point, tangent); + VertexBuffer_set_attrib(cache->pos, tan_id, curr_point, tangent); VertexBuffer_set_attrib(cache->pos, ind_id, curr_point, &i); add_line_vertices(&elb, curr_point, curr_point + 1); @@ -220,7 +220,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys, Partic sub_v3_v3v3(tangent, path[path->segments].co, path[path->segments - 1].co); VertexBuffer_set_attrib(cache->pos, pos_id, curr_point, path[path->segments].co); - VertexBuffer_set_attrib(cache->pos, nor_id, curr_point, tangent); + VertexBuffer_set_attrib(cache->pos, tan_id, curr_point, tangent); VertexBuffer_set_attrib(cache->pos, ind_id, curr_point, &i); curr_point++; @@ -245,7 +245,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys, Partic } VertexBuffer_set_attrib(cache->pos, pos_id, curr_point, path[j].co); - VertexBuffer_set_attrib(cache->pos, nor_id, curr_point, tangent); + VertexBuffer_set_attrib(cache->pos, tan_id, curr_point, tangent); VertexBuffer_set_attrib(cache->pos, ind_id, curr_point, &x); add_line_vertices(&elb, curr_point, curr_point + 1); @@ -256,7 +256,7 @@ static void particle_batch_cache_ensure_pos_and_seg(ParticleSystem *psys, Partic sub_v3_v3v3(tangent, path[path->segments].co, path[path->segments - 1].co); VertexBuffer_set_attrib(cache->pos, pos_id, curr_point, path[path->segments].co); - VertexBuffer_set_attrib(cache->pos, nor_id, curr_point, tangent); + VertexBuffer_set_attrib(cache->pos, tan_id, curr_point, tangent); VertexBuffer_set_attrib(cache->pos, ind_id, curr_point, &x); curr_point++; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5fe91386bd5..8dedcfeb462 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2578,13 +2578,7 @@ RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_cavity) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_factor_edge) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_distance) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(ssao_attenuation) -RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(world_intensity) -RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(diffuse_intensity) -RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(specular_intensity) -RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(specular_hardness) RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(color_randomicity) -RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT_ARRAY(hair_diffuse_color, 4) -RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT_ARRAY(hair_specular_color, 4) #endif /* WITH_CLAY_ENGINE */ /* eevee engine */ @@ -6336,7 +6330,7 @@ static void rna_def_layer_collection_engine_settings_clay(BlenderRNA *brna) prop = RNA_def_property(srna, "matcap_hue", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_matcap_hue_get", "rna_LayerEngineSettings_Clay_matcap_hue_set", NULL); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Matcap Hue shift", "Hue correction of the matcap"); + RNA_def_property_ui_text(prop, "Matcap Hue Shift", "Hue correction of the matcap"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); @@ -6384,57 +6378,13 @@ static void rna_def_layer_collection_engine_settings_clay(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - prop = RNA_def_property(srna, "world_intensity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_world_intensity_get", "rna_LayerEngineSettings_Clay_world_intensity_set", NULL); - RNA_def_property_ui_text(prop, "Hair World Light", "World lighting intensity for hair"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_diffuse_intensity_get", "rna_LayerEngineSettings_Clay_diffuse_intensity_set", NULL); - RNA_def_property_ui_text(prop, "Hair Diffuse", "Diffuse lighting intensity for hair"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_specular_intensity_get", "rna_LayerEngineSettings_Clay_specular_intensity_set", NULL); - RNA_def_property_ui_text(prop, "Hair Specular", "Specular lighting intensity for hair"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "specular_hardness", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_specular_hardness_get", "rna_LayerEngineSettings_Clay_specular_hardness_set", NULL); - RNA_def_property_ui_text(prop, "Hair Specular Hardness", "Specular hardness for hair"); - RNA_def_property_range(prop, 0.0f, 1000.0f); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - prop = RNA_def_property(srna, "color_randomicity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_color_randomicity_get", "rna_LayerEngineSettings_Clay_color_randomicity_set", NULL); - RNA_def_property_ui_text(prop, "Hair Color Randomicity", "Color randomicity for hair"); + RNA_def_property_ui_text(prop, "Hair Brightness Randomicity", "Brightness randomicity for hair"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - prop = RNA_def_property(srna, "hair_diffuse_color", PROP_FLOAT, PROP_COLOR); - RNA_def_property_array(prop, 4); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_hair_diffuse_color_get", - "rna_LayerEngineSettings_Clay_hair_diffuse_color_set", NULL); - RNA_def_property_ui_text(prop, "Hair Diffuse Color", "Diffuse component of hair shading color"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "hair_specular_color", PROP_FLOAT, PROP_COLOR); - RNA_def_property_array(prop, 4); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_Clay_hair_specular_color_get", - "rna_LayerEngineSettings_Clay_hair_specular_color_set", NULL); - RNA_def_property_ui_text(prop, "Hair Specular Color", "Specular component of hair shading color"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_update"); - RNA_define_verify_sdna(1); /* not in sdna */ } #endif /* WITH_CLAY_ENGINE */ |