Workbench: Highlights

Made the highlights darker (using the defaults of blender 2.7
- sharpness = 50
- spec color = 0.025 (I bumped it to 0.1)
- added a log2 to the frontal camera light to reveal more details of the
mesh
This commit is contained in:
2018-05-30 22:17:50 +02:00
parent 16d3f4db4c
commit fbd614f1fa
3 changed files with 5 additions and 5 deletions

View File

@@ -1498,7 +1498,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
{
if (!DNA_struct_elem_find(fd->filesdna, "SceneDisplay", "float", "roughness")) {
for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
scene->display.roughness = 0.0f;
scene->display.roughness = 0.5f;
}
for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) {
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {

View File

@@ -14,9 +14,9 @@ vec3 get_camera_diffuse_light(WorldData world_data, vec3 N)
result = mix(result, world_data.diffuse_light_x_neg, clamp(-N.x, 0.0, 1.0));
result = mix(result, world_data.diffuse_light_z_pos, clamp( N.y, 0.0, 1.0));
result = mix(result, world_data.diffuse_light_z_neg, clamp(-N.y, 0.0, 1.0));
result = mix(result, world_data.diffuse_light_y_pos, clamp( N.z, 0.0, 1.0));
result = mix(result, world_data.diffuse_light_y_pos, pow(clamp( N.z, 0.0, 1.0), 2.0));
result = mix(result, world_data.diffuse_light_y_neg, clamp(-N.z, 0.0, 1.0));
return result.xyz;
return result.rgb;
}
/* N And I are in View Space. */
@@ -24,7 +24,7 @@ vec3 get_world_specular_light(WorldData world_data, vec3 N, vec3 I)
{
#ifdef V3D_SHADING_SPECULAR_HIGHLIGHT
vec3 reflection_vector = reflect(I, N);
vec3 specular_light = vec3(1.0);
vec3 specular_light = vec3(0.1);
/* Simple frontal specular highlights. */
float specular_influence = pow(max(0.0, dot(world_data.light_direction_vs.xyz, reflection_vector)), world_data.specular_sharpness);
vec3 specular_color = specular_light * specular_influence;

View File

@@ -37,7 +37,7 @@ void workbench_private_data_init(WORKBENCH_PrivateData *wpd)
copy_v3_v3(wd->object_outline_color, wpd->shading.object_outline_color);
wd->object_outline_color[3] = 1.0f;
wd->specular_sharpness = 100.0f - sqrtf(scene->display.roughness) * 100.0f;
wd->specular_sharpness = 100.0f - scene->display.roughness * 100.0f;
wpd->world_ubo = DRW_uniformbuffer_create(sizeof(WORKBENCH_UBO_World), &wpd->world_data);
}