Blender V4.5
eevee_volume.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
12
13#include "GPU_capabilities.hh"
14
15#include "GPU_debug.hh"
16
17#include "eevee_instance.hh"
18#include "eevee_pipeline.hh"
19
20#include "eevee_volume.hh"
21
22namespace blender::eevee {
23
25{
26 enabled_ = false;
27
28 const Scene *scene_eval = inst_.scene;
29
30 const int2 extent = inst_.film.render_extent_get();
31 int tile_size = clamp_i(scene_eval->eevee.volumetric_tile_size, 1, 16);
32
33 int3 tex_size;
34 /* Try to match resolution setting but fall back to lower resolution
35 * if it doesn't fit the hardware limits. */
36 for (; tile_size <= 16; tile_size *= 2) {
37 /* Find Froxel Texture resolution. */
38 tex_size = int3(math::divide_ceil(extent, int2(tile_size)), 0);
39 tex_size.z = std::max(1, scene_eval->eevee.volumetric_samples);
40
41 if (math::reduce_max(tex_size) < GPU_max_texture_3d_size()) {
42 /* Fits hardware limits. */
43 break;
44 }
45 }
46
47 if (tile_size != scene_eval->eevee.volumetric_tile_size) {
48 inst_.info_append_i18n(
49 "Warning: Volume rendering data could not be allocated. Now using a resolution of 1:{} "
50 "instead of 1:{}.",
51 tile_size,
52 scene_eval->eevee.volumetric_tile_size);
53 }
54
55 data_.tile_size = tile_size;
56 data_.tile_size_lod = int(log2(tile_size));
57 data_.coord_scale = float2(extent) / float2(tile_size * tex_size);
58 data_.main_view_extent = float2(extent);
59 data_.main_view_extent_inv = 1.0f / float2(extent);
60 data_.tex_size = tex_size;
61 data_.inv_tex_size = 1.0f / float3(tex_size);
62
63 const bool shadow_enabled = (scene_eval->eevee.flag & SCE_EEVEE_VOLUMETRIC_SHADOWS) != 0;
64 data_.shadow_steps = (shadow_enabled) ? scene_eval->eevee.volumetric_shadow_samples : 0;
65
66 data_.light_clamp = scene_eval->eevee.volumetric_light_clamp;
67 data_.light_clamp = (data_.light_clamp > 0.0) ? data_.light_clamp : 1e20;
68
69 use_reprojection_ = (scene_eval->eevee.flag & SCE_EEVEE_TAA_REPROJECTION) != 0;
70}
71
73{
74 previous_objects_ = current_objects_;
75 current_objects_.clear();
76}
77
78void VolumeModule::world_sync(const WorldHandle &world_handle)
79{
80 if (!use_reprojection_) {
81 return;
82 }
83
84 if (world_handle.recalc && !inst_.is_playback) {
85 valid_history_ = false;
86 }
87}
88
90{
91 current_objects_.add(ob_handle.object_key);
92
93 if (!use_reprojection_) {
94 return;
95 }
96
97 if (ob_handle.recalc && !inst_.is_playback) {
98 valid_history_ = false;
99 }
100}
101
103{
104 return inst_.world.has_volume() || !current_objects_.is_empty() ||
105 inst_.film.get_data().volume_light_id != -1;
106}
107
109{
110 enabled_ = will_enable();
111
112 const Scene *scene_eval = inst_.scene;
113
114 const bool custom_range = scene_eval->eevee.flag & SCE_EEVEE_VOLUME_CUSTOM_RANGE;
115 const float camera_clip_start = inst_.camera.data_get().clip_near;
116 const float camera_clip_end = inst_.camera.data_get().clip_far;
117 float integration_start = custom_range ? scene_eval->eevee.volumetric_start : camera_clip_start;
118 float integration_end = custom_range ? scene_eval->eevee.volumetric_end : camera_clip_end;
119
120 if (!inst_.camera.is_camera_object() && inst_.camera.is_orthographic()) {
121 integration_start = -integration_end;
122 }
123
124 std::optional<Bounds<float>> volume_bounds = inst_.pipelines.volume.object_integration_range();
125 if (volume_bounds && !inst_.world.has_volume()) {
126 /* Restrict integration range to the object volume range. This increases precision. */
127 integration_start = math::max(integration_start, -volume_bounds.value().max);
128 integration_end = math::min(integration_end, -volume_bounds.value().min);
129 }
130
131 /* Negate clip values (View matrix forward vector is -Z). */
132 float near = -math::max(integration_start, camera_clip_start - 1e-4f);
133 float far = -math::min(integration_end, camera_clip_end + 1e-4f);
134
135 if (assign_if_different(history_camera_is_perspective_, inst_.camera.is_perspective())) {
136 /* Currently, the re-projection uses the same path for volume_z_to_view_z conversion for both
137 * the current view and the history view. Moreover, re-projecting in this huge change is more
138 * detrimental than anything. */
139 valid_history_ = false;
140 }
141
142 if (valid_history_) {
143 /* Avoid the (potentially expensive) check if valid_history_ is already false. */
144 if (current_objects_ != previous_objects_) {
145 valid_history_ = false;
146 }
147 }
148
149 if (inst_.camera.is_perspective()) {
150 float sample_distribution = scene_eval->eevee.volumetric_sample_distribution;
151 sample_distribution = 4.0f * math::max(1.0f - sample_distribution, 1e-2f);
152
153 data_.depth_near = (far - near * exp2(1.0f / sample_distribution)) / (far - near);
154 data_.depth_far = (1.0f - data_.depth_near) / near;
155 data_.depth_distribution = sample_distribution;
156 }
157 else {
158 data_.depth_near = near;
159 data_.depth_far = far;
160 data_.depth_distribution = 0.0f; /* Unused. */
161 }
162
163 if (!enabled_) {
164 occupancy_tx_.free();
165 prop_scattering_tx_.free();
166 prop_extinction_tx_.free();
167 prop_emission_tx_.free();
168 prop_phase_tx_.free();
169 prop_phase_weight_tx_.free();
170 scatter_tx_.current().free();
171 scatter_tx_.previous().free();
172 extinction_tx_.current().free();
173 extinction_tx_.previous().free();
174 integrated_scatter_tx_.free();
175 integrated_transmit_tx_.free();
176
177 /* Update references for bindings. */
178 result.scattering_tx_ = dummy_scatter_tx_;
179 result.transmittance_tx_ = dummy_transmit_tx_;
180 /* These shouldn't be used. */
181 properties.scattering_tx_ = nullptr;
182 properties.extinction_tx_ = nullptr;
183 properties.emission_tx_ = nullptr;
184 properties.phase_tx_ = nullptr;
185 properties.phase_weight_tx_ = nullptr;
186 properties.occupancy_tx_ = nullptr;
187 occupancy.occupancy_tx_ = nullptr;
188 occupancy.hit_depth_tx_ = nullptr;
189 occupancy.hit_count_tx_ = nullptr;
190
191 /* Avoid undefined re-projection behavior. */
192 valid_history_ = false;
193 return;
194 }
195
196 bool has_scatter = inst_.world.has_volume_scatter() || inst_.pipelines.volume.has_scatter();
197 bool has_absorption = inst_.world.has_volume_absorption() ||
198 inst_.pipelines.volume.has_absorption();
199 use_lights_ = has_scatter;
200 /* TODO(fclem): Allocate extinction texture as dummy (1px^3) if has_absorption are false. */
201 UNUSED_VARS(has_absorption);
202
205
206 prop_scattering_tx_.ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
207 prop_extinction_tx_.ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
208 prop_emission_tx_.ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
209 /* We need 2 separate images to prevent bugs in Nvidia drivers (See #122454). */
210 prop_phase_tx_.ensure_3d(GPU_R16F, data_.tex_size, usage);
211 prop_phase_weight_tx_.ensure_3d(GPU_R16F, data_.tex_size, usage);
212
213 int occupancy_layers = divide_ceil_u(data_.tex_size.z, 32u);
216 occupancy_tx_.ensure_3d(GPU_R32UI, int3(data_.tex_size.xy(), occupancy_layers), occupancy_usage);
217
218 {
223 int2 hit_list_size = int2(1);
224 int hit_list_layer = 1;
225 if (inst_.pipelines.volume.use_hit_list()) {
226 hit_list_layer = clamp_i(inst_.scene->eevee.volumetric_ray_depth, 1, 16);
227 hit_list_size = data_.tex_size.xy();
228 }
229 hit_depth_tx_.ensure_3d(GPU_R32F, int3(hit_list_size, hit_list_layer), hit_depth_usage);
230 if (hit_count_tx_.ensure_2d(GPU_R32UI, hit_list_size, hit_count_usage)) {
231 hit_count_tx_.clear(uint4(0u));
232 }
233 }
234
237 front_depth_tx_.ensure_2d(GPU_DEPTH32F_STENCIL8, data_.tex_size.xy(), front_depth_usage);
238 occupancy_fb_.ensure(GPU_ATTACHMENT_TEXTURE(front_depth_tx_));
239
240 bool created = false;
241 created |= scatter_tx_.current().ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
242 created |= extinction_tx_.current().ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
243 created |= scatter_tx_.previous().ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
244 created |= extinction_tx_.previous().ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
245
246 if (created) {
247 valid_history_ = false;
248 }
249
250 integrated_scatter_tx_.ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
251 integrated_transmit_tx_.ensure_3d(GPU_R11F_G11F_B10F, data_.tex_size, usage);
252
253 /* Update references for bindings. */
254 result.scattering_tx_ = integrated_scatter_tx_;
255 result.transmittance_tx_ = integrated_transmit_tx_;
256 properties.scattering_tx_ = prop_scattering_tx_;
257 properties.extinction_tx_ = prop_extinction_tx_;
258 properties.emission_tx_ = prop_emission_tx_;
259 properties.phase_tx_ = prop_phase_tx_;
260 properties.phase_weight_tx_ = prop_phase_weight_tx_;
261 properties.occupancy_tx_ = occupancy_tx_;
262 occupancy.occupancy_tx_ = occupancy_tx_;
263 occupancy.hit_depth_tx_ = hit_depth_tx_;
264 occupancy.hit_count_tx_ = hit_count_tx_;
265
266 /* Set extend mode to extend and reject invalid samples in the shader.
267 * This avoids some black rim artifacts near the edge of the re-projected volume.
268 * Filter linear to avoid sharp artifacts during re-projection. */
269 const GPUSamplerState history_sampler = {GPU_SAMPLER_FILTERING_LINEAR,
272 scatter_ps_.init();
273 scatter_ps_.shader_set(
274 inst_.shaders.static_shader_get(use_lights_ ? VOLUME_SCATTER_WITH_LIGHTS : VOLUME_SCATTER));
275 scatter_ps_.bind_resources(inst_.lights);
276 scatter_ps_.bind_resources(inst_.sphere_probes);
277 scatter_ps_.bind_resources(inst_.volume_probes);
278 scatter_ps_.bind_resources(inst_.shadows);
279 scatter_ps_.bind_resources(inst_.uniform_data);
280 scatter_ps_.bind_resources(inst_.sampling);
281 scatter_ps_.bind_image("in_scattering_img", &prop_scattering_tx_);
282 scatter_ps_.bind_image("in_extinction_img", &prop_extinction_tx_);
283 scatter_ps_.bind_texture("extinction_tx", &prop_extinction_tx_);
284 scatter_ps_.bind_image("in_emission_img", &prop_emission_tx_);
285 scatter_ps_.bind_image("in_phase_img", &prop_phase_tx_);
286 scatter_ps_.bind_image("in_phase_weight_img", &prop_phase_weight_tx_);
287 scatter_ps_.bind_texture("scattering_history_tx", &scatter_tx_.previous(), history_sampler);
288 scatter_ps_.bind_texture("extinction_history_tx", &extinction_tx_.previous(), history_sampler);
289 scatter_ps_.bind_image("out_scattering_img", &scatter_tx_.current());
290 scatter_ps_.bind_image("out_extinction_img", &extinction_tx_.current());
291 scatter_ps_.bind_texture(RBUFS_UTILITY_TEX_SLOT, inst_.pipelines.utility_tx);
292 /* Sync with the property pass. */
294 scatter_ps_.dispatch(math::divide_ceil(data_.tex_size, int3(VOLUME_GROUP_SIZE)));
295
296 integration_ps_.init();
297 integration_ps_.shader_set(inst_.shaders.static_shader_get(VOLUME_INTEGRATION));
298 integration_ps_.bind_resources(inst_.uniform_data);
299 integration_ps_.bind_resources(inst_.sampling);
300 integration_ps_.bind_texture("in_scattering_tx", &scatter_tx_.current());
301 integration_ps_.bind_texture("in_extinction_tx", &extinction_tx_.current());
302 integration_ps_.bind_image("out_scattering_img", &integrated_scatter_tx_);
303 integration_ps_.bind_image("out_transmittance_img", &integrated_transmit_tx_);
304 /* Sync with the scatter pass. */
305 integration_ps_.barrier(GPU_BARRIER_TEXTURE_FETCH);
306 integration_ps_.dispatch(
308
309 resolve_ps_.init();
310 resolve_ps_.state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_CUSTOM);
311 resolve_ps_.shader_set(inst_.shaders.static_shader_get(VOLUME_RESOLVE));
312 resolve_ps_.bind_resources(inst_.uniform_data);
313 resolve_ps_.bind_resources(this->result);
314 resolve_ps_.bind_resources(inst_.hiz_buffer.front);
315 resolve_ps_.bind_image(RBUFS_COLOR_SLOT, &inst_.render_buffers.rp_color_tx);
316 resolve_ps_.bind_image(RBUFS_VALUE_SLOT, &inst_.render_buffers.rp_value_tx);
317 /* Sync with the integration pass. */
318 resolve_ps_.barrier(GPU_BARRIER_TEXTURE_FETCH);
319 resolve_ps_.draw_procedural(GPU_PRIM_TRIS, 1, 3);
320}
321
323{
324 if (!enabled_) {
325 return;
326 }
327
328 /* Number of frame to consider for blending with exponential (infinite) average. */
329 int exponential_frame_count = 16;
330 if (inst_.is_image_render) {
331 /* Disable reprojection for rendering. */
332 exponential_frame_count = 0;
333 }
334 else if (!use_reprojection_) {
335 /* No re-projection if TAA is disabled. */
336 exponential_frame_count = 0;
337 }
338 else if (inst_.is_playback) {
339 /* For now, we assume we want responsiveness for volume animation.
340 * But this makes general animation inside uniform volumes less stable.
341 * When we introduce updated volume tagging, we will be able to increase this for general
342 * playback. */
343 exponential_frame_count = 3;
344 }
345 else if (inst_.is_transforming) {
346 /* Improve responsiveness of volume if we are transforming objects. */
347 /* TODO(fclem): This is too general as it will be triggered even for non volume object.
348 * Instead, we should tag which areas of the volume that need increased responsiveness. */
349 exponential_frame_count = 3;
350 }
351 else if (inst_.is_navigating) {
352 /* Navigation is usually smooth because of the re-projection but we can get ghosting
353 * artifacts on lights because of voxels stretched in Z or anisotropy. */
354 exponential_frame_count = 8;
355 }
356 else if (inst_.is_viewport() && inst_.sampling.is_reset()) {
357 /* If we are not falling in any cases above, this usually means there is a scene or object
358 * parameter update. Reset accumulation completely. */
359 exponential_frame_count = 0;
360 }
361
362 if (!valid_history_) {
363 history_frame_count_ = 0;
364 }
365 /* Interactive mode accumulate samples using exponential average.
366 * We still reuse the history when we go into static mode.
367 * However, using re-projection for static mode will show the precision limit of RG11B10 format.
368 * So we clamp it to the exponential frame count in any case. */
369 history_frame_count_ = math::min(history_frame_count_, exponential_frame_count);
370
371 /* In interactive mode, use exponential average (fixed ratio).
372 * For static / render mode use simple average (moving ratio). */
373 float history_opacity = history_frame_count_ / (history_frame_count_ + 1.0f);
374
375 /* Setting opacity to 0.0 will bypass any sampling of history buffer.
376 * Allowing us to skip the 3D texture clear. */
377 data_.history_opacity = (valid_history_) ? history_opacity : 0.0f;
378
379 float left, right, bottom, top, near, far;
380 projmat_dimensions(main_view.winmat().ptr(), &left, &right, &bottom, &top, &near, &far);
381
382 /* Just like up-sampling matrix computation, we have to be careful to where to put the bounds of
383 * our froxel volume so that a 2D pixel covers exactly the number of pixel in a tile. */
384 float2 render_size = float2(right - left, top - bottom);
385 float2 volume_size = render_size * float2(data_.tex_size.xy() * data_.tile_size) /
386 float2(inst_.film.render_extent_get());
387 /* Change to the padded extends. */
388 right = left + volume_size.x;
389 top = bottom + volume_size.y;
390
391 float4x4 winmat_infinite, winmat_finite;
392 /* Create an infinite projection matrix to avoid far clipping plane clipping the object. This
393 * way, surfaces that are further away than the far clip plane will still be voxelized. */
394 winmat_infinite = main_view.is_persp() ?
395 math::projection::perspective_infinite(left, right, bottom, top, near) :
396 math::projection::orthographic_infinite(left, right, bottom, top, near);
397 /* We still need a bounded projection matrix to get correct froxel location. */
398 winmat_finite = main_view.is_persp() ?
399 math::projection::perspective(left, right, bottom, top, near, far) :
400 math::projection::orthographic(left, right, bottom, top, near, far);
401 /* Save non-jittered finite matrix for re-projection. */
402 data_.winmat_stable = winmat_finite;
403 data_.wininv_stable = math::invert(winmat_finite);
404
405 /* Anti-Aliasing / Super-Sampling jitter. */
406 float2 jitter = inst_.sampling.rng_2d_get(SAMPLING_VOLUME_U);
407 /* Wrap to keep first sample centered (0,0) and scale to convert to NDC. */
408 jitter = math::fract(jitter + 0.5f) * 2.0f - 1.0f;
409 /* Convert to pixel size. */
410 jitter *= data_.inv_tex_size.xy();
411 /* Apply jitter to both matrices. */
412 winmat_infinite = math::projection::translate(winmat_infinite, jitter);
413 winmat_finite = math::projection::translate(winmat_finite, jitter);
414
415 data_.winmat_finite = winmat_finite;
416 data_.wininv_finite = math::invert(winmat_finite);
417
418 /* Compute re-projection matrix. */
419 data_.curr_view_to_past_view = history_viewmat_ * main_view.viewinv();
420
421 inst_.uniform_data.push_update();
422
423 GPU_debug_group_begin("Volumes");
424 occupancy_fb_.bind();
425 inst_.pipelines.world_volume.render(main_view);
426
427 volume_view.sync(main_view.viewmat(), winmat_infinite);
428 /* TODO(fclem): The infinite projection matrix makes the culling test unreliable (see #115595).
429 * We need custom culling for these but that's not implemented yet. */
430 volume_view.visibility_test(false);
431
432 if (!current_objects_.is_empty()) {
433 inst_.pipelines.volume.render(volume_view, occupancy_tx_);
434 }
436}
437
438void VolumeModule::draw_compute(View &main_view, int2 extent)
439{
440 if (!enabled_) {
441 return;
442 }
443
444 if (inst_.pipelines.deferred.is_empty()) {
445 /* This assume the volume are computed after deferred passes. This is needed to avoid broken
446 * lighting and shadowing as the lights are not setup otherwise (see #121971). */
447 inst_.hiz_buffer.swap_layer();
448 inst_.hiz_buffer.update();
449 inst_.volume_probes.set_view(main_view);
450 inst_.sphere_probes.set_view(main_view);
451 inst_.shadows.set_view(main_view, extent);
452 }
453
454 scatter_tx_.swap();
455 extinction_tx_.swap();
456
457 inst_.manager->submit(scatter_ps_, main_view);
458 inst_.manager->submit(integration_ps_, main_view);
459
460 /* Copy history data. */
461 history_viewmat_ = main_view.viewmat();
462 data_.history_depth_near = data_.depth_near;
463 data_.history_depth_far = data_.depth_far;
464 data_.history_depth_distribution = data_.depth_distribution;
465 data_.history_winmat_stable = data_.winmat_stable;
466 valid_history_ = true;
467 history_frame_count_ += 1;
468}
469
471{
472 if (!enabled_) {
473 return;
474 }
475
476 inst_.hiz_buffer.update();
477
478 resolve_fb_.ensure(GPU_ATTACHMENT_NONE,
479 GPU_ATTACHMENT_TEXTURE(inst_.render_buffers.combined_tx));
480 resolve_fb_.bind();
481 inst_.manager->submit(resolve_ps_, view);
482}
483
484} // namespace blender::eevee
MINLINE uint divide_ceil_u(uint a, uint b)
MINLINE int clamp_i(int value, int min, int max)
void projmat_dimensions(const float winmat[4][4], float *r_left, float *r_right, float *r_bottom, float *r_top, float *r_near, float *r_far)
#define UNUSED_VARS(...)
@ SCE_EEVEE_VOLUME_CUSTOM_RANGE
@ SCE_EEVEE_VOLUMETRIC_SHADOWS
@ SCE_EEVEE_TAA_REPROJECTION
static AppView * view
int GPU_max_texture_3d_size()
void GPU_debug_group_end()
Definition gpu_debug.cc:33
void GPU_debug_group_begin(const char *name)
Definition gpu_debug.cc:22
#define GPU_ATTACHMENT_TEXTURE(_texture)
#define GPU_ATTACHMENT_NONE
@ GPU_PRIM_TRIS
@ GPU_BARRIER_TEXTURE_FETCH
Definition GPU_state.hh:37
@ GPU_BARRIER_SHADER_IMAGE_ACCESS
Definition GPU_state.hh:35
eGPUTextureUsage
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_TEXTURE_USAGE_ATOMIC
@ GPU_SAMPLER_EXTEND_MODE_EXTEND
@ GPU_DEPTH32F_STENCIL8
@ GPU_R32F
@ GPU_R16F
@ GPU_R32UI
@ GPU_R11F_G11F_B10F
@ GPU_SAMPLER_FILTERING_LINEAR
bool is_persp(int view_id=0) const
Definition draw_view.hh:93
const float4x4 & winmat(int view_id=0) const
Definition draw_view.hh:148
const float4x4 & viewmat(int view_id=0) const
Definition draw_view.hh:136
const float4x4 & viewinv(int view_id=0) const
Definition draw_view.hh:142
void object_sync(const ObjectHandle &ob_handle)
void world_sync(const WorldHandle &world_handle)
struct blender::eevee::VolumeModule::@352153221175204257045062313254237161234342201002 occupancy
struct blender::eevee::VolumeModule::@371265030144176335353130035105177227164117161155 properties
void draw_compute(View &main_view, int2 extent)
struct blender::eevee::VolumeModule::@215032374165261147333173176262124367334320352300 result
void draw_prepass(View &main_view)
@ DRW_STATE_WRITE_COLOR
Definition draw_state.hh:30
@ DRW_STATE_BLEND_CUSTOM
Definition draw_state.hh:63
#define RBUFS_UTILITY_TEX_SLOT
#define VOLUME_GROUP_SIZE
#define RBUFS_VALUE_SLOT
#define RBUFS_COLOR_SLOT
#define VOLUME_INTEGRATION_GROUP_SIZE
uint top
#define exp2
#define log2
static int left
MatBase< T, 4, 4 > orthographic(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, 4, 4 > orthographic_infinite(T left, T right, T bottom, T top)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, 4, 4 > translate(const MatBase< T, 4, 4 > &mat, const VecBase< T, 2 > &offset)
Translate a projection matrix after creation in the screen plane. Usually used for anti-aliasing jitt...
MatBase< T, 4, 4 > perspective_infinite(T left, T right, T bottom, T top, T near_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
MatBase< T, 4, 4 > perspective(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
T reduce_max(const VecBase< T, Size > &a)
VecBase< T, Size > divide_ceil(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
T min(const T &a, const T &b)
CartesianBasis invert(const CartesianBasis &basis)
T fract(const T &a)
T max(const T &a, const T &b)
VecBase< uint32_t, 4 > uint4
bool assign_if_different(T &old_value, T new_value)
MatBase< float, 4, 4 > float4x4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
VecBase< float, 3 > float3
float volumetric_light_clamp
float volumetric_sample_distribution
int volumetric_shadow_samples
struct SceneEEVEE eevee
const c_style_mat & ptr() const
VecBase< T, 2 > xy() const