From 3361f2107b9d8ac2d907a5c639398d86e3181ced Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 8 Jul 2017 02:46:06 +0200 Subject: [PATCH 1/3] Fix T51967: OSL crash after rendering finished (mainly on Windows). --- intern/cycles/render/osl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 6bff29d1c76..a794f233718 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -156,6 +156,7 @@ void OSLShaderManager::device_free(Device *device, DeviceScene *dscene, Scene *s og->surface_state.clear(); og->volume_state.clear(); og->displacement_state.clear(); + og->bump_state.clear(); og->background_state.reset(); } From 0584c5ba8e732645f51e927afc87dfa003c51204 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 8 Jul 2017 22:08:38 +0200 Subject: [PATCH 2/3] Fix T51959: Windows + Intel GPU offset between UI drawing and mouse. Unfortunately this means disabling the code that ensures the title bar is properly scaled with DPI, however better to have that as a cosmetic issue than Blender being unusable with a lot of Intel GPUs. --- intern/ghost/intern/GHOST_SystemWin32.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 9f03b5e9537..b0dae432643 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -941,6 +941,8 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized"); if (hwnd) { +#if 0 + // Disabled due to bug in Intel drivers, see T51959 if(msg == WM_NCCREATE) { // Tell Windows to automatically handle scaling of non-client areas // such as the caption bar. EnableNonClientDpiScaling was introduced in Windows 10 @@ -954,6 +956,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, } } } +#endif GHOST_WindowWin32 *window = (GHOST_WindowWin32 *)::GetWindowLongPtr(hwnd, GWLP_USERDATA); if (window) { From ba256b32ee5d3ab7991fe5abbb47071ccfe8577c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 8 Jul 2017 23:37:16 +0200 Subject: [PATCH 3/3] Fix T52001: material draw mode principled BSDF artifacts at some angles. The default anisotropic tangent computation could fail in some cases, leading to NaNs and artifacts. Use a simpler formulation that doesn't suffer from this. --- source/blender/gpu/shaders/gpu_shader_material.glsl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 67a099159c5..f14db57a26a 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2636,14 +2636,11 @@ void node_bsdf_principled(vec4 base_color, float subsurface, vec3 subsurface_rad vec3 Tangent = T; if (T == vec3(0.0)) { // if no tangent is set, use a default tangent - Tangent = vec3(1.0, 0.0, 0.0); - if (N.x != 0.0 || N.y != 0.0) { - vec3 N_xz = normalize(vec3(N.x, 0.0, N.z)); - - vec3 axis = normalize(cross(vec3(0.0, 0.0, 1.0), N_xz)); - float angle = acos(dot(vec3(0.0, 0.0, 1.0), N_xz)); - - Tangent = normalize(rotate_vector(vec3(1.0, 0.0, 0.0), axis, angle)); + if(N.x != N.y || N.x != N.z) { + Tangent = vec3(N.z-N.y, N.x-N.z, N.y-N.x); // (1,1,1) x N + } + else { + Tangent = vec3(N.z-N.y, N.x+N.z, -N.y-N.x); // (-1,1,1) x N } }