[Bf-blender-cvs] [163e978] HMD_viewport: Fixed lens distortion orientation
TheOnlyJoey
noreply at git.blender.org
Wed Mar 16 16:11:11 CET 2016
Commit: 163e978be1a023b2bcd6330d0e057c2703b75963
Author: TheOnlyJoey
Date: Fri Mar 11 06:24:11 2016 +0100
Branches: HMD_viewport
https://developer.blender.org/rB163e978be1a023b2bcd6330d0e057c2703b75963
Fixed lens distortion orientation
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/gpu/shaders/gpu_shader_fx_lensdistortion_frag.glsl
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index cbcdb86..7832994 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3260,6 +3260,7 @@ class VIEW3D_PT_view3d_shading(Panel):
sub.active = view.region_3d.view_perspective == 'CAMERA'
sub.prop(fx_settings, "use_dof")
col.prop(fx_settings, "use_ssao", text="Ambient Occlusion")
+ col.prop(fx_settings, "use_lens_dist", text="Lens Distortion (HMD)")
if fx_settings.use_ssao:
ssao_settings = fx_settings.ssao
subcol = col.column(align=True)
diff --git a/source/blender/gpu/shaders/gpu_shader_fx_lensdistortion_frag.glsl b/source/blender/gpu/shaders/gpu_shader_fx_lensdistortion_frag.glsl
index 04efda7..915a2e1 100644
--- a/source/blender/gpu/shaders/gpu_shader_fx_lensdistortion_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_fx_lensdistortion_frag.glsl
@@ -19,7 +19,7 @@ void main()
vec2 ScreenCenter = gl_FragCoord.x < 960 ? LeftScreenCenter : RightScreenCenter;
vec2 oTexCoord = gl_FragCoord.xy / vec2(1920, 1080);
-
+ oTexCoord = vec2(oTexCoord.x, 1.0-oTexCoord.y);
vec2 theta = (oTexCoord - LensCenter) * ScaleIn; // Scales to [-1, 1]
float rSq = theta.x * theta.x + theta.y * theta.y;
More information about the Bf-blender-cvs
mailing list