[Bf-blender-cvs] [2f4148d] HMD_viewport: Remove unused storage for lens distortion shader

Julian Eisel noreply at git.blender.org
Mon Mar 28 21:38:42 CEST 2016


Commit: 2f4148d8335854bc1250db41af4ab9eeb3a115e6
Author: Julian Eisel
Date:   Mon Mar 28 21:36:25 2016 +0200
Branches: HMD_viewport
https://developer.blender.org/rB2f4148d8335854bc1250db41af4ab9eeb3a115e6

Remove unused storage for lens distortion shader

Also removes unneeded button from UI and unneeded RNA defines.

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenkernel/intern/screen.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/gpu/intern/gpu_compositing.c
M	source/blender/makesdna/DNA_gpu_types.h
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 7832994..cbcdb86 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3260,7 +3260,6 @@ 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/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index f006dd1..d75e101 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -679,13 +679,4 @@ void BKE_screen_gpu_fx_validate(GPUFXSettings *fx_settings)
 
 		GPU_fx_compositor_init_ssao_settings(fx_ssao);
 	}
-
-    if ((fx_settings->lens_dist == NULL) &&
-	    (fx_settings->fx_flag & GPU_FX_FLAG_LensDist))
-	{
-		GPULensDistortionSettings *fx_lens_dist;
-		fx_lens_dist = fx_settings->lens_dist = MEM_callocN(sizeof(GPULensDistortionSettings), __func__);
-
-		//GPU_fx_compositor_init_ssao_settings(fx_ssao);
-	}
 }
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 4556807..a526717 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6932,9 +6932,6 @@ static bool direct_link_screen(FileData *fd, bScreen *sc)
 					v3d->fx_settings.dof = newdataadr(fd, v3d->fx_settings.dof);
 				if (v3d->fx_settings.ssao)
 					v3d->fx_settings.ssao = newdataadr(fd, v3d->fx_settings.ssao);
-                if (v3d->fx_settings.lens_dist)
-					v3d->fx_settings.lens_dist = newdataadr(fd, v3d->fx_settings.lens_dist);
-
 				
 				blo_do_versions_view3d_split_250(v3d, &sl->regionbase);
 			}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ac00c99..43ad2c3 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2775,8 +2775,6 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
 						writestruct(wd, DATA, "GPUSSAOSettings", 1, v3d->fx_settings.ssao);
 					if (v3d->fx_settings.dof)
 						writestruct(wd, DATA, "GPUDOFSettings", 1, v3d->fx_settings.dof);
-                    if (v3d->fx_settings.lens_dist)
-						writestruct(wd, DATA, "GPUDOFSettings", 1, v3d->fx_settings.lens_dist);
 				}
 				else if (sl->spacetype==SPACE_IPO) {
 					SpaceIpo *sipo= (SpaceIpo *)sl;
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 7cee15a..a97a4db 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -432,8 +432,6 @@ static void view3d_free(SpaceLink *sl)
 		MEM_freeN(vd->fx_settings.ssao);
 	if (vd->fx_settings.dof)
 		MEM_freeN(vd->fx_settings.dof);
-	if (vd->fx_settings.lens_dist)
-		MEM_freeN(vd->fx_settings.lens_dist);
 }
 
 
@@ -479,8 +477,6 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
 		v3dn->fx_settings.dof = MEM_dupallocN(v3do->fx_settings.dof);
 	if (v3dn->fx_settings.ssao)
 		v3dn->fx_settings.ssao = MEM_dupallocN(v3do->fx_settings.ssao);
-    if (v3dn->fx_settings.lens_dist)
-		v3dn->fx_settings.lens_dist = MEM_dupallocN(v3do->fx_settings.lens_dist);
 
 	return (SpaceLink *)v3dn;
 }
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 22ee32b..0af9949 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -404,9 +404,6 @@ bool GPU_fx_compositor_initialize_passes(
 	if (!fx_settings->ssao || fx_settings->ssao->samples < 1) {
 		fx_flag &= ~GPU_FX_FLAG_SSAO;
 	}
-    if (!fx_settings->lens_dist) {
-		fx_flag &= ~GPU_FX_FLAG_LensDist;
-	}
 
 	if (!fx_flag) {
 		cleanup_fx_gl_data(fx, true);
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index d2da405..22df933 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -52,16 +52,9 @@ typedef struct GPUSSAOSettings {
 	int pad;
 } GPUSSAOSettings;
 
-/* properties for Lens Distortion effect */
-typedef struct GPULensDistortionSettings {
-    //placeholder for dynamic lens distortion settings
-    double doubleTrouble;
-} GPULensDistortionSettings;
-
 typedef struct GPUFXSettings {
 	GPUDOFSettings *dof;
 	GPUSSAOSettings *ssao;
-	GPULensDistortionSettings *lens_dist;
 	char fx_flag;  /* eGPUFXFlags */
 	char pad[7];
 } GPUFXSettings;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 769c8ea..9ce3d94 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -4505,16 +4505,6 @@ static void rna_def_gpu_fx(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "fx_flag", GPU_FX_FLAG_SSAO);
 	RNA_def_property_ui_text(prop, "SSAO", "Use screen space ambient occlusion of field on viewport");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUFXSettings_fx_update");
-
-    prop = RNA_def_property(srna, "lens_dist", PROP_POINTER, PROP_NONE);
-	RNA_def_property_flag(prop, PROP_NEVER_NULL);
-	RNA_def_property_struct_type(prop, "GPULensDistortionSettings");
-	RNA_def_property_ui_text(prop, "Lens Distortion settings", "");
-
-	prop = RNA_def_property(srna, "use_lens_dist", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "fx_flag", GPU_FX_FLAG_LensDist);
-	RNA_def_property_ui_text(prop, "Lens Distortion", "Use screen space Lens Distortion on viewport for HMD correction");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPUFXSettings_fx_update");
 }




More information about the Bf-blender-cvs mailing list