34 if (matcap_diffuse && matcap_diffuse->
float_data()) {
36 const float *buffer = matcap_diffuse->
float_data();
39 if (matcap_specular && matcap_specular->
float_data()) {
40 int size = matcap_diffuse->
x * matcap_diffuse->
y * 4;
43 buffer = combined_buffer.
begin();
48 gpu::TextureFormat::SFLOAT_16_16_16_16,
50 int2(matcap_diffuse->
x, matcap_diffuse->
y),
70 const float4x4 &world_shading_rotation)
92 const float total_samples_inv = 1.0f / total_samples;
95 for (
int x = 0;
x < 64;
x++) {
96 for (
int y = 0;
y < 64;
y++) {
103 bn =
clamp_f(bn, -0.499f, 0.499f);
104 jitter[
y][
x].z = bn * total_samples_inv;
150 if (studio_light ==
nullptr) {
164 for (
int i = 0; i < 4; i++) {
169 if (studio_light !=
nullptr) {
209 float4(0.0f, 0.0f, 0.0f, 0.0f));
214 float4(0.0f, 0.0f, 0.0f, 0.0f));
219 float4(0.0f, 0.0f, 0.0f, 0.0f));
constexpr IndexRange()=default
void extend(Span< T > array)
bool ensure_2d(gpu::TextureFormat format, int2 extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1)
Texture(const char *name="gpu::Texture")
bool ensure_1d_array(gpu::TextureFormat format, int extent, int layers, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1)
bool ensure_2d_array(gpu::TextureFormat format, int2 extent, int layers, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1)
static View & default_get()
const float4x4 & viewmat(int view_id=0) const
void init(const SceneState &scene_state, SceneResources &resources)
const float blue_noise[64][64][4]
T cos(const AngleRadianBase< T > &a)
T sin(const AngleRadianBase< T > &a)
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
static bool get_matcap_tx(Texture &matcap_tx, StudioLight &studio_light)
static float4x4 get_world_shading_rotation_matrix(float studiolight_rot_z)
static SolidLightData get_light_data_from_studio_solidlight(const SolidLight *sl, const float4x4 &world_shading_rotation)
@ STUDIOLIGHT_TYPE_MATCAP
@ STUDIOLIGHT_MATCAP_SPECULAR_GPUTEXTURE
@ STUDIOLIGHT_TYPE_STUDIO
@ STUDIOLIGHT_MATCAP_DIFFUSE_GPUTEXTURE
@ STUDIOLIGHT_SPECULAR_HIGHLIGHT_PASS
void BKE_studiolight_ensure_flag(StudioLight *sl, int flag)
gpu::Batch * GPU_batch_unit_cube() ATTR_WARN_UNUSED_RESULT
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
MatBase< float, 4, 4 > float4x4
@ V3D_SHADING_WORLD_ORIENTATION
@ V3D_SHADING_MATCAP_FLIP_X
@ V3D_SHADING_SPECULAR_HIGHLIGHT
struct StudioLight * BKE_studiolight_find(const char *name, int flag)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
@ GPU_TEXTURE_USAGE_SHADER_READ
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE void negate_v3(float r[3])
void axis_angle_to_mat4_single(float R[4][4], char axis, float angle)
gpu::Texture * GPU_texture_create_error(int dimension, bool array)
VecBase< float, 3 > float3
const char * IMB_colormanagement_working_space_get()
StudioLight * BKE_studiolight_studio_edit_get()
MINLINE float clamp_f(float value, float min, float max)
float4 diffuse_color_wrap
float4 object_outline_color
struct SolidLightData lights[4]
bool is_image_render() const
float2 viewport_size_get() const
const float * float_data() const
static MatBase identity()
StudioLightImage matcap_specular
StudioLightImage matcap_diffuse
SolidLight light[STUDIOLIGHT_MAX_LIGHT]
float object_outline_color[3]
eV3DShadingLightingMode light
static const int jitter_tx_size
UniformBuffer< WorldData > world_buf
void load_jitter_tx(int total_samples)
MaterialTexture missing_texture
gpu::Batch * volume_cube_batch
Texture dummy_tile_array_tx
void init(const SceneState &scene_state, const DRWContext *ctx)
std::string current_matcap_working_space
Texture dummy_tile_data_tx
UniformArrayBuffer< float4, 6 > clip_planes_buf
StringRefNull current_matcap
Vector< float4 > clip_planes
CCL_NAMESPACE_BEGIN struct Window V