[Bf-blender-cvs] [4b763f4cb2e] soc-2018-npr: Fixing perpective flag

Nick Wu noreply at git.blender.org
Thu Aug 23 12:54:00 CEST 2018


Commit: 4b763f4cb2e7a80d0bbaf3bb26f717ef39a72882
Author: Nick Wu
Date:   Thu Aug 23 18:53:37 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB4b763f4cb2e7a80d0bbaf3bb26f717ef39a72882

Fixing perpective flag

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

M	source/blender/draw/engines/lanpr/lanpr_dpix.c

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

diff --git a/source/blender/draw/engines/lanpr/lanpr_dpix.c b/source/blender/draw/engines/lanpr/lanpr_dpix.c
index 634d59ad8f3..19930cc8c95 100644
--- a/source/blender/draw/engines/lanpr/lanpr_dpix.c
+++ b/source/blender/draw/engines/lanpr/lanpr_dpix.c
@@ -347,6 +347,7 @@ void lanpr_dpix_draw_scene(LANPR_TextureList *txl, LANPR_FramebufferList *fbl, L
 	float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
 	float clear_depth = 1.0f;
 	uint clear_stencil = 0xFF;
+	int is_persp=1;
 
 	if (!lanpr->active_layer) return; /* return early in case we don't have line layers. DPIX only use the first layer. */
 
@@ -360,15 +361,19 @@ void lanpr_dpix_draw_scene(LANPR_TextureList *txl, LANPR_FramebufferList *fbl, L
 	if (v3d) {
 		RegionView3D *rv3d = draw_ctx->rv3d;
 		camera = (rv3d && rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL;
+		is_persp = rv3d->is_persp;
 	}
 	if (!camera) {
 		camera = scene->camera;
+		if(!v3d)is_persp = ((Camera *)camera->data)->type == CAM_PERSP ? 1 : 0;
 	}
 	if (is_render && !camera) return;
 
+	//XXX: should implement view angle functions for ortho camera.
+
 	pd->dpix_viewport[2] = texw;
 	pd->dpix_viewport[3] = texh;
-	pd->dpix_is_perspective = 1;
+	pd->dpix_is_perspective = is_persp;
 	pd->dpix_sample_step = 1;
 	pd->dpix_buffer_width = TNS_DPIX_TEXTURE_SIZE;
 	pd->dpix_depth_offset = 0.0001;



More information about the Bf-blender-cvs mailing list