18# if defined(__cplusplus) && !defined(GPU_SHADER)
27struct ViewCullingData;
35struct ObjectAttribute;
39struct DRWDebugPrintBuffer;
46# if defined(__cplusplus) && !defined(GPU_SHADER)
65#define DRW_SHADER_SHARED_H
85#if !defined(DRW_VIEW_LEN) && !defined(GLSL_CPP_STUBS)
87# define DRW_VIEW_LEN 1
88# define DRW_VIEW_SHIFT 0
89# define DRW_VIEW_FROM_RESOURCE_ID
100# define DRW_VIEW_SHIFT \
101 ((DRW_VIEW_LEN > 32) ? 6 : \
102 (DRW_VIEW_LEN > 16) ? 5 : \
103 (DRW_VIEW_LEN > 8) ? 4 : \
104 (DRW_VIEW_LEN > 4) ? 3 : \
105 (DRW_VIEW_LEN > 2) ? 2 : \
107# define DRW_VIEW_MASK ~(0xFFFFFFFFu << DRW_VIEW_SHIFT)
108# define DRW_VIEW_FROM_RESOURCE_ID drw_view_id = (drw_resource_id_raw() & DRW_VIEW_MASK)
142 return winmat[3][3] == 0.0f;
210 return ss_P * 2.0f - 1.0f;
218 return ndc_P * 0.5f + 0.5f;
228 return (to_float3x3(viewinv) * vN);
233 return (to_float3x3(viewmat) *
N);
245 return hs_P.xyz() / hs_P.
w;
260 return (
wininv * hP).xyz();
391 return normal() * lN;
396 return normal_inverse() *
N;
399 float3 normal_object_to_view(ViewMatrices view,
float3 lN)
const
401 return to_float3x3(view.
viewmat) * (normal() * lN);
404 float3 normal_view_to_object(ViewMatrices view,
float3 vN)
const
406 return normal_inverse() * (to_float3x3(view.
viewinv) * vN);
489 void sync(
const draw::ObjectRef ref,
bool is_active_object,
bool is_active_edit_mode);
523 void sync(
const Object &ob,
float inflate_bounds = 0.0f);
565#if !defined(GPU_SHADER)
570 for (
int i = 0; i < 3; ++i) {
631 bool sync(
const draw::ObjectRef &ref,
const GPUUniformAttr &attr,
int instance_index);
632 bool sync(
const draw::ObjectRef &ref,
const char *name,
bool use_dupli,
int instance_index);
652 bool sync(
const Scene *scene,
const ViewLayer *
layer,
const GPULayerAttr &attr);
658#if !defined(GPU_SHADER)
#define ENUM_OPERATORS(_enum_type)
#define BLI_STATIC_ASSERT_ALIGN(st, align)
bool drw_bounds_corners_are_valid(ObjectBounds bounds)
bool drw_bounds_are_valid(ObjectBounds bounds)
uint blocker_shadow_set_get(ObjectInfos object_infos)
uint receiver_light_set_get(ObjectInfos object_infos)
static constexpr int DRW_RESOURCE_CHUNK_LEN
@ OBJECT_ACTIVE_EDIT_MODE
static constexpr int DRW_ATTRIBUTE_PER_CURVES_MAX
static constexpr int DRW_GRID_PER_VOLUME_MAX
VecBase< float, D > normalize(VecOp< float, D >) RET
float dot(VecOp< float, D >, VecOp< float, D >) RET
MatBase< R, C > transpose(MatBase< C, R >) RET
T clamp(const T &a, const T &min, const T &max)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< float, 2 > float2
VecBase< float, 3 > float3
uint half_cylinder_face_count
struct ScalingRange splat_mean_range
struct ScalingRange splat_scale_range
struct ScalingRange radiance_base_range
struct ScalingRange radiance_sh_range
bool sync(const Scene *scene, const ViewLayer *layer, const GPULayerAttr &attr)
bool sync(const draw::ObjectRef &ref, const GPUUniformAttr &attr, int instance_index)
float4 bounding_corners[4]
float inner_sphere_radius() const
void inner_sphere_radius_set(float value)
enum eObjectInfoFlag flag
float shadow_terminator_normal_offset
uint light_and_shadow_set_membership
float shadow_terminator_geometry_offset
float3 point_view_to_object(ViewMatrices view, float3 vP) const
float3 point_object_to_view(ViewMatrices view, float3 lP) const
float3 point_world_to_object(float3 P) const
float3 point_object_to_world(float3 lP) const
float3 point_object_to_ndc(ViewMatrices view, float3 lP) const
float4 point_object_to_homogenous(ViewMatrices view, float3 lP) const
void sync(const Object &object)
float3 scale_to_unit(float3 value) const
float3 scale_from_unit(float3 value) const
struct FrustumPlanes frustum_planes
struct FrustumCorners frustum_corners
bool is_perspective() const
float3 point_homogeneous_to_view(float4 hP) const
float3 point_world_to_view(float3 P) const
float3 perspective_divide(float4 hs_P) const
float4 point_view_to_homogenous(float3 vP) const
float depth_screen_to_view(float ss_depth) const
T ndc_to_screen(T ndc_P) const
float4 point_world_to_homogenous(float3 P) const
float3 point_ndc_to_world(float3 ssP) const
float3 point_view_to_ndc(float3 vP) const
float3 point_screen_to_world(float3 ssP) const
T screen_to_ndc(T ss_P) const
float3 view_incident_vector(float3 vP) const
float z_distance(float3 P) const
float depth_view_to_screen(float v_depth) const
float3 point_world_to_ndc(float3 P) const
float3 point_homogeneous_to_world(float4 hP) const
float3 point_view_to_world(float3 vP) const
float3 point_view_to_screen(float3 vP) const
float3 world_incident_vector(float3 P) const
float3 point_ndc_to_view(float3 ssP) const
float3 point_screen_to_view(float3 ssP) const
float3 point_world_to_screen(float3 vP) const