Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/object_mode.c
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
| #include "GPU_texture.h" | #include "GPU_texture.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "draw_mode_engines.h" | #include "draw_mode_engines.h" | ||||
| #include "draw_manager_text.h" | #include "draw_manager_text.h" | ||||
| #include "draw_common.h" | #include "draw_common.h" | ||||
| #include "DEG_depsgraph_query.h" | |||||
| extern struct GPUUniformBuffer *globals_ubo; /* draw_common.c */ | extern struct GPUUniformBuffer *globals_ubo; /* draw_common.c */ | ||||
| extern struct GPUTexture *globals_ramp; /* draw_common.c */ | extern struct GPUTexture *globals_ramp; /* draw_common.c */ | ||||
| extern GlobalsUboStorage ts; | extern GlobalsUboStorage ts; | ||||
| extern char datatoc_object_outline_resolve_frag_glsl[]; | extern char datatoc_object_outline_resolve_frag_glsl[]; | ||||
| extern char datatoc_object_outline_detect_frag_glsl[]; | extern char datatoc_object_outline_detect_frag_glsl[]; | ||||
| extern char datatoc_object_outline_expand_frag_glsl[]; | extern char datatoc_object_outline_expand_frag_glsl[]; | ||||
| extern char datatoc_object_grid_frag_glsl[]; | extern char datatoc_object_grid_frag_glsl[]; | ||||
| ▲ Show 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | if (((rv3d->view == RV3D_VIEW_USER) || (rv3d->persp != RV3D_ORTHO)) && show_axis_z) { | ||||
| e_data.zplane_axes[1] = (float)((e_data.zpos_flag & (PLANE_YZ | PLANE_XY)) != 0); | e_data.zplane_axes[1] = (float)((e_data.zpos_flag & (PLANE_YZ | PLANE_XY)) != 0); | ||||
| e_data.zplane_axes[2] = (float)((e_data.zpos_flag & (PLANE_YZ | PLANE_XZ)) != 0); | e_data.zplane_axes[2] = (float)((e_data.zpos_flag & (PLANE_YZ | PLANE_XZ)) != 0); | ||||
| } | } | ||||
| else { | else { | ||||
| e_data.zneg_flag = e_data.zpos_flag = CLIP_ZNEG | CLIP_ZPOS; | e_data.zneg_flag = e_data.zpos_flag = CLIP_ZNEG | CLIP_ZPOS; | ||||
| } | } | ||||
| float dist = (rv3d->persp == RV3D_CAMOB && v3d->camera) | float dist; | ||||
| ? ((Camera *)v3d->camera)->clipend : v3d->far; | if (rv3d->persp == RV3D_CAMOB && v3d->camera) { | ||||
| Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera); | |||||
| dist = ((Camera *)camera_object)->clipend; | |||||
| } | |||||
| else { | |||||
| dist = v3d->far; | |||||
| } | |||||
| e_data.grid_settings[0] = dist / 2.0f; /* gridDistance */ | e_data.grid_settings[0] = dist / 2.0f; /* gridDistance */ | ||||
| e_data.grid_settings[1] = grid_res; /* gridResolution */ | e_data.grid_settings[1] = grid_res; /* gridResolution */ | ||||
| e_data.grid_settings[2] = grid_scale; /* gridScale */ | e_data.grid_settings[2] = grid_scale; /* gridScale */ | ||||
| e_data.grid_settings[3] = v3d->gridsubdiv; /* gridSubdiv */ | e_data.grid_settings[3] = v3d->gridsubdiv; /* gridSubdiv */ | ||||
| e_data.grid_settings[4] = (v3d->gridsubdiv > 1) ? 1.0f / logf(v3d->gridsubdiv) : 0.0f; /* 1/log(gridSubdiv) */ | e_data.grid_settings[4] = (v3d->gridsubdiv > 1) ? 1.0f / logf(v3d->gridsubdiv) : 0.0f; /* 1/log(gridSubdiv) */ | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,497 Lines • Show Last 20 Lines | |||||