[Bf-blender-cvs] [3b89d726cac] lineart-shadow: Merge branch 'temp-lineart-contained' into lineart-shadow

YimingWu noreply at git.blender.org
Sat Jul 31 02:38:43 CEST 2021


Commit: 3b89d726cacec21c0c0c20bbe479deba5ce4b26d
Author: YimingWu
Date:   Sat Jul 31 08:38:26 2021 +0800
Branches: lineart-shadow
https://developer.blender.org/rB3b89d726cacec21c0c0c20bbe479deba5ce4b26d

Merge branch 'temp-lineart-contained' into lineart-shadow

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



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

diff --cc source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index b07165a25eb,297a0f7ff16..470e118daaa
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@@ -2189,36 -2170,42 +2189,36 @@@ static void lineart_main_load_geometrie
  {
    double proj[4][4], view[4][4], result[4][4];
    float inv[4][4];
 -  Camera *cam = camera->data;
 -  float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
 -  int fit = BKE_camera_sensor_fit(cam->sensor_fit, rb->w, rb->h);
 -  double asp = ((double)rb->w / (double)rb->h);
  
 -  int bound_box_discard_count = 0;
 -
 -  if (cam->type == CAM_PERSP) {
 -    if (fit == CAMERA_SENSOR_FIT_VERT && asp > 1) {
 -      sensor *= asp;
 +  if (!do_shadow_casting) {
 +    Camera *cam = camera->data;
 +    float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y);
 +    int fit = BKE_camera_sensor_fit(cam->sensor_fit, rb->w, rb->h);
 +    double asp = ((double)rb->w / (double)rb->h);
 +    if (cam->type == CAM_PERSP) {
 +      if (fit == CAMERA_SENSOR_FIT_VERT && asp > 1) {
 +        sensor *= asp;
 +      }
 +      if (fit == CAMERA_SENSOR_FIT_HOR && asp < 1) {
 +        sensor /= asp;
 +      }
-       double fov = focallength_to_fov(cam->lens / (1 + rb->overscan), sensor);
++      const double fov = focallength_to_fov(cam->lens / (1 + rb->overscan), sensor);
 +      lineart_matrix_perspective_44d(proj, fov, asp, cam->clip_start, cam->clip_end);
      }
 -    if (fit == CAMERA_SENSOR_FIT_HOR && asp < 1) {
 -      sensor /= asp;
 +    else if (cam->type == CAM_ORTHO) {
-       double w = cam->ortho_scale / 2;
++      const double w = cam->ortho_scale / 2;
 +      lineart_matrix_ortho_44d(proj, -w, w, -w / asp, w / asp, cam->clip_start, cam->clip_end);
      }
 -    const double fov = focallength_to_fov(cam->lens / (1 + rb->overscan), sensor);
 -    lineart_matrix_perspective_44d(proj, fov, asp, cam->clip_start, cam->clip_end);
 -  }
 -  else if (cam->type == CAM_ORTHO) {
 -    const double w = cam->ortho_scale / 2;
 -    lineart_matrix_ortho_44d(proj, -w, w, -w / asp, w / asp, cam->clip_start, cam->clip_end);
 -  }
  
 -  double t_start;
 +    invert_m4_m4(inv, rb->cam_obmat);
 +    mul_m4db_m4db_m4fl_uniq(result, proj, inv);
 +    copy_m4_m4_db(proj, result);
 +    copy_m4_m4_db(rb->view_projection, proj);
  
 -  if (G.debug_value == 4000) {
 -    t_start = PIL_check_seconds_timer();
 +    unit_m4_db(view);
 +    copy_m4_m4_db(rb->view, view);
    }
  
 -  invert_m4_m4(inv, rb->cam_obmat);
 -  mul_m4db_m4db_m4fl_uniq(result, proj, inv);
 -  copy_m4_m4_db(proj, result);
 -  copy_m4_m4_db(rb->view_projection, proj);
 -
 -  unit_m4_db(view);
 -  copy_m4_m4_db(rb->view, view);
 -
    BLI_listbase_clear(&rb->triangle_buffer_pointers);
    BLI_listbase_clear(&rb->vertex_buffer_pointers);
  
diff --cc source/blender/makesdna/DNA_lineart_types.h
index b7cbd73ab8b,d919c041cfe..4bb7a578c04
--- a/source/blender/makesdna/DNA_lineart_types.h
+++ b/source/blender/makesdna/DNA_lineart_types.h
@@@ -85,8 -79,6 +84,6 @@@ typedef enum eLineartEdgeFlag 
    /** Limited to 16 bits for the entire thing. */
  } eLineartEdgeFlag;
  
 -#define LRT_EDGE_FLAG_ALL_TYPE 0x7f
 +#define LRT_EDGE_FLAG_ALL_TYPE 0x01ff
  #define LRT_EDGE_FLAG_INIT_TYPE 0x37 /* Without material & light contour */
  #define LRT_EDGE_FLAG_TYPE_MAX_BITS 7
- 
- #endif



More information about the Bf-blender-cvs mailing list