diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-04 21:35:35 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-04 21:35:35 +0300 |
commit | afc2cc393dbb4287ebd7a6736be603c89526b9dd (patch) | |
tree | 354740e04a1820a3629e88c8089c4b4d554a6b7b | |
parent | a5e9f9b34695917ea3635d5b6a77a23ac3b51fcd (diff) | |
parent | 260e6fd46b6684a7f52a02073ce567003fc52045 (diff) |
Merge branch 'blender-v3.1-release'
-rw-r--r-- | build_files/build_environment/cmake/freetype.cmake | 11 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/integrator/shade_surface.h | 23 | ||||
-rw-r--r-- | intern/cycles/kernel/integrator/shade_volume.h | 22 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 1 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_shader.cc | 4 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc | 2 | ||||
-rw-r--r-- | source/blender/render/intern/bake.c | 6 |
8 files changed, 44 insertions, 29 deletions
diff --git a/build_files/build_environment/cmake/freetype.cmake b/build_files/build_environment/cmake/freetype.cmake index 52261b47618..c6663c287b1 100644 --- a/build_files/build_environment/cmake/freetype.cmake +++ b/build_files/build_environment/cmake/freetype.cmake @@ -19,13 +19,10 @@ set(FREETYPE_EXTRA_ARGS -DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d - -DWITH_BZip2=OFF - -DWITH_HarfBuzz=OFF - -DFT_WITH_HARFBUZZ=OFF - -DFT_WITH_BZIP2=OFF - -DFT_WITH_BROTLI=ON - -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE + -DFT_DISABLE_BZIP2=ON + -DFT_DISABLE_HARFBUZZ=ON + -DFT_DISABLE_PNG=ON + -DFT_REQUIRE_BROTLI=ON -DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include -DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib ) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index c5f9aecabbf..28a27023818 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -83,9 +83,9 @@ else() set(OPENEXR_VERSION_POSTFIX) endif() -set(FREETYPE_VERSION 2.11.0) +set(FREETYPE_VERSION 2.11.1) set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz) -set(FREETYPE_HASH cf09172322f6b50cf8f568bf8fe14bde) +set(FREETYPE_HASH bd4e3b007474319909a6b79d50908e85) set(FREETYPE_HASH_TYPE MD5) set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz) diff --git a/intern/cycles/kernel/integrator/shade_surface.h b/intern/cycles/kernel/integrator/shade_surface.h index 329380fc464..10d3cbf7f57 100644 --- a/intern/cycles/kernel/integrator/shade_surface.h +++ b/intern/cycles/kernel/integrator/shade_surface.h @@ -193,17 +193,24 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg, const uint16_t transparent_bounce = INTEGRATOR_STATE(state, path, transparent_bounce); uint32_t shadow_flag = INTEGRATOR_STATE(state, path, flag); shadow_flag |= (is_light) ? PATH_RAY_SHADOW_FOR_LIGHT : 0; - shadow_flag |= (shadow_flag & PATH_RAY_ANY_PASS) ? 0 : PATH_RAY_SURFACE_PASS; const float3 throughput = INTEGRATOR_STATE(state, path, throughput) * bsdf_eval_sum(&bsdf_eval); if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { - const packed_float3 pass_diffuse_weight = - (bounce == 0) ? packed_float3(bsdf_eval_pass_diffuse_weight(&bsdf_eval)) : - INTEGRATOR_STATE(state, path, pass_diffuse_weight); - const packed_float3 pass_glossy_weight = (bounce == 0) ? - packed_float3( - bsdf_eval_pass_glossy_weight(&bsdf_eval)) : - INTEGRATOR_STATE(state, path, pass_glossy_weight); + packed_float3 pass_diffuse_weight; + packed_float3 pass_glossy_weight; + + if (shadow_flag & PATH_RAY_ANY_PASS) { + /* Indirect bounce, use weights from earlier surface or volume bounce. */ + pass_diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight); + pass_glossy_weight = INTEGRATOR_STATE(state, path, pass_glossy_weight); + } + else { + /* Direct light, use BSDFs at this bounce. */ + shadow_flag |= PATH_RAY_SURFACE_PASS; + pass_diffuse_weight = packed_float3(bsdf_eval_pass_diffuse_weight(&bsdf_eval)); + pass_glossy_weight = packed_float3(bsdf_eval_pass_glossy_weight(&bsdf_eval)); + } + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_diffuse_weight) = pass_diffuse_weight; INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_glossy_weight) = pass_glossy_weight; } diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h index e8d7bfa1374..c59234553a7 100644 --- a/intern/cycles/kernel/integrator/shade_volume.h +++ b/intern/cycles/kernel/integrator/shade_volume.h @@ -801,16 +801,26 @@ ccl_device_forceinline void integrate_volume_direct_light( const uint16_t transparent_bounce = INTEGRATOR_STATE(state, path, transparent_bounce); uint32_t shadow_flag = INTEGRATOR_STATE(state, path, flag); shadow_flag |= (is_light) ? PATH_RAY_SHADOW_FOR_LIGHT : 0; - shadow_flag |= (shadow_flag & PATH_RAY_ANY_PASS) ? 0 : PATH_RAY_VOLUME_PASS; const float3 throughput_phase = throughput * bsdf_eval_sum(&phase_eval); if (kernel_data.kernel_features & KERNEL_FEATURE_LIGHT_PASSES) { - const packed_float3 pass_diffuse_weight = (bounce == 0) ? - packed_float3(one_float3()) : - INTEGRATOR_STATE( - state, path, pass_diffuse_weight); + packed_float3 pass_diffuse_weight; + packed_float3 pass_glossy_weight; + + if (shadow_flag & PATH_RAY_ANY_PASS) { + /* Indirect bounce, use weights from earlier surface or volume bounce. */ + pass_diffuse_weight = INTEGRATOR_STATE(state, path, pass_diffuse_weight); + pass_glossy_weight = INTEGRATOR_STATE(state, path, pass_glossy_weight); + } + else { + /* Direct light, no diffuse/glossy distinction needed for volumes. */ + shadow_flag |= PATH_RAY_VOLUME_PASS; + pass_diffuse_weight = packed_float3(one_float3()); + pass_glossy_weight = packed_float3(zero_float3()); + } + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_diffuse_weight) = pass_diffuse_weight; - INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_glossy_weight) = zero_float3(); + INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, pass_glossy_weight) = pass_glossy_weight; } INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, render_pixel_index) = INTEGRATOR_STATE( diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 6aa00da7501..51107499d3f 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -244,7 +244,6 @@ void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area) for (region = area->regionbase.first; region; region = region->next) { if ((region->regiontype == RGN_TYPE_WINDOW) && region->regiondata) { ED_view3d_stop_render_preview(wm, region); - break; } } } diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 3ab3b11d1f4..faf13704a32 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -451,7 +451,9 @@ std::string GLShader::vertex_interface_declare(const ShaderCreateInfo &info) con ss << "\n/* Inputs. */\n"; for (const ShaderCreateInfo::VertIn &attr : info.vertex_inputs_) { - if (GLContext::explicit_location_support) { + if (GLContext::explicit_location_support && + /* Fix issue with amdgpu-pro + workbench_prepass_mesh_vert.glsl being quantized. */ + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) == false) { ss << "layout(location = " << attr.index << ") "; } ss << "in " << to_string(attr.type) << " " << attr.name << ";\n"; diff --git a/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc b/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc index deb149fd0f0..3c790079b5b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_merge_by_distance.cc @@ -26,7 +26,7 @@ static void node_declare(NodeDeclarationBuilder &b) b.add_input<decl::Geometry>(N_("Geometry")) .supported_type({GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_MESH}); b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); - b.add_input<decl::Float>(N_("Distance")).default_value(0.1f).min(0.0f).subtype(PROP_DISTANCE); + b.add_input<decl::Float>(N_("Distance")).default_value(0.001f).min(0.0f).subtype(PROP_DISTANCE); b.add_output<decl::Geometry>(N_("Geometry")); } diff --git a/source/blender/render/intern/bake.c b/source/blender/render/intern/bake.c index 93d2f721cc5..883e026472b 100644 --- a/source/blender/render/intern/bake.c +++ b/source/blender/render/intern/bake.c @@ -512,9 +512,9 @@ static TriTessFace *mesh_calc_tri_tessface(Mesh *me, bool tangent, Mesh *me_eval triangles[i].mverts[0] = &mvert[me->mloop[lt->tri[0]].v]; triangles[i].mverts[1] = &mvert[me->mloop[lt->tri[1]].v]; triangles[i].mverts[2] = &mvert[me->mloop[lt->tri[2]].v]; - triangles[i].vert_normals[0] = &vert_normals[me->mloop[lt->tri[0]].v][0]; - triangles[i].vert_normals[1] = &vert_normals[me->mloop[lt->tri[1]].v][1]; - triangles[i].vert_normals[2] = &vert_normals[me->mloop[lt->tri[2]].v][2]; + triangles[i].vert_normals[0] = vert_normals[me->mloop[lt->tri[0]].v]; + triangles[i].vert_normals[1] = vert_normals[me->mloop[lt->tri[1]].v]; + triangles[i].vert_normals[2] = vert_normals[me->mloop[lt->tri[2]].v]; triangles[i].is_smooth = (mp->flag & ME_SMOOTH) != 0; if (tangent) { |