33 0.001f, 0.01f, 0.1f, 1.0f, 10.0f, 100.0f, 1000.0f, 10000.0f};
46 const bool background_enabled = is_uv_edit ? (!pd->
hide_overlays &&
50 if (background_enabled) {
55 if (background_enabled && draw_grid) {
89 float viewinv[4][4], wininv[4][4];
90 float viewmat[4][4], winmat[4][4];
128 float zvec[3], campos[3];
140 zneg_flag = zpos_flag;
144 if (((winmat[3][3] == 0.0f) && (campos[2] > 0.0f)) ||
145 ((winmat[3][3] != 0.0f) && (zvec[2] < 0.0f))) {
165 dist = ((
Camera *)(camera_object->
data))->clip_end;
174 if (winmat[3][3] == 0.0f) {
191 float viewinvscale =
len_v3(viewinv[0]);
198 grid->
steps[i][0] = grid_steps[i];
239 mat[0][0] = grid->
size[0];
240 mat[1][1] = grid->
size[1];
241 mat[2][2] = grid->
size[2];
279 float theme_color[4];
289 for (
int x = 0;
x < grid->
size[0];
x++) {
291 for (
int y = 0;
y < grid->
size[1];
y++) {
typedef float(TangentPoint)[2]
#define BLI_STATIC_ASSERT(a, msg)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void unit_m4(float m[4][4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
void interp_v4_v4v4(float r[4], const float a[4], const float b[4], float t)
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ SI_OVERLAY_SHOW_GRID_BACKGROUND
#define SI_GRID_STEPS_LEN
#define V3D_SHOW_ORTHO_GRID
#define V3D_XR_SESSION_MIRROR
#define V3D_XR_SESSION_SURFACE
#define DRW_PASS_CREATE(pass, state)
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
#define DRW_shgroup_call_obmat(shgroup, geom, obmat)
#define DRW_shgroup_call(shgroup, geom, ob)
void ED_space_image_grid_steps(struct SpaceImage *sima, float grid_steps[SI_GRID_STEPS_LEN], int grid_dimension)
bool ED_space_image_has_buffer(struct SpaceImage *sima)
float ED_space_image_zoom_level(const struct View2D *v2d, int grid_dimension)
void ED_view3d_grid_steps(const struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d, float r_grid_steps[8])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
struct GPUShader GPUShader
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
SyclQueue void void size_t num_bytes void
GPUBatch * DRW_cache_quad_get(void)
GPUBatch * DRW_cache_grid_get(void)
GPUBatch * DRW_cache_quad_wires_get(void)
bool DRW_state_is_fbo(void)
const DRWContextState * DRW_context_state_get(void)
DefaultTextureList * DRW_viewport_texture_list_get(void)
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
DRWShadingGroup * DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_draw_pass(DRWPass *pass)
ccl_gpu_kernel_postfix ccl_global float int int int int sh
void OVERLAY_grid_draw(OVERLAY_Data *vedata)
void OVERLAY_grid_init(OVERLAY_Data *vedata)
void OVERLAY_grid_cache_init(OVERLAY_Data *ved)
GPUShader * OVERLAY_shader_grid_background(void)
GPUShader * OVERLAY_shader_grid(void)
GPUShader * OVERLAY_shader_grid_image(void)
#define OVERLAY_GRID_STEPS_LEN
struct SpaceLink * space_data
struct Depsgraph * depsgraph
struct RegionView3D * rv3d
struct GPUUniformBuf * block_ubo
struct GPUTexture * depth
OVERLAY_StorageList * stl
OVERLAY_Instance * instance
float4 steps[OVERLAY_GRID_STEPS_LEN]
OVERLAY_GridBits grid_flag
OVERLAY_GridBits zneg_flag
struct OVERLAY_PrivateData::@248 grid
OVERLAY_GridData grid_data
OVERLAY_GridBits zpos_flag
struct OVERLAY_PrivateData * pd
SpaceImageOverlay overlay