Blender V5.0
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::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
207 prop_extinction_tx_.ensure_3d(gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
208 prop_emission_tx_.ensure_3d(gpu::TextureFormat::UFLOAT_11_11_10, 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::TextureFormat::SFLOAT_16, data_.tex_size, usage);
211 prop_phase_weight_tx_.ensure_3d(gpu::TextureFormat::SFLOAT_16, data_.tex_size, usage);
212
213 int occupancy_layers = divide_ceil_u(data_.tex_size.z, 32u);
216 occupancy_tx_.ensure_3d(
217 gpu::TextureFormat::UINT_32, int3(data_.tex_size.xy(), occupancy_layers), occupancy_usage);
218
219 {
224 int2 hit_list_size = int2(1);
225 int hit_list_layer = 1;
226 if (inst_.pipelines.volume.use_hit_list()) {
227 hit_list_layer = clamp_i(inst_.scene->eevee.volumetric_ray_depth, 1, 16);
228 hit_list_size = data_.tex_size.xy();
229 }
230 hit_depth_tx_.ensure_3d(
231 gpu::TextureFormat::SFLOAT_32, int3(hit_list_size, hit_list_layer), hit_depth_usage);
232 if (hit_count_tx_.ensure_2d(gpu::TextureFormat::UINT_32, hit_list_size, hit_count_usage)) {
233 hit_count_tx_.clear(uint4(0u));
234 }
235 }
236
239 front_depth_tx_.ensure_2d(
240 gpu::TextureFormat::SFLOAT_32_DEPTH_UINT_8, data_.tex_size.xy(), front_depth_usage);
241 occupancy_fb_.ensure(GPU_ATTACHMENT_TEXTURE(front_depth_tx_));
242
243 bool created = false;
244 created |= scatter_tx_.current().ensure_3d(
245 gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
246 created |= extinction_tx_.current().ensure_3d(
247 gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
248 created |= scatter_tx_.previous().ensure_3d(
249 gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
250 created |= extinction_tx_.previous().ensure_3d(
251 gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
252
253 if (created) {
254 valid_history_ = false;
255 }
256
257 integrated_scatter_tx_.ensure_3d(gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
258 integrated_transmit_tx_.ensure_3d(gpu::TextureFormat::UFLOAT_11_11_10, data_.tex_size, usage);
259
260 /* Update references for bindings. */
261 result.scattering_tx_ = integrated_scatter_tx_;
262 result.transmittance_tx_ = integrated_transmit_tx_;
263 properties.scattering_tx_ = prop_scattering_tx_;
264 properties.extinction_tx_ = prop_extinction_tx_;
265 properties.emission_tx_ = prop_emission_tx_;
266 properties.phase_tx_ = prop_phase_tx_;
267 properties.phase_weight_tx_ = prop_phase_weight_tx_;
268 properties.occupancy_tx_ = occupancy_tx_;
269 occupancy.occupancy_tx_ = occupancy_tx_;
270 occupancy.hit_depth_tx_ = hit_depth_tx_;
271 occupancy.hit_count_tx_ = hit_count_tx_;
272
273 /* Set extend mode to extend and reject invalid samples in the shader.
274 * This avoids some black rim artifacts near the edge of the re-projected volume.
275 * Filter linear to avoid sharp artifacts during re-projection. */
276 const GPUSamplerState history_sampler = {GPU_SAMPLER_FILTERING_LINEAR,
279 scatter_ps_.init();
280 scatter_ps_.shader_set(
281 inst_.shaders.static_shader_get(use_lights_ ? VOLUME_SCATTER_WITH_LIGHTS : VOLUME_SCATTER));
282 scatter_ps_.bind_resources(inst_.lights);
283 scatter_ps_.bind_resources(inst_.sphere_probes);
284 scatter_ps_.bind_resources(inst_.volume_probes);
285 scatter_ps_.bind_resources(inst_.shadows);
286 scatter_ps_.bind_resources(inst_.uniform_data);
287 scatter_ps_.bind_resources(inst_.sampling);
288 scatter_ps_.bind_image("in_scattering_img", &prop_scattering_tx_);
289 scatter_ps_.bind_image("in_extinction_img", &prop_extinction_tx_);
290 scatter_ps_.bind_texture("extinction_tx", &prop_extinction_tx_);
291 scatter_ps_.bind_image("in_emission_img", &prop_emission_tx_);
292 scatter_ps_.bind_image("in_phase_img", &prop_phase_tx_);
293 scatter_ps_.bind_image("in_phase_weight_img", &prop_phase_weight_tx_);
294 scatter_ps_.bind_texture("scattering_history_tx", &scatter_tx_.previous(), history_sampler);
295 scatter_ps_.bind_texture("extinction_history_tx", &extinction_tx_.previous(), history_sampler);
296 scatter_ps_.bind_image("out_scattering_img", &scatter_tx_.current());
297 scatter_ps_.bind_image("out_extinction_img", &extinction_tx_.current());
298 scatter_ps_.bind_texture(RBUFS_UTILITY_TEX_SLOT, inst_.pipelines.utility_tx);
299 /* Sync with the property pass. */
301 scatter_ps_.dispatch(math::divide_ceil(data_.tex_size, int3(VOLUME_GROUP_SIZE)));
302
303 integration_ps_.init();
304 integration_ps_.shader_set(inst_.shaders.static_shader_get(VOLUME_INTEGRATION));
305 integration_ps_.bind_resources(inst_.uniform_data);
306 integration_ps_.bind_resources(inst_.sampling);
307 integration_ps_.bind_texture("in_scattering_tx", &scatter_tx_.current());
308 integration_ps_.bind_texture("in_extinction_tx", &extinction_tx_.current());
309 integration_ps_.bind_image("out_scattering_img", &integrated_scatter_tx_);
310 integration_ps_.bind_image("out_transmittance_img", &integrated_transmit_tx_);
311 /* Sync with the scatter pass. */
312 integration_ps_.barrier(GPU_BARRIER_TEXTURE_FETCH);
313 integration_ps_.dispatch(
315
316 resolve_ps_.init();
317 resolve_ps_.state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_BLEND_CUSTOM);
318 resolve_ps_.shader_set(inst_.shaders.static_shader_get(VOLUME_RESOLVE));
319 resolve_ps_.bind_resources(inst_.uniform_data);
320 resolve_ps_.bind_resources(this->result);
321 resolve_ps_.bind_resources(inst_.hiz_buffer.front);
322 resolve_ps_.bind_image(RBUFS_COLOR_SLOT, &inst_.render_buffers.rp_color_tx);
323 resolve_ps_.bind_image(RBUFS_VALUE_SLOT, &inst_.render_buffers.rp_value_tx);
324 /* Sync with the integration pass. */
325 resolve_ps_.barrier(GPU_BARRIER_TEXTURE_FETCH);
326 resolve_ps_.draw_procedural(GPU_PRIM_TRIS, 1, 3);
327}
328
330{
331 if (!enabled_) {
332 return;
333 }
334
335 /* Number of frame to consider for blending with exponential (infinite) average. */
336 int exponential_frame_count = 16;
337 if (inst_.is_image_render) {
338 /* Disable reprojection for rendering. */
339 exponential_frame_count = 0;
340 }
341 else if (!use_reprojection_) {
342 /* No re-projection if TAA is disabled. */
343 exponential_frame_count = 0;
344 }
345 else if (inst_.is_playback) {
346 /* For now, we assume we want responsiveness for volume animation.
347 * But this makes general animation inside uniform volumes less stable.
348 * When we introduce updated volume tagging, we will be able to increase this for general
349 * playback. */
350 exponential_frame_count = 3;
351 }
352 else if (inst_.is_transforming) {
353 /* Improve responsiveness of volume if we are transforming objects. */
354 /* TODO(fclem): This is too general as it will be triggered even for non volume object.
355 * Instead, we should tag which areas of the volume that need increased responsiveness. */
356 exponential_frame_count = 3;
357 }
358 else if (inst_.is_navigating) {
359 /* Navigation is usually smooth because of the re-projection but we can get ghosting
360 * artifacts on lights because of voxels stretched in Z or anisotropy. */
361 exponential_frame_count = 8;
362 }
363 else if (inst_.is_viewport() && inst_.sampling.is_reset()) {
364 /* If we are not falling in any cases above, this usually means there is a scene or object
365 * parameter update. Reset accumulation completely. */
366 exponential_frame_count = 0;
367 }
368
369 if (!valid_history_) {
370 history_frame_count_ = 0;
371 }
372 /* Interactive mode accumulate samples using exponential average.
373 * We still reuse the history when we go into static mode.
374 * However, using re-projection for static mode will show the precision limit of RG11B10 format.
375 * So we clamp it to the exponential frame count in any case. */
376 history_frame_count_ = math::min(history_frame_count_, exponential_frame_count);
377
378 /* In interactive mode, use exponential average (fixed ratio).
379 * For static / render mode use simple average (moving ratio). */
380 float history_opacity = history_frame_count_ / (history_frame_count_ + 1.0f);
381
382 /* Setting opacity to 0.0 will bypass any sampling of history buffer.
383 * Allowing us to skip the 3D texture clear. */
384 data_.history_opacity = (valid_history_) ? history_opacity : 0.0f;
385
386 float left, right, bottom, top, near, far;
387 projmat_dimensions(main_view.winmat().ptr(), &left, &right, &bottom, &top, &near, &far);
388
389 /* Just like up-sampling matrix computation, we have to be careful to where to put the bounds of
390 * our froxel volume so that a 2D pixel covers exactly the number of pixel in a tile. */
391 float2 render_size = float2(right - left, top - bottom);
392 float2 volume_size = render_size * float2(data_.tex_size.xy() * data_.tile_size) /
393 float2(inst_.film.render_extent_get());
394 /* Change to the padded extends. */
395 right = left + volume_size.x;
396 top = bottom + volume_size.y;
397
398 float4x4 winmat_infinite, winmat_finite;
399 /* Create an infinite projection matrix to avoid far clipping plane clipping the object. This
400 * way, surfaces that are further away than the far clip plane will still be voxelized. */
401 winmat_infinite = main_view.is_persp() ?
402 math::projection::perspective_infinite(left, right, bottom, top, near) :
403 math::projection::orthographic_infinite(left, right, bottom, top, near);
404 /* We still need a bounded projection matrix to get correct froxel location. */
405 winmat_finite = main_view.is_persp() ?
406 math::projection::perspective(left, right, bottom, top, near, far) :
407 math::projection::orthographic(left, right, bottom, top, near, far);
408 /* Save non-jittered finite matrix for re-projection. */
409 data_.winmat_stable = winmat_finite;
410 data_.wininv_stable = math::invert(winmat_finite);
411
412 /* Anti-Aliasing / Super-Sampling jitter. */
413 float2 jitter = inst_.sampling.rng_2d_get(SAMPLING_VOLUME_U);
414 /* Wrap to keep first sample centered (0,0) and scale to convert to NDC. */
415 jitter = math::fract(jitter + 0.5f) * 2.0f - 1.0f;
416 /* Convert to pixel size. */
417 jitter *= data_.inv_tex_size.xy();
418 /* Apply jitter to both matrices. */
419 winmat_infinite = math::projection::translate(winmat_infinite, jitter);
420 winmat_finite = math::projection::translate(winmat_finite, jitter);
421
422 data_.winmat_finite = winmat_finite;
423 data_.wininv_finite = math::invert(winmat_finite);
424
425 /* Compute re-projection matrix. */
426 data_.curr_view_to_past_view = history_viewmat_ * main_view.viewinv();
427
428 inst_.uniform_data.push_update();
429
430 GPU_debug_group_begin("Volumes");
431 occupancy_fb_.bind();
432 inst_.pipelines.world_volume.render(main_view);
433
434 volume_view.sync(main_view.viewmat(), winmat_infinite);
435 /* TODO(fclem): The infinite projection matrix makes the culling test unreliable (see #115595).
436 * We need custom culling for these but that's not implemented yet. */
437 volume_view.visibility_test(false);
438
439 if (!current_objects_.is_empty()) {
440 inst_.pipelines.volume.render(volume_view, occupancy_tx_);
441 }
443}
444
445void VolumeModule::draw_compute(View &main_view, int2 extent)
446{
447 if (!enabled_) {
448 return;
449 }
450
451 if (inst_.pipelines.deferred.is_empty()) {
452 /* This assume the volume are computed after deferred passes. This is needed to avoid broken
453 * lighting and shadowing as the lights are not setup otherwise (see #121971). */
454 inst_.hiz_buffer.swap_layer();
455 inst_.hiz_buffer.update();
456 inst_.volume_probes.set_view(main_view);
457 inst_.sphere_probes.set_view(main_view);
458 inst_.shadows.set_view(main_view, extent);
459 }
460
461 scatter_tx_.swap();
462 extinction_tx_.swap();
463
464 inst_.manager->submit(scatter_ps_, main_view);
465 inst_.manager->submit(integration_ps_, main_view);
466
467 /* Copy history data. */
468 history_viewmat_ = main_view.viewmat();
469 data_.history_depth_near = data_.depth_near;
470 data_.history_depth_far = data_.depth_far;
471 data_.history_depth_distribution = data_.depth_distribution;
472 data_.history_winmat_stable = data_.winmat_stable;
473 valid_history_ = true;
474 history_frame_count_ += 1;
475}
476
478{
479 if (!enabled_) {
480 return;
481 }
482
483 inst_.hiz_buffer.update();
484
485 resolve_fb_.ensure(GPU_ATTACHMENT_NONE,
486 GPU_ATTACHMENT_TEXTURE(inst_.render_buffers.combined_tx));
487 resolve_fb_.bind();
488 inst_.manager->submit(resolve_ps_, view);
489}
490
491} // 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_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)
struct blender::eevee::VolumeModule::@272214251307377361251017233276127374325055261337 properties
void world_sync(const WorldHandle &world_handle)
struct blender::eevee::VolumeModule::@126173222355251033261272350101304070110072204326 occupancy
struct blender::eevee::VolumeModule::@250013332365273170227003077320346304121216231272 result
void draw_compute(View &main_view, int2 extent)
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