Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDilith Jayakody <dilithjay@gmail.com>2021-07-20 17:53:34 +0300
committerDilith Jayakody <dilithjay@gmail.com>2021-07-20 17:53:34 +0300
commit227e1429e8a4c9c3f1485924f3713bd502424cc2 (patch)
tree8829731347b8025a777a31c8ae89d755c4a0d0e4 /source/blender/draw/engines
parent71ef45f142b3efc2fd1032ce0e92ec4abdacc1ed (diff)
Merge branch 'master' into soc-2021-curves
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/eevee/eevee_depth_of_field.c22
-rw-r--r--source/blender/draw/engines/eevee/eevee_engine.c6
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightcache.c24
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c8
-rw-r--r--source/blender/draw/engines/eevee/eevee_lights.c4
-rw-r--r--source/blender/draw/engines/eevee/eevee_lookdev.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_materials.c10
-rw-r--r--source/blender/draw/engines/eevee/eevee_motion_blur.c6
-rw-r--r--source/blender/draw/engines/eevee/eevee_private.h18
-rw-r--r--source/blender/draw/engines/eevee/eevee_render.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_renderpasses.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_screen_raytrace.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_shaders.c8
-rw-r--r--source/blender/draw/engines/eevee/eevee_shadows.c4
-rw-r--r--source/blender/draw/engines/eevee/eevee_shadows_cascade.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_subsurface.c6
-rw-r--r--source/blender/draw/engines/eevee/eevee_temporal_sampling.c4
-rw-r--r--source/blender/draw/engines/eevee/eevee_volumes.c8
-rw-r--r--source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/bsdf_sampling_lib.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_filter_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl6
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_reduce_frag.glsl6
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_resolve_frag.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl3
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_dof_setup_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl8
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_cube_display_vert.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl6
-rw-r--r--source/blender/draw/engines/eevee/shaders/lights_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/random_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl6
-rw-r--r--source/blender/draw/engines/eevee/shaders/ssr_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/surface_lib.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/volumetric_geom.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl2
-rw-r--r--source/blender/draw/engines/external/external_engine.c2
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c2
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c18
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_antialiasing_frag.glsl2
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl16
-rw-r--r--source/blender/draw/engines/image/image_engine.c41
-rw-r--r--source/blender/draw/engines/image/shaders/engine_image_frag.glsl2
-rw-r--r--source/blender/draw/engines/overlay/overlay_armature.c18
-rw-r--r--source/blender/draw/engines/overlay/overlay_edit_mesh.c1
-rw-r--r--source/blender/draw/engines/overlay/overlay_edit_uv.c3
-rw-r--r--source/blender/draw/engines/overlay/overlay_engine.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_extra.c6
-rw-r--r--source/blender/draw/engines/overlay/overlay_gpencil.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_motion_path.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_outline.c20
-rw-r--r--source/blender/draw/engines/overlay/overlay_particle.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_private.h8
-rw-r--r--source/blender/draw/engines/overlay/overlay_shader.c2
-rw-r--r--source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl4
-rw-r--r--source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/extra_vert.glsl8
-rw-r--r--source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl2
-rw-r--r--source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl2
-rw-r--r--source/blender/draw/engines/select/select_engine.c2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl4
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_antialiasing.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_cavity.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_dof.c6
-rw-r--r--source/blender/draw/engines/workbench/workbench_engine.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_materials.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_private.h8
-rw-r--r--source/blender/draw/engines/workbench/workbench_shadow.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_transparent.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_volume.c4
98 files changed, 250 insertions, 222 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
index 7986d7a2810..4748323d6a7 100644
--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
@@ -234,7 +234,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata),
}
const float scale_camera = (is_ortho) ? 1.0 : 0.001f;
- /* we want radius here for the aperture number */
+ /* We want radius here for the aperture number. */
float aperture = 0.5f * scale_camera * focal_len / fstop;
float focal_len_scaled = scale_camera * focal_len;
float sensor_scaled = scale_camera * sensor;
@@ -352,7 +352,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata),
/**
* Create bokeh texture.
- **/
+ */
static void dof_bokeh_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_EffectsInfo *fx)
@@ -392,7 +392,7 @@ static void dof_bokeh_pass_init(EEVEE_FramebufferList *fbl,
/**
* Outputs halfResColorBuffer and halfResCocBuffer.
- **/
+ */
static void dof_setup_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_EffectsInfo *fx)
@@ -426,7 +426,7 @@ static void dof_setup_pass_init(EEVEE_FramebufferList *fbl,
/**
* Outputs min & max COC in each 8x8 half res pixel tiles (so 1/16th of full resolution).
- **/
+ */
static void dof_flatten_tiles_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_EffectsInfo *fx)
@@ -459,7 +459,7 @@ static void dof_flatten_tiles_pass_init(EEVEE_FramebufferList *fbl,
* Dilates the min & max COCS to cover maximum COC values.
* Output format/dimensions should be the same as coc_flatten_pass as they are swapped for
* doing multiple dilation passes.
- **/
+ */
static void dof_dilate_tiles_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_EffectsInfo *fx)
@@ -540,7 +540,7 @@ static void dof_dilate_tiles_pass_draw(EEVEE_FramebufferList *fbl,
/**
* Create mipmapped color & COC textures for gather passes.
- **/
+ */
static void dof_reduce_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_TextureList *txl,
@@ -626,7 +626,7 @@ static void dof_reduce_pass_init(EEVEE_FramebufferList *fbl,
if (txl->dof_reduced_color) {
/* TODO(fclem) In the future, we need to check if mip_count did not change.
- * For now it's ok as we always define all mip level.*/
+ * For now it's ok as we always define all mip level. */
if (res[0] != GPU_texture_width(txl->dof_reduced_color) ||
res[1] != GPU_texture_width(txl->dof_reduced_color)) {
DRW_TEXTURE_FREE_SAFE(txl->dof_reduced_color);
@@ -666,7 +666,7 @@ static void dof_reduce_pass_init(EEVEE_FramebufferList *fbl,
/**
* Do the gather convolution. For each pixels we gather multiple pixels in its neighborhood
* depending on the min & max CoC tiles.
- **/
+ */
static void dof_gather_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_TextureList *txl,
@@ -792,7 +792,7 @@ static void dof_gather_pass_init(EEVEE_FramebufferList *fbl,
* Filter an input buffer using a median filter to reduce noise.
* NOTE: We use the holefill texture as our input to reduce memory usage.
* Thus, the holefill pass cannot be filtered.
- **/
+ */
static void dof_filter_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_EffectsInfo *fx)
@@ -825,7 +825,7 @@ static void dof_filter_pass_init(EEVEE_FramebufferList *fbl,
/**
* Do the Scatter convolution. A sprite is emitted for every 4 pixels but is only expanded if the
* pixels are bright enough to be scattered.
- **/
+ */
static void dof_scatter_pass_init(EEVEE_FramebufferList *fbl,
EEVEE_PassList *psl,
EEVEE_TextureList *txl,
@@ -896,7 +896,7 @@ static void dof_scatter_pass_init(EEVEE_FramebufferList *fbl,
/**
* Recombine the result of the foreground and background processing. Also perform a slight out of
* focus blur to improve geometric continuity.
- **/
+ */
static void dof_recombine_pass_init(EEVEE_FramebufferList *UNUSED(fbl),
EEVEE_PassList *psl,
EEVEE_EffectsInfo *fx)
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c
index 88fd823bc72..9d4f7865c32 100644
--- a/source/blender/draw/engines/eevee/eevee_engine.c
+++ b/source/blender/draw/engines/eevee/eevee_engine.c
@@ -22,7 +22,7 @@
#include "DRW_render.h"
-#include "draw_color_management.h" /* TODO remove dependency */
+#include "draw_color_management.h" /* TODO: remove dependency. */
#include "BLI_rand.h"
@@ -189,7 +189,7 @@ static void eevee_cache_finish(void *vedata)
/* As renders in an HDR offscreen buffer, we need draw everything once
* during the background pass. This way the other drawing callback between
* the background and the scene pass are visible.
- * Note: we could break it up in two passes using some depth test
+ * NOTE: we could break it up in two passes using some depth test
* to reduce the fillrate */
static void eevee_draw_scene(void *vedata)
{
@@ -481,7 +481,7 @@ static void eevee_render_to_image(void *vedata,
time -= shuttertime;
break;
default:
- BLI_assert(!"Invalid motion blur position enum!");
+ BLI_assert_msg(0, "Invalid motion blur position enum!");
break;
}
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c
index 37ecdb20651..9a85037ac77 100644
--- a/source/blender/draw/engines/eevee/eevee_lightcache.c
+++ b/source/blender/draw/engines/eevee/eevee_lightcache.c
@@ -75,7 +75,7 @@
(IRRADIANCE_MAX_POOL_SIZE / IRRADIANCE_SAMPLE_SIZE_X) * \
(IRRADIANCE_MAX_POOL_SIZE / IRRADIANCE_SAMPLE_SIZE_Y)
-/* TODO should be replace by a more elegant alternative. */
+/* TODO: should be replace by a more elegant alternative. */
extern void DRW_opengl_context_enable(void);
extern void DRW_opengl_context_disable(void);
@@ -165,7 +165,7 @@ typedef struct EEVEE_LightBake {
bool own_resources;
/** If the light-cache was created for baking, it's first owned by the baker. */
bool own_light_cache;
- /** ms. delay the start of the baking to not slowdown interactions (TODO remove) */
+ /** ms. delay the start of the baking to not slowdown interactions (TODO: remove). */
int delay;
/** Scene frame to bake. */
int frame;
@@ -715,7 +715,7 @@ static void eevee_lightbake_create_resources(EEVEE_LightBake *lbake)
* by the DRW mutex. */
lbake->lcache = eevee->light_cache_data;
- /* TODO validate irradiance and reflection cache independently... */
+ /* TODO: validate irradiance and reflection cache independently... */
if (!EEVEE_lightcache_validate(
lbake->lcache, lbake->cube_len, lbake->ref_cube_res, lbake->grid_len, lbake->irr_size)) {
eevee->light_cache_data = lbake->lcache = NULL;
@@ -764,7 +764,7 @@ wmJob *EEVEE_lightbake_job_create(struct wmWindowManager *wm,
if (old_lbake && (old_lbake->view_layer_input == view_layer) && (old_lbake->bmain == bmain)) {
lbake = MEM_callocN(sizeof(EEVEE_LightBake), "EEVEE_LightBake");
/* Cannot reuse depsgraph for now because we cannot get the update from the
- * main database directly. TODO reuse depsgraph and only update positions. */
+ * main database directly. TODO: reuse depsgraph and only update positions. */
/* lbake->depsgraph = old_lbake->depsgraph; */
lbake->depsgraph = DEG_graph_new(bmain, scene, view_layer, DAG_EVAL_RENDER);
@@ -838,7 +838,7 @@ void EEVEE_lightbake_job_data_free(void *custom_data)
{
EEVEE_LightBake *lbake = (EEVEE_LightBake *)custom_data;
- /* TODO reuse depsgraph. */
+ /* TODO: reuse depsgraph. */
/* if (lbake->own_resources) { */
DEG_graph_free(lbake->depsgraph);
/* } */
@@ -866,7 +866,7 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake)
}
/* XXX Free the resources contained in the viewlayer data
- * to be able to free the context before deleting the depsgraph. */
+ * to be able to free the context before deleting the depsgraph. */
if (lbake->sldata) {
EEVEE_view_layer_data_free(lbake->sldata);
}
@@ -923,7 +923,7 @@ static void eevee_lightbake_cache_create(EEVEE_Data *vedata, EEVEE_LightBake *lb
stl->g_data->background_alpha = 1.0f;
stl->g_data->render_timesteps = 1;
- /* XXX TODO remove this. This is in order to make the init functions work. */
+ /* XXX TODO: remove this. This is in order to make the init functions work. */
if (DRW_view_default_get() == NULL) {
float winmat[4][4], viewmat[4][4];
unit_m4(viewmat);
@@ -1010,7 +1010,7 @@ static void eevee_lightbake_render_world_sample(void *ved, void *user_data)
float clamp = scene_eval->eevee.gi_glossy_clamp;
float filter_quality = scene_eval->eevee.gi_filter_quality;
- /* TODO do this once for the whole bake when we have independent DRWManagers. */
+ /* TODO: do this once for the whole bake when we have independent DRWManagers. */
eevee_lightbake_cache_create(vedata, lbake);
sldata->common_data.ray_type = EEVEE_RAY_GLOSSY;
@@ -1133,7 +1133,7 @@ static void eevee_lightbake_render_grid_sample(void *ved, void *user_data)
/* Use the previous bounce for rendering this bounce. */
SWAP(GPUTexture *, lbake->grid_prev, lcache->grid_tx.tex);
- /* TODO do this once for the whole bake when we have independent DRWManagers.
+ /* TODO: do this once for the whole bake when we have independent DRWManagers.
* Warning: Some of the things above require this. */
eevee_lightbake_cache_create(vedata, lbake);
@@ -1210,7 +1210,7 @@ static void eevee_lightbake_render_probe_sample(void *ved, void *user_data)
float clamp = scene_eval->eevee.gi_glossy_clamp;
float filter_quality = scene_eval->eevee.gi_filter_quality;
- /* TODO do this once for the whole bake when we have independent DRWManagers. */
+ /* TODO: do this once for the whole bake when we have independent DRWManagers. */
eevee_lightbake_cache_create(vedata, lbake);
/* Disable specular lighting when rendering probes to avoid feedback loops (looks bad). */
@@ -1420,7 +1420,7 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float
/* HACK: Sleep to delay the first rendering operation
* that causes a small freeze (caused by VBO generation)
* because this step is locking at this moment. */
- /* TODO remove this. */
+ /* TODO: remove this. */
if (lbake->delay) {
PIL_sleep_ms(lbake->delay);
}
@@ -1480,7 +1480,7 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float
eevee_lightbake_delete_resources(lbake);
- /* Free GPU smoke textures and the smoke domain list correctly: See also T73921.*/
+ /* Free GPU smoke textures and the smoke domain list correctly: See also T73921. */
EEVEE_volumes_free_smoke_textures();
}
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index e2e865bcfad..8598655477f 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -59,7 +59,7 @@ static struct {
/* *********** FUNCTIONS *********** */
-/* TODO find a better way than this. This does not support dupli objects if
+/* TODO: find a better way than this. This does not support dupli objects if
* the original object is hidden. */
bool EEVEE_lightprobes_obj_visibility_cb(bool vis_in, void *user_data)
{
@@ -94,11 +94,11 @@ static void planar_pool_ensure_alloc(EEVEE_Data *vedata, int num_planar_ref)
EEVEE_StorageList *stl = vedata->stl;
EEVEE_EffectsInfo *fx = stl->effects;
- /* XXX TODO OPTIMIZATION: This is a complete waist of texture memory.
+ /* XXX TODO: OPTIMIZATION: This is a complete waist of texture memory.
* Instead of allocating each planar probe for each viewport,
* only alloc them once using the biggest viewport resolution. */
- /* TODO get screen percentage from layer setting */
+ /* TODO: get screen percentage from layer setting. */
// const DRWContextState *draw_ctx = DRW_context_state_get();
// ViewLayer *view_layer = draw_ctx->view_layer;
int screen_divider = 1;
@@ -1133,7 +1133,7 @@ void EEVEE_lightbake_filter_visibility(EEVEE_ViewLayerData *sldata,
EEVEE_LightProbesInfo *pinfo = sldata->probes;
LightCache *light_cache = vedata->stl->g_data->light_cache;
- pinfo->samples_len = 512.0f; /* TODO refine */
+ pinfo->samples_len = 512.0f; /* TODO: refine. */
pinfo->shres = vis_size;
pinfo->visibility_range = vis_range;
pinfo->visibility_blur = vis_blur;
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c
index e23a5a81169..afaf604322c 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -88,7 +88,7 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
/* Make illumination power constant */
if (la->type == LA_AREA) {
power = 1.0f / (evli->sizex * evli->sizey * 4.0f * M_PI) * /* 1/(w*h*Pi) */
- 0.8f; /* XXX : Empirical, Fit cycles power */
+ 0.8f; /* XXX: Empirical, Fit cycles power. */
if (ELEM(la->area_shape, LA_AREA_DISK, LA_AREA_ELLIPSE)) {
/* Scale power to account for the lower area of the ellipse compared to the surrounding
* rectangle. */
@@ -99,7 +99,7 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
power = 1.0f / (4.0f * evli->radius * evli->radius * M_PI * M_PI); /* `1/(4*(r^2)*(Pi^2))` */
/* for point lights (a.k.a radius == 0.0) */
- // power = M_PI * M_PI * 0.78; /* XXX : Empirical, Fit cycles power */
+ // power = M_PI * M_PI * 0.78; /* XXX: Empirical, Fit cycles power. */
}
else { /* LA_SUN */
power = 1.0f / (evli->radius * evli->radius * M_PI);
diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c
index a9998b33b7e..f4dc553e982 100644
--- a/source/blender/draw/engines/eevee/eevee_lookdev.c
+++ b/source/blender/draw/engines/eevee/eevee_lookdev.c
@@ -205,7 +205,7 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata,
stl->lookdev_lightcache = EEVEE_lightcache_create(
1, 1, cube_res, 8, (int[3]){grid_res, grid_res, 1});
- /* XXX: Fix memleak. TODO find out why. */
+ /* XXX: Fix memleak. TODO: find out why. */
MEM_SAFE_FREE(stl->lookdev_cube_mips);
/* We do this to use a special light cache for lookdev.
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index d2e0c8308c5..9ecb737192e 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -70,7 +70,7 @@ typedef struct EeveeMaterialCache {
/* *********** FUNCTIONS *********** */
-/* XXX TODO define all shared resources in a shared place without duplication */
+/* XXX TODO: define all shared resources in a shared place without duplication. */
struct GPUTexture *EEVEE_materials_get_util_tex(void)
{
return e_data.util_tex;
@@ -172,7 +172,7 @@ static void eevee_init_util_texture(void)
}
texels_layer += 64 * 64;
- /* Copy blue noise in 3rd layer */
+ /* Copy blue noise in 3rd layer. */
for (int i = 0; i < 64 * 64; i++) {
texels_layer[i][0] = blue_noise[i][0];
texels_layer[i][1] = blue_noise[i][2];
@@ -181,7 +181,7 @@ static void eevee_init_util_texture(void)
}
texels_layer += 64 * 64;
- /* Copy ltc_disk_integral in 4th layer */
+ /* Copy ltc_disk_integral in 4th layer. */
for (int i = 0; i < 64 * 64; i++) {
texels_layer[i][0] = ltc_disk_integral[i];
texels_layer[i][1] = 0.0; /* UNUSED */
@@ -691,7 +691,7 @@ static EeveeMaterialCache material_transparent(EEVEE_Data *vedata,
}
{
/* Shading */
- int ssr_id = -1; /* TODO transparent SSR */
+ int ssr_id = -1; /* TODO: transparent SSR. */
int mat_options = VAR_MAT_MESH | VAR_MAT_BLEND;
SET_FLAG_FROM_TEST(mat_options, use_ssrefract, VAR_MAT_REFRACT);
GPUMaterial *gpumat = EEVEE_material_get(vedata, scene, ma, NULL, mat_options);
@@ -866,7 +866,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
continue;
}
- /* XXX TODO rewrite this to include the dupli objects.
+ /* XXX TODO: rewrite this to include the dupli objects.
* This means we cannot exclude dupli objects from reflections!!! */
EEVEE_ObjectEngineData *oedata = NULL;
if ((ob->base_flag & BASE_FROM_DUPLI) == 0) {
diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c
index 0a79d9466e9..2e200c8e053 100644
--- a/source/blender/draw/engines/eevee/eevee_motion_blur.c
+++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c
@@ -245,7 +245,7 @@ void EEVEE_motion_blur_hair_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata),
if (mb_data) {
int mb_step = effects->motion_blur_step;
- /* Store transform */
+ /* Store transform. */
DRW_hair_duplimat_get(ob, psys, md, mb_data->obmat[mb_step]);
EEVEE_HairMotionData *mb_hair = EEVEE_motion_blur_hair_data_get(&effects->motion_blur, ob);
@@ -323,7 +323,7 @@ void EEVEE_motion_blur_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata),
if (mb_data) {
int mb_step = effects->motion_blur_step;
- /* Store transform */
+ /* Store transform. */
copy_m4_m4(mb_data->obmat[mb_step], ob->obmat);
EEVEE_GeometryMotionData *mb_geom = EEVEE_motion_blur_geometry_data_get(&effects->motion_blur,
@@ -349,7 +349,7 @@ void EEVEE_motion_blur_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata),
}
/* Avoid drawing object that has no motions since object_moves is always true. */
- if (!mb_geom->use_deform && /* Object deformation can happen without transform. */
+ if (!mb_geom->use_deform && /* Object deformation can happen without transform. */
equals_m4m4(mb_data->obmat[MB_PREV], mb_data->obmat[MB_CURR]) &&
equals_m4m4(mb_data->obmat[MB_NEXT], mb_data->obmat[MB_CURR])) {
return;
diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index bc04fe024fc..f51b4fa0127 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -44,12 +44,12 @@ struct RenderLayer;
extern struct DrawEngineType draw_engine_eevee_type;
/* Minimum UBO is 16384 bytes */
-#define MAX_PROBE 128 /* TODO : find size by dividing UBO max size by probe data size */
-#define MAX_GRID 64 /* TODO : find size by dividing UBO max size by grid data size */
-#define MAX_PLANAR 16 /* TODO : find size by dividing UBO max size by grid data size */
-#define MAX_LIGHT 128 /* TODO : find size by dividing UBO max size by light data size */
+#define MAX_PROBE 128 /* TODO: find size by dividing UBO max size by probe data size. */
+#define MAX_GRID 64 /* TODO: find size by dividing UBO max size by grid data size. */
+#define MAX_PLANAR 16 /* TODO: find size by dividing UBO max size by grid data size. */
+#define MAX_LIGHT 128 /* TODO: find size by dividing UBO max size by light data size. */
#define MAX_CASCADE_NUM 4
-#define MAX_SHADOW 128 /* TODO : Make this depends on GL_MAX_ARRAY_TEXTURE_LAYERS */
+#define MAX_SHADOW 128 /* TODO: Make this depends on #GL_MAX_ARRAY_TEXTURE_LAYERS. */
#define MAX_SHADOW_CASCADE 8
#define MAX_SHADOW_CUBE (MAX_SHADOW - MAX_CASCADE_NUM * MAX_SHADOW_CASCADE)
#define MAX_BLOOM_STEP 16
@@ -238,7 +238,7 @@ typedef struct EEVEE_PlanarReflection {
float clip_edge_y_pos, clip_edge_y_neg;
float facing_scale, facing_bias, clipsta, pad;
float reflectionmat[4][4]; /* Used for sampling the texture. */
- float mtx[4][4]; /* Not used in shader. TODO move elsewhere. */
+ float mtx[4][4]; /* Not used in shader. TODO: move elsewhere. */
} EEVEE_PlanarReflection;
/* --------------------------------------- */
@@ -565,7 +565,7 @@ typedef struct EEVEE_LightsInfo {
/* Update bitmap. */
BLI_bitmap sh_cube_update[BLI_BITMAP_SIZE(MAX_SHADOW_CUBE)];
/* Lights tracking */
- struct BoundSphere shadow_bounds[MAX_LIGHT]; /* Tightly packed light bounds */
+ struct BoundSphere shadow_bounds[MAX_LIGHT]; /* Tightly packed light bounds. */
/* List of bbox and update bitmap. Double buffered. */
struct EEVEE_ShadowCasterBuffer *shcaster_frontbuffer, *shcaster_backbuffer;
/* AABB of all shadow casters combined. */
@@ -680,7 +680,7 @@ typedef struct EEVEE_GeometryMotionData {
int use_deform;
struct GPUBatch *batch; /* Batch for time = t. */
- struct GPUVertBuf *vbo[2]; /* Vbo for time = t +/- step. */
+ struct GPUVertBuf *vbo[2]; /* VBO for time = t +/- step. */
} EEVEE_GeometryMotionData;
/* ************ EFFECTS DATA ************* */
@@ -1000,7 +1000,7 @@ typedef struct EEVEE_PrivateData {
struct DRWShadingGroup *shadow_accum_shgrp;
struct DRWCallBuffer *planar_display_shgrp;
struct GHash *material_hash;
- float background_alpha; /* TODO find a better place for this. */
+ float background_alpha; /* TODO: find a better place for this. */
/* Chosen lightcache: can come from Lookdev or the viewlayer. */
struct LightCache *light_cache;
/* For planar probes */
diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c
index aaa087f9eb4..d214409c458 100644
--- a/source/blender/draw/engines/eevee/eevee_render.c
+++ b/source/blender/draw/engines/eevee/eevee_render.c
@@ -114,7 +114,7 @@ bool EEVEE_render_init(EEVEE_Data *ved, RenderEngine *engine, struct Depsgraph *
/* XXX overriding viewport size. Simplify things but is not really 100% safe. */
DRW_render_viewport_size_set(final_res);
- /* TODO 32 bit depth */
+ /* TODO: 32 bit depth. */
DRW_texture_ensure_fullscreen_2d(&dtxl->depth, GPU_DEPTH24_STENCIL8, 0);
DRW_texture_ensure_fullscreen_2d(&txl->color, GPU_RGBA32F, DRW_TEX_FILTER);
diff --git a/source/blender/draw/engines/eevee/eevee_renderpasses.c b/source/blender/draw/engines/eevee/eevee_renderpasses.c
index 5ada53ab98c..aa42deb13fa 100644
--- a/source/blender/draw/engines/eevee/eevee_renderpasses.c
+++ b/source/blender/draw/engines/eevee/eevee_renderpasses.c
@@ -23,7 +23,7 @@
#include "DRW_engine.h"
#include "DRW_render.h"
-#include "draw_color_management.h" /* TODO remove dependency. */
+#include "draw_color_management.h" /* TODO: remove dependency. */
#include "BKE_global.h" /* for G.debug_value */
diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
index 7af0f60748b..17cc1a46e23 100644
--- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
+++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
@@ -76,7 +76,7 @@ int EEVEE_screen_raytrace_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
const int divisor = (effects->reflection_trace_full) ? 1 : 2;
int tracing_res[2] = {(int)viewport_size[0] / divisor, (int)viewport_size[1] / divisor};
const int size_fs[2] = {(int)viewport_size[0], (int)viewport_size[1]};
- const bool high_qual_input = true; /* TODO dither low quality input */
+ const bool high_qual_input = true; /* TODO: dither low quality input. */
const eGPUTextureFormat format = (high_qual_input) ? GPU_RGBA16F : GPU_RGBA8;
tracing_res[0] = max_ii(1, tracing_res[0]);
diff --git a/source/blender/draw/engines/eevee/eevee_shaders.c b/source/blender/draw/engines/eevee/eevee_shaders.c
index 90b7eeb9293..56ae7185b51 100644
--- a/source/blender/draw/engines/eevee/eevee_shaders.c
+++ b/source/blender/draw/engines/eevee/eevee_shaders.c
@@ -1274,7 +1274,7 @@ Material *EEVEE_material_default_error_get(void)
return e_data.error_mat;
}
-/* Configure a default nodetree with the given material. */
+/* Configure a default nodetree with the given material. */
struct bNodeTree *EEVEE_shader_default_surface_nodetree(Material *ma)
{
/* WARNING: This function is not threadsafe. Which is not a problem for the moment. */
@@ -1302,7 +1302,7 @@ struct bNodeTree *EEVEE_shader_default_surface_nodetree(Material *ma)
return e_data.surface.ntree;
}
-/* Configure a default nodetree with the given world. */
+/* Configure a default nodetree with the given world. */
struct bNodeTree *EEVEE_shader_default_world_nodetree(World *wo)
{
/* WARNING: This function is not threadsafe. Which is not a problem for the moment. */
@@ -1439,7 +1439,7 @@ static void eevee_material_post_eval(GPUMaterial *mat,
const bool is_mesh = (options & VAR_MAT_MESH) != 0;
/* Force geometry usage if GPU_BARYCENTRIC_DIST or GPU_BARYCENTRIC_TEXCO are used.
- * Note: GPU_BARYCENTRIC_TEXCO only requires it if the shader is not drawing hairs. */
+ * NOTE: GPU_BARYCENTRIC_TEXCO only requires it if the shader is not drawing hairs. */
if (!is_hair && is_mesh && GPU_material_flag_get(mat, GPU_MATFLAG_BARYCENTRIC) &&
*geom_code == NULL) {
*geom_code = e_data.surface_geom_barycentric;
@@ -1493,7 +1493,7 @@ static struct GPUMaterial *eevee_material_get_ex(
return mat;
}
-/* Note: Compilation is not deferred. */
+/* NOTE: Compilation is not deferred. */
struct GPUMaterial *EEVEE_material_default_get(struct Scene *scene, Material *ma, int options)
{
Material *def_ma = (ma && (options & VAR_MAT_VOLUME)) ? BKE_material_default_volume() :
diff --git a/source/blender/draw/engines/eevee/eevee_shadows.c b/source/blender/draw/engines/eevee/eevee_shadows.c
index 6a98c3316f3..ee1a6652809 100644
--- a/source/blender/draw/engines/eevee/eevee_shadows.c
+++ b/source/blender/draw/engines/eevee/eevee_shadows.c
@@ -193,7 +193,7 @@ void EEVEE_shadows_caster_register(EEVEE_ViewLayerData *sldata, Object *ob)
static bool sphere_bbox_intersect(const BoundSphere *bs, const EEVEE_BoundBox *bb)
{
/* We are testing using a rougher AABB vs AABB test instead of full AABB vs Sphere. */
- /* TODO test speed with AABB vs Sphere. */
+ /* TODO: test speed with AABB vs Sphere. */
bool x = fabsf(bb->center[0] - bs->center[0]) <= (bb->halfdim[0] + bs->radius);
bool y = fabsf(bb->center[1] - bs->center[1]) <= (bb->halfdim[1] + bs->radius);
bool z = fabsf(bb->center[2] - bs->center[2]) <= (bb->halfdim[2] + bs->radius);
@@ -247,7 +247,7 @@ void EEVEE_shadows_update(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
sldata->shadow_fb = GPU_framebuffer_create("shadow_fb");
}
- /* Gather all light own update bits. to avoid costly intersection check. */
+ /* Gather all light own update bits. to avoid costly intersection check. */
for (int j = 0; j < linfo->cube_len; j++) {
const EEVEE_Light *evli = linfo->light_data + linfo->shadow_cube_light_indices[j];
/* Setup shadow cube in UBO and tag for update if necessary. */
diff --git a/source/blender/draw/engines/eevee/eevee_shadows_cascade.c b/source/blender/draw/engines/eevee/eevee_shadows_cascade.c
index 6cb4b39fafa..22ee821933c 100644
--- a/source/blender/draw/engines/eevee/eevee_shadows_cascade.c
+++ b/source/blender/draw/engines/eevee/eevee_shadows_cascade.c
@@ -112,7 +112,7 @@ static void frustum_min_bounding_sphere(const float corners[8][3],
}
}
- /* TODO try to reduce the radius further by moving the center.
+ /* TODO: try to reduce the radius further by moving the center.
* Remember we need a __stable__ solution! */
/* Try to reduce float imprecision leading to shimmering. */
diff --git a/source/blender/draw/engines/eevee/eevee_subsurface.c b/source/blender/draw/engines/eevee/eevee_subsurface.c
index 7fd39007263..b7bcd127859 100644
--- a/source/blender/draw/engines/eevee/eevee_subsurface.c
+++ b/source/blender/draw/engines/eevee/eevee_subsurface.c
@@ -144,7 +144,7 @@ void EEVEE_subsurface_output_init(EEVEE_ViewLayerData *UNUSED(sldata),
/* Clear texture.
* Due to the late initialization of the SSS it can happen that the `taa_current_sample` is
* already higher than one. This is noticeable when loading a file that has the diffuse light
- * pass in look dev mode active. `texture_created` will make sure that newly created textures
+ * pass in look-dev mode active. `texture_created` will make sure that newly created textures
* are cleared. */
if (effects->taa_current_sample == 1 || texture_created) {
const float clear[4] = {0.0f, 0.0f, 0.0f, 0.0f};
@@ -198,7 +198,7 @@ void EEVEE_subsurface_add_pass(EEVEE_ViewLayerData *sldata,
/* Limit of 8 bit stencil buffer. ID 255 is refraction. */
if (effects->sss_surface_count >= 254) {
- /* TODO : display message. */
+ /* TODO: display message. */
printf("Error: Too many different Subsurface shader in the scene.\n");
return;
}
@@ -315,7 +315,7 @@ void EEVEE_subsurface_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
if (!DRW_pass_is_empty(psl->sss_translucency_ps)) {
/* We sample the shadow-maps using normal sampler. We need to disable Comparison mode.
- * TODO(fclem): avoid this by using sampler objects.*/
+ * TODO(fclem): avoid this by using sampler objects. */
GPU_texture_compare_mode(sldata->shadow_cube_pool, false);
GPU_texture_compare_mode(sldata->shadow_cascade_pool, false);
diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
index e30f5d52d56..b03172a1270 100644
--- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
+++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
@@ -197,7 +197,7 @@ void EEVEE_temporal_sampling_matrices_calc(EEVEE_EffectsInfo *effects, const dou
}
/* Update the matrices based on the current sample.
- * Note: `DRW_MAT_PERS` and `DRW_MAT_VIEW` needs to read the original matrices. */
+ * NOTE: `DRW_MAT_PERS` and `DRW_MAT_VIEW` needs to read the original matrices. */
void EEVEE_temporal_sampling_update_matrices(EEVEE_Data *vedata)
{
EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl;
@@ -407,7 +407,7 @@ void EEVEE_temporal_sampling_draw(EEVEE_Data *vedata)
GPU_framebuffer_blit(fbl->main_fb, 0, fbl->double_buffer_depth_fb, 0, GPU_DEPTH_BIT);
/* Do reprojection for noise reduction */
- /* TODO : do AA jitter if in only render view. */
+ /* TODO: do AA jitter if in only render view. */
if (!DRW_state_is_image_render() && (effects->enabled_effects & EFFECT_TAA_REPROJECT) != 0 &&
stl->g_data->valid_taa_history) {
GPU_framebuffer_bind(effects->target_buffer);
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c
index eed36221fcb..47e8aeeb6e2 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -129,7 +129,7 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
common_data->vol_coord_scale[2] = 1.0f / viewport_size[0];
common_data->vol_coord_scale[3] = 1.0f / viewport_size[1];
- /* TODO compute snap to maxZBuffer for clustered rendering */
+ /* TODO: compute snap to maxZBuffer for clustered rendering. */
if ((common_data->vol_tex_size[0] != tex_size[0]) ||
(common_data->vol_tex_size[1] != tex_size[1]) ||
(common_data->vol_tex_size[2] != tex_size[2])) {
@@ -554,8 +554,8 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata,
}
}
- /* TODO Reduce to number of slices intersecting. */
- /* TODO Preemptive culling. */
+ /* TODO: Reduce to number of slices intersecting. */
+ /* TODO: Preemptive culling. */
DRW_shgroup_call_procedural_triangles(grp, ob, sldata->common_data.vol_tex_size[2]);
vedata->stl->effects->enabled_effects |= (EFFECT_VOLUMETRIC | EFFECT_POST_BUFFER);
@@ -709,7 +709,7 @@ void EEVEE_volumes_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
DRW_stats_group_start("Volumetrics");
/* We sample the shadow-maps using shadow sampler. We need to enable Comparison mode.
- * TODO(fclem): avoid this by using sampler objects.*/
+ * TODO(fclem): avoid this by using sampler objects. */
GPU_texture_compare_mode(sldata->shadow_cube_pool, true);
GPU_texture_compare_mode(sldata->shadow_cascade_pool, true);
diff --git a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
index cdc453eed40..d4e3b879426 100644
--- a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl
@@ -338,7 +338,7 @@ float diffuse_occlusion(
* radius2 : Second caps’ radius (in radians)
* dist : Distance between caps (radians between centers of caps)
* Note: Result is divided by pi to save one multiply.
- **/
+ */
float spherical_cap_intersection(float radius1, float radius2, float dist)
{
/* From "Ambient Aperture Lighting" by Chris Oat
@@ -407,7 +407,7 @@ OcclusionData occlusion_load(vec3 vP, float custom_occlusion)
data = unpack_occlusion_data(texelFetch(horizonBuffer, ivec2(gl_FragCoord.xy), 0));
}
#else
- /* For blended surfaces. */
+ /* For blended surfaces. */
data = occlusion_search(vP, maxzBuffer, aoDistance, 0.0, 8.0);
#endif
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
index 05496ad4ab0..4ee21cf8c2e 100644
--- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
@@ -201,6 +201,6 @@ float cone_cosine(float r)
// return cos(2.0 * sqrt(2.0 / (gloss + 2)));
/* Uludag 2014 in GPUPro5 */
// return pow(0.244, 1 / (gloss + 1));
- /* Jimenez 2016 in Practical Realtime Strategies for Accurate Indirect Occlusion*/
+ /* Jimenez 2016 in Practical Realtime Strategies for Accurate Indirect Occlusion. */
return exp2(-3.32193 * r * r);
}
diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_sampling_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_sampling_lib.glsl
index 7ce95a4aff2..e0f52338914 100644
--- a/source/blender/draw/engines/eevee/shaders/bsdf_sampling_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/bsdf_sampling_lib.glsl
@@ -1,7 +1,7 @@
/**
* Sampling distribution routines for Monte-carlo integration.
- **/
+ */
#pragma BLENDER_REQUIRE(common_math_geom_lib.glsl)
#pragma BLENDER_REQUIRE(bsdf_common_lib.glsl)
@@ -116,7 +116,7 @@ vec3 sample_uniform_cone(vec3 rand, float angle)
vec3 sample_uniform_cone(vec3 rand, float angle, vec3 N, vec3 T, vec3 B)
{
vec3 Ht = sample_uniform_cone(rand, angle);
- /* TODO pdf? */
+ /* TODO: pdf? */
return tangent_to_world(Ht, N, T, B);
}
diff --git a/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl b/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl
index 2f1298e2707..c8c3fa548fc 100644
--- a/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/btdf_lut_frag.glsl
@@ -83,7 +83,7 @@ void main()
btdf_accum = 0.0;
}
- /* There is place to put multiscater result (which is a little bit different still)
- * and / or lobe fitting for better sampling of */
+ /* There is place to put multi-scatter result (which is a little bit different still)
+ * and / or lobe fitting for better sampling of. */
FragColor = vec4(btdf_accum, fresnel_accum, 0.0, 1.0);
}
diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl
index 94dd1a439db..e5cbc487e93 100644
--- a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl
@@ -19,7 +19,7 @@
* CLOSURE_EVAL_FUNCTION_3(name, Diffuse, Glossy, Refraction);
* // Get the cl_out
* closure.radiance = out_Diffuse_0.radiance + out_Glossy_1.radiance + out_Refraction_2.radiance;
- **/
+ */
#define CLOSURE_VARS_DECLARE(t0, t1, t2, t3) \
ClosureInputCommon in_common = CLOSURE_INPUT_COMMON_DEFAULT; \
@@ -291,7 +291,7 @@ ClosurePlanarData closure_planar_eval_init(inout ClosureEvalCommon cl_common)
ClosurePlanarData planar;
planar.attenuation = 0.0;
- /* Find planar with the maximum weight. TODO(fclem) */
+ /* TODO(fclem): Find planar with the maximum weight. */
for (int i = 0; i < prbNumPlanar && i < MAX_PLANAR; i++) {
float attenuation = probe_attenuation_planar(planars_data[i], cl_common.P);
if (attenuation > planar.attenuation) {
diff --git a/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl
index 38ae3972aa7..f66f45635f4 100644
--- a/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl
@@ -99,7 +99,7 @@ Closure closure_mix(Closure cl1, Closure cl2, float fac)
cl.flag = cl1.flag | cl2.flag;
cl.ssr_data = mix(cl1.ssr_data, cl2.ssr_data, fac);
bool use_cl1_ssr = FLAG_TEST(cl1.flag, CLOSURE_SSR_FLAG);
- /* When mixing SSR don't blend roughness and normals but only specular (ssr_data.xyz).*/
+ /* When mixing SSR don't blend roughness and normals but only specular (ssr_data.xyz). */
cl.ssr_data.w = (use_cl1_ssr) ? cl1.ssr_data.w : cl2.ssr_data.w;
cl.ssr_normal = (use_cl1_ssr) ? cl1.ssr_normal : cl2.ssr_normal;
@@ -122,7 +122,7 @@ Closure closure_add(Closure cl1, Closure cl2)
cl.flag = cl1.flag | cl2.flag;
cl.ssr_data = cl1.ssr_data + cl2.ssr_data;
bool use_cl1_ssr = FLAG_TEST(cl1.flag, CLOSURE_SSR_FLAG);
- /* When mixing SSR don't blend roughness and normals.*/
+ /* When mixing SSR don't blend roughness and normals. */
cl.ssr_data.w = (use_cl1_ssr) ? cl1.ssr_data.w : cl2.ssr_data.w;
cl.ssr_normal = (use_cl1_ssr) ? cl1.ssr_normal : cl2.ssr_normal;
diff --git a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl
index d7996ab4bd1..c935eca6a39 100644
--- a/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/common_uniforms_lib.glsl
@@ -37,7 +37,7 @@ layout(std140) uniform common_block
int prbIrradianceVisSize;
float prbIrradianceSmooth;
float prbLodCubeMax;
- /* Misc*/
+ /* Misc */
int rayType;
float rayDepth;
float alphaHashOffset;
diff --git a/source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl b/source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl
index 821859b3228..c3325ec4286 100644
--- a/source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/common_utiltex_lib.glsl
@@ -27,7 +27,7 @@ const float lut_btdf_layer_count = 16.0;
* x : Uniformly distributed value [0..1] (noise 1).
* y : Uniformly distributed value [0..1] (noise 2).
* z,w : Uniformly distributed point on the unit circle [-1..1] (noise 3).
- **/
+ */
#define texelfetch_noise_tex(coord) texelFetch(utilTex, ivec3(ivec2(coord) % LUT_SIZE, 2.0), 0)
/* Return texture coordinates to sample Surface LUT. */
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl
index 40e4c5a313e..5fd00986adc 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_bokeh_frag.glsl
@@ -5,7 +5,7 @@
* a perfect circle.
* We correct samples spacing for polygonal bokeh shapes. However, we do not for anamorphic bokeh
* as it is way more complex and expensive to do.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl
index 22e6f929f36..0cbf92466aa 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_dilate_tiles_frag.glsl
@@ -2,7 +2,7 @@
/**
* Tile dilate pass: Takes the 8x8 Tiles buffer and converts dilates the tiles with large CoC to
* their neighborhood. This pass is repeated multiple time until the maximum CoC can be covered.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl
index c477e0f6eb8..c33eda0acd2 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_downsample_frag.glsl
@@ -4,7 +4,7 @@
*
* Pretty much identical to the setup pass but get CoC from buffer. Also does not
* weight luma for the bilateral weights.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_filter_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_filter_frag.glsl
index 78c80438f60..aa72cda4fb7 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_filter_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_filter_frag.glsl
@@ -4,7 +4,7 @@
*
* This is a simple 3x3 median filter to avoid dilating highlights with a 3x3 max filter even if
* cheaper.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl
index bd81171c759..48195a1daea 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_flatten_tiles_frag.glsl
@@ -5,7 +5,7 @@
* Output min and max values for each tile and for both foreground & background.
* Also outputs min intersectable CoC for the background, which is the minimum CoC
* that comes from the background pixels.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl
index 8c2633084db..39a7e8fb931 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl
@@ -7,7 +7,7 @@
*
* We sample using an octaweb sampling pattern. We randomize the kernel center and each ring
* rotation to ensure maximum coverage.
- **/
+ */
#pragma BLENDER_REQUIRE(common_utiltex_lib.glsl)
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl
index dac53719149..e5b68637563 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl
@@ -324,7 +324,7 @@ float dof_coc_max_slight_focus(float coc1, float coc2)
struct DofGatherData {
vec4 color;
float weight;
- float dist; /* TODO remove */
+ float dist; /* TODO: remove. */
/* For scatter occlusion. */
float coc;
float coc_sqr;
@@ -395,7 +395,7 @@ void dof_gather_accumulate_sample_pair(DofGatherData pair_data[2],
/**
* If a CoC is larger than bordering radius we accumulate it to the general accumulator.
* If not, we accumulate to the ring bucket. This is to have more consistent sample occlusion.
- **/
+ */
float accum_weight = dof_gather_accum_weight(pair_data[i].coc, bordering_radius, first_ring);
dof_gather_accumulate_sample(pair_data[i], weight * accum_weight, accum_data);
dof_gather_accumulate_sample(pair_data[i], weight * (1.0 - accum_weight), ring_data);
@@ -607,7 +607,7 @@ ivec2 dof_square_ring_sample_offset(int ring_distance, int sample_id)
* . . . . .
*
* Samples are expected to be mirrored to complete the pattern.
- **/
+ */
ivec2 offset;
if (sample_id < ring_distance) {
offset.x = ring_distance;
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_reduce_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_reduce_frag.glsl
index 51a139ad343..1b5b305dfc1 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_reduce_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_reduce_frag.glsl
@@ -2,14 +2,14 @@
/**
* Reduce pass: Downsample the color buffer to generate mipmaps.
* Also decide if a pixel is to be convolved by scattering or gathering during the first pass.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
/** Inputs:
* COPY_PASS: Is output of setup pass (halfres) and downsample pass (quarter res).
* REDUCE_PASS: Is previous Gather input miplvl (halfres >> miplvl).
- **/
+ */
uniform sampler2D colorBuffer;
uniform sampler2D cocBuffer;
uniform sampler2D downsampledBuffer;
@@ -23,7 +23,7 @@ uniform float colorNeighborClamping;
/** Outputs:
* COPY_PASS: Gather input mip0.
* REDUCE_PASS: Is next Gather input miplvl (halfres >> miplvl).
- **/
+ */
layout(location = 0) out vec4 outColor;
layout(location = 1) out float outCoc;
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_resolve_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_resolve_frag.glsl
index 32841b7749c..57027c71156 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_resolve_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_resolve_frag.glsl
@@ -34,7 +34,7 @@ out vec4 fragColor;
void dof_slight_focus_gather(float radius, out vec4 out_color, out float out_weight)
{
- /* offset coord to avoid correlation with sampling pattern. */
+ /* offset coord to avoid correlation with sampling pattern. */
vec4 noise = texelfetch_noise_tex(gl_FragCoord.xy + 7.0);
DofGatherData fg_accum = GATHER_DATA_INIT;
@@ -199,7 +199,7 @@ void main(void)
fragColor = fragColor * (1.0 - layer_weight) + layer_color;
}
- /* Fix float precision issue in alpha compositing. */
+ /* Fix float precision issue in alpha compositing. */
if (fragColor.a > 0.99) {
fragColor.a = 1.0;
}
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl
index 704bbf6d999..06dcbeaed66 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_frag.glsl
@@ -4,7 +4,7 @@
*
* We only scatter one triangle per sprite and one sprite per 4 pixels to reduce vertex shader
* invocations and overdraw.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl
index 276ab119fab..f349806d37e 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_scatter_vert.glsl
@@ -25,7 +25,8 @@ flat out float spritesize;
/* Load 4 Circle of confusion values. texel_co is centered around the 4 taps. */
vec4 fetch_cocs(vec2 texel_co)
{
- /* TODO(fclem) The textureGather(sampler, co, comp) variant isn't here on some implementations.*/
+ /* TODO(fclem) The textureGather(sampler, co, comp) variant isn't here on some implementations.
+ */
#if 0 // GPU_ARB_texture_gather
vec2 uvs = texel_co / vec2(textureSize(cocBuffer, 0));
/* Reminder: Samples order is CW starting from top left. */
diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_setup_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_setup_frag.glsl
index d1ecc0fc244..235145b221b 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_dof_setup_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_dof_setup_frag.glsl
@@ -4,7 +4,7 @@
*
* An addition to the downsample CoC, we output the maximum slight out of focus CoC to be
* sure we don't miss a pixel.
- **/
+ */
#pragma BLENDER_REQUIRE(effect_dof_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl
index 6f2619127e3..7689e730bf3 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_reflection_resolve_frag.glsl
@@ -40,9 +40,9 @@ vec4 ssr_get_scene_color_and_mask(vec3 hit_vP, int planar_index, float mip)
}
else {
/* Find hit position in previous frame. */
- /* TODO Combine matrices. */
+ /* TODO: Combine matrices. */
vec3 hit_P = transform_point(ViewMatrixInverse, hit_vP);
- /* TODO real reprojection with motion vectors, etc... */
+ /* TODO: real reprojection with motion vectors, etc... */
uv = project_point(pastViewProjectionMatrix, hit_P).xy * 0.5 + 0.5;
}
diff --git a/source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl
index cd574c6c9fd..2f1efd588f7 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_reflection_trace_frag.glsl
@@ -89,7 +89,7 @@ void main()
if (fade > 0.5) {
/* Find view vector / reflection plane intersection. */
- /* TODO optimize, use view space for all. */
+ /* TODO: optimize, use view space for all. */
vec3 P_plane = line_plane_intersect(P, V, pd.pl_plane_eq);
vP = transform_point(ViewMatrix, P_plane);
diff --git a/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
index b79cd17c567..58bbb825043 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_subsurface_frag.glsl
@@ -23,7 +23,7 @@ layout(location = 0) out vec4 sssRadiance;
void main(void)
{
- vec2 pixel_size = 1.0 / vec2(textureSize(depthBuffer, 0).xy); /* TODO precompute */
+ vec2 pixel_size = 1.0 / vec2(textureSize(depthBuffer, 0).xy); /* TODO: precompute. */
vec2 uvs = gl_FragCoord.xy * pixel_size;
vec3 sss_irradiance = texture(sssIrradiance, uvs).rgb;
float sss_radius = texture(sssRadius, uvs).r * radii_max_radius.w;
diff --git a/source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl b/source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl
index 165aed2a46f..3c49caf11a9 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl
@@ -85,7 +85,7 @@ void main()
color_history.rgb = clip_to_aabb(color_history.rgb, min_col.rgb, max_col.rgb, avg_col.rgb);
/* Luminance weighting. */
- /* TODO correct luminance */
+ /* TODO: correct luminance. */
float lum0 = dot(color.rgb, vec3(0.333));
float lum1 = dot(color_history.rgb, vec3(0.333));
float diff = abs(lum0 - lum1) / max(lum0, max(lum1, 0.2));
diff --git a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl
index 356ed102928..ee48c468630 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl
@@ -35,8 +35,8 @@ vec3 sss_profile(float s)
float light_translucent_power_with_falloff(LightData ld, vec3 N, vec4 l_vector)
{
float power, falloff;
- /* XXX : Removing Area Power. */
- /* TODO : put this out of the shader. */
+ /* XXX: Removing Area Power. */
+ /* TODO: put this out of the shader. */
if (ld.l_type >= AREA_RECT) {
power = (ld.l_sizex * ld.l_sizey * 4.0 * M_PI) * (1.0 / 80.0);
if (ld.l_type == AREA_ELLIPSE) {
@@ -49,7 +49,7 @@ float light_translucent_power_with_falloff(LightData ld, vec3 N, vec4 l_vector)
}
else if (ld.l_type == SUN) {
power = 1.0 / (1.0 + (ld.l_radius * ld.l_radius * 0.5));
- power *= ld.l_radius * ld.l_radius * M_PI; /* Removing area light power*/
+ power *= ld.l_radius * ld.l_radius * M_PI; /* Removing area light power. */
power *= M_2PI * 0.78; /* Matching cycles with point light. */
power *= 0.082; /* XXX ad hoc, empirical */
falloff = dot(N, -ld.l_forward);
@@ -134,7 +134,7 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f
/* Size of a texel in world space.
* FIXME This is only correct if l_right is the same right vector used for shadowmap creation.
* This won't work if the shadow matrix is rotated (soft shadows).
- * TODO precompute */
+ * TODO: precompute. */
float unit_world_in_uv_space = length(mat3(scascade(data_id).shadowmat[int(id)]) * ld.l_right);
float dx_scale = 2.0 * ofs.x / unit_world_in_uv_space;
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_cube_display_vert.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_cube_display_vert.glsl
index d06ad553ca4..c9af2753baa 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_cube_display_vert.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_cube_display_vert.glsl
@@ -1,7 +1,7 @@
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
-/* XXX TODO fix code duplication */
+/* XXX TODO: fix code duplication. */
struct CubeData {
vec4 position_type;
vec4 attenuation_fac_type;
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
index c9b5d0dea36..84626eac4cf 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
@@ -192,7 +192,7 @@ vec3 probe_evaluate_planar(int id, PlanarData pd, vec3 P, vec3 N, vec3 V, float
vec3 point_on_plane = line_plane_intersect(P, V, pd.pl_plane_eq);
/* How far the pixel is from the plane. */
- float ref_depth = 1.0; /* TODO parameter */
+ float ref_depth = 1.0; /* TODO: parameter. */
/* Compute distorded reflection vector based on the distance to the reflected object.
* In other words find intersection between reflection vector and the sphere center
@@ -208,7 +208,7 @@ vec3 probe_evaluate_planar(int id, PlanarData pd, vec3 P, vec3 N, vec3 V, float
/* TODO: If we support non-ssr planar reflection, we should blur them with gaussian
* and chose the right mip depending on the cone footprint after projection */
- /* NOTE: X is inverted here to compensate inverted drawing. */
+ /* NOTE: X is inverted here to compensate inverted drawing. */
vec3 radiance = textureLod(probePlanars, vec3(refco.xy * vec2(-0.5, 0.5) + 0.5, id), 0.0).rgb;
return radiance;
@@ -278,7 +278,7 @@ vec3 probe_evaluate_grid(GridData gd, vec3 P, vec3 N, vec3 localpos)
float ws_dist_point_to_cell = length(ws_point_to_cell);
vec3 ws_light = ws_point_to_cell / ws_dist_point_to_cell;
- /* Smooth backface test */
+ /* Smooth back-face test. */
float weight = saturate(dot(ws_light, N));
/* Precomputed visibility */
diff --git a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl
index 2f1fd0ce5f8..dc98a00a1cd 100644
--- a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl
@@ -176,7 +176,7 @@ float sample_cube_shadow(int shadow_id, vec3 P)
float dist = max(sd(shadow_id).sh_near, max_v3(abs(cubevec)) - sd(shadow_id).sh_bias);
dist = buffer_depth(true, dist, sd(shadow_id).sh_far, sd(shadow_id).sh_near);
/* Manual Shadow Cube Layer indexing. */
- /* TODO Shadow Cube Array. */
+ /* TODO: Shadow Cube Array. */
float face = cubeFaceIndexEEVEE(cubevec);
vec2 coord = cubeFaceCoordEEVEE(cubevec, face, shadowCubeTexture);
/* tex_id == data_id for cube shadowmap */
diff --git a/source/blender/draw/engines/eevee/shaders/random_lib.glsl b/source/blender/draw/engines/eevee/shaders/random_lib.glsl
index 25a3e0f56b4..3a4ae257bbe 100644
--- a/source/blender/draw/engines/eevee/shaders/random_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/random_lib.glsl
@@ -1,7 +1,7 @@
/**
* Random numbers and low discrepency sequences utilities.
- **/
+ */
#pragma BLENDER_REQUIRE(common_math_lib.glsl)
diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
index 1b2135646c9..73c4b521b05 100644
--- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl
@@ -90,7 +90,7 @@ ScreenSpaceRay raytrace_screenspace_ray_create(Ray ray, float thickness)
}
struct RayTraceParameters {
- /** ViewSpace thickness the objects */
+ /** ViewSpace thickness the objects. */
float thickness;
/** Jitter along the ray to avoid banding artifact when steps are too large. */
float jitter;
@@ -101,7 +101,7 @@ struct RayTraceParameters {
};
/* Returns true on hit. */
-/* TODO fclem remove the backface check and do it the SSR resolve code. */
+/* TODO(fclem): remove the back-face check and do it the SSR resolve code. */
bool raytrace(Ray ray,
RayTraceParameters params,
const bool discard_backface,
@@ -151,7 +151,7 @@ bool raytrace(Ray ray,
/* ... and above it with the added thickness. */
hit = hit && (delta > ss_p.z - ss_p.w || abs(delta) < abs(ssray.direction.z * stride * 2.0));
}
- /* Discard backface hits. */
+ /* Discard back-face hits. */
hit = hit && !(discard_backface && prev_delta < 0.0);
/* Reject hit if background. */
hit = hit && (depth_sample != 1.0);
diff --git a/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl b/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
index 1d52dfeab26..a563291bb90 100644
--- a/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
@@ -63,7 +63,7 @@ vec4 screen_space_refraction(vec3 vP, vec3 N, vec3 V, float ior, float roughness
float cone_tan = sqrt(1 - cone_cos * cone_cos) / cone_cos;
/* Empirical fit for refraction. */
- /* TODO find a better fit or precompute inside the LUT. */
+ /* TODO: find a better fit or precompute inside the LUT. */
cone_tan *= 0.5 * fast_sqrt(f0_from_ior((ior < 1.0) ? 1.0 / ior : ior));
float cone_footprint = hit_dist * cone_tan;
diff --git a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl
index 0acb35b2399..0efa7b80b0b 100644
--- a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl
@@ -1,4 +1,4 @@
-/** This describe the entire interface of the shader. */
+/** This describe the entire interface of the shader. */
#define SURFACE_INTERFACE \
vec3 worldPosition; \
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_geom.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_geom.glsl
index b2d8a383809..5226da57a06 100644
--- a/source/blender/draw/engines/eevee/shaders/volumetric_geom.glsl
+++ b/source/blender/draw/engines/eevee/shaders/volumetric_geom.glsl
@@ -2,7 +2,7 @@
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
#ifdef MESH_SHADER
-/* TODO tight slices */
+/* TODO: tight slices. */
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
#else /* World */
@@ -17,7 +17,7 @@ flat out int slice;
RESOURCE_ID_VARYING
#ifdef MESH_SHADER
-/* TODO tight slices */
+/* TODO: tight slices. */
void main()
{
gl_Layer = slice = int(vPos[0].z);
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl
index 788e621c3c1..c48c3bffaef 100644
--- a/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl
@@ -70,7 +70,7 @@ vec3 light_volume(LightData ld, vec4 l_vector)
* Using "Point Light Attenuation Without Singularity" from Cem Yuksel
* http://www.cemyuksel.com/research/pointlightattenuation/pointlightattenuation.pdf
* http://www.cemyuksel.com/research/pointlightattenuation/
- **/
+ */
float d = l_vector.w;
float d_sqr = sqr(d);
float r_sqr = ld.l_volume_radius;
diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c
index adb21540afb..89ee3f1b293 100644
--- a/source/blender/draw/engines/external/external_engine.c
+++ b/source/blender/draw/engines/external/external_engine.c
@@ -314,7 +314,7 @@ static DrawEngineType draw_engine_external_type = {
NULL,
};
-/* Note: currently unused,
+/* NOTE: currently unused,
* we should not register unless we want to see this when debugging the view. */
RenderEngineType DRW_engine_viewport_external_type = {
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index af8b029a08e..8a2aebc95ab 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -102,7 +102,7 @@ GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob)
transpose_m4(mat);
/* mat is now a "normal" matrix which will transform
- * BBox space normal to world space. */
+ * BBox space normal to world space. */
mul_mat3_m4_v3(mat, tgp_ob->plane_normal);
normalize_v3(tgp_ob->plane_normal);
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 32884eb9e3f..d3a0c40fae5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -262,7 +262,7 @@ void GPENCIL_cache_init(void *ved)
pd->sbuffer_gpd = gpd;
pd->sbuffer_stroke = DRW_cache_gpencil_sbuffer_stroke_data_get(pd->obact);
pd->sbuffer_layer = BKE_gpencil_layer_active_get(pd->sbuffer_gpd);
- pd->do_fast_drawing = false; /* TODO option */
+ pd->do_fast_drawing = false; /* TODO: option. */
}
}
}
@@ -320,7 +320,7 @@ void GPENCIL_cache_init(void *ved)
float focal_len = cam->lens;
const float scale_camera = 0.001f;
- /* we want radius here for the aperture number */
+ /* We want radius here for the aperture number. */
float aperture = 0.5f * scale_camera * focal_len / fstop;
float focal_len_scaled = scale_camera * focal_len;
float sensor_scaled = scale_camera * sensor;
@@ -640,13 +640,13 @@ void GPENCIL_cache_populate(void *ved, Object *ob)
}
}
- BKE_gpencil_visible_stroke_iter(is_final_render ? pd->view_layer : NULL,
- ob,
- gpencil_layer_cache_populate,
- gpencil_stroke_cache_populate,
- &iter,
- do_onion,
- pd->cfra);
+ BKE_gpencil_visible_stroke_advanced_iter(is_final_render ? pd->view_layer : NULL,
+ ob,
+ gpencil_layer_cache_populate,
+ gpencil_stroke_cache_populate,
+ &iter,
+ do_onion,
+ pd->cfra);
gpencil_drawcall_flush(&iter);
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_antialiasing_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_antialiasing_frag.glsl
index b512b54e392..7758fdceb46 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_antialiasing_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_antialiasing_frag.glsl
@@ -17,7 +17,7 @@ out vec2 fragColor;
#elif SMAA_STAGE == 1
out vec4 fragColor;
#elif SMAA_STAGE == 2
-/* Reminder: Blending func is fragRevealage * DST + fragColor .*/
+/* Reminder: Blending func is `fragRevealage * DST + fragColor`. */
layout(location = 0, index = 0) out vec4 outColor;
layout(location = 0, index = 1) out vec4 outReveal;
#endif
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
index ac48b94fea9..b1368f90846 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
@@ -101,23 +101,23 @@ void blend_mode_output(
{
switch (blend_mode) {
case MODE_REGULAR:
- /* Reminder: Blending func is premult alpha blend (dst.rgba * (1 - src.a) + src.rgb).*/
+ /* Reminder: Blending func is premult alpha blend (dst.rgba * (1 - src.a) + src.rgb). */
color *= opacity;
frag_color = color;
frag_revealage = vec4(0.0, 0.0, 0.0, color.a);
break;
case MODE_MULTIPLY:
- /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/
+ /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */
color.a *= opacity;
frag_revealage = frag_color = (1.0 - color.a) + color.a * color;
break;
case MODE_DIVIDE:
- /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/
+ /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */
color.a *= opacity;
frag_revealage = frag_color = clamp(1.0 / max(vec4(1e-6), 1.0 - color * color.a), 0.0, 1e18);
break;
case MODE_HARDLIGHT:
- /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/
+ /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba). */
/**
* We need to separate the overlay equation into 2 term (one mul and one add).
* This is the standard overlay equation (per channel):
@@ -135,14 +135,14 @@ void blend_mode_output(
frag_revealage = max(vec4(0.0), frag_revealage);
break;
case MODE_HARDLIGHT_SECOND_PASS:
- /* Reminder: Blending func is additive blend (dst.rgba + src.rgba).*/
+ /* Reminder: Blending func is additive blend (dst.rgba + src.rgba). */
color = mix(vec4(0.5), color, color.a * opacity);
frag_revealage = frag_color = (-1.0 + 2.0 * color) * step(-0.5, -color);
frag_revealage = max(vec4(0.0), frag_revealage);
break;
case MODE_SUB:
case MODE_ADD:
- /* Reminder: Blending func is additive / subtractive blend (dst.rgba +/- src.rgba).*/
+ /* Reminder: Blending func is additive / subtractive blend (dst.rgba +/- src.rgba). */
frag_color = color * color.a * opacity;
frag_revealage = vec4(0.0);
break;
@@ -238,7 +238,7 @@ in vec4 pos; /* Prev adj vert */
in vec4 pos1; /* Current edge */
in vec4 pos2; /* Current edge */
in vec4 pos3; /* Next adj vert */
-/* xy is UV for fills, z is U of stroke, w is strength. */
+/* xy is UV for fills, z is U of stroke, w is strength. */
in vec4 uv1;
in vec4 uv2;
in vec4 col1;
@@ -347,7 +347,7 @@ float stroke_thickness_modulate(float thickness)
float clamp_small_stroke_thickness(float thickness)
{
/* To avoid aliasing artifacts, we clamp the line thickness and
- * reduce its opacity in the fragment shader.*/
+ * reduce its opacity in the fragment shader. */
float min_thickness = gl_Position.w * 1.3;
thickness = max(min_thickness, thickness);
diff --git a/source/blender/draw/engines/image/image_engine.c b/source/blender/draw/engines/image/image_engine.c
index 2522a445d8e..395d50fbc6b 100644
--- a/source/blender/draw/engines/image/image_engine.c
+++ b/source/blender/draw/engines/image/image_engine.c
@@ -31,6 +31,7 @@
#include "DNA_camera_types.h"
#include "DNA_screen_types.h"
+#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "ED_image.h"
@@ -116,7 +117,7 @@ static void space_image_gpu_texture_get(Image *image,
const int sima_flag = sima->flag & ED_space_image_get_display_channel_mask(ibuf);
if (sima_flag & SI_SHOW_ZBUF && (ibuf->zbuf || ibuf->zbuf_float || (ibuf->channels == 1))) {
if (ibuf->zbuf) {
- BLI_assert(!"Integer based depth buffers not supported");
+ BLI_assert_msg(0, "Integer based depth buffers not supported");
}
else if (ibuf->zbuf_float) {
*r_gpu_texture = GPU_texture_create_2d(
@@ -222,19 +223,30 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser
copy_v4_fl4(shuffle, 1.0f, 0.0f, 0.0f, 0.0f);
}
else if ((sima_flag & SI_SHOW_R) != 0) {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
+ draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
copy_v4_fl4(shuffle, 1.0f, 0.0f, 0.0f, 0.0f);
}
else if ((sima_flag & SI_SHOW_G) != 0) {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
+ draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
copy_v4_fl4(shuffle, 0.0f, 1.0f, 0.0f, 0.0f);
}
else if ((sima_flag & SI_SHOW_B) != 0) {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
+ draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
copy_v4_fl4(shuffle, 0.0f, 0.0f, 1.0f, 0.0f);
}
else /* RGB */ {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
}
}
if (space_type == SPACE_NODE) {
@@ -248,19 +260,30 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser
copy_v4_fl4(shuffle, 0.0f, 0.0f, 0.0f, 1.0f);
}
else if ((snode->flag & SNODE_SHOW_R) != 0) {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
+ draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
copy_v4_fl4(shuffle, 1.0f, 0.0f, 0.0f, 0.0f);
}
else if ((snode->flag & SNODE_SHOW_G) != 0) {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
+ draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
copy_v4_fl4(shuffle, 0.0f, 1.0f, 0.0f, 0.0f);
}
else if ((snode->flag & SNODE_SHOW_B) != 0) {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA | IMAGE_DRAW_FLAG_SHUFFLING;
+ draw_flags |= IMAGE_DRAW_FLAG_SHUFFLING;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
copy_v4_fl4(shuffle, 0.0f, 0.0f, 1.0f, 0.0f);
}
else /* RGB */ {
- draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ if (IMB_alpha_affects_rgb(ibuf)) {
+ draw_flags |= IMAGE_DRAW_FLAG_APPLY_ALPHA;
+ }
}
}
diff --git a/source/blender/draw/engines/image/shaders/engine_image_frag.glsl b/source/blender/draw/engines/image/shaders/engine_image_frag.glsl
index 2bccf0d99b5..55a2f2a72f1 100644
--- a/source/blender/draw/engines/image/shaders/engine_image_frag.glsl
+++ b/source/blender/draw/engines/image/shaders/engine_image_frag.glsl
@@ -28,7 +28,7 @@ in vec2 uvs;
out vec4 fragColor;
#ifdef TILED_IMAGE
-/* TODO(fclem): deduplicate code. */
+/* TODO(fclem): deduplicate code. */
bool node_tex_tile_lookup(inout vec3 co, sampler2DArray ima, sampler1DArray map)
{
vec2 tile_pos = floor(co.xy);
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c
index ea636c3d185..9d15f0e176d 100644
--- a/source/blender/draw/engines/overlay/overlay_armature.c
+++ b/source/blender/draw/engines/overlay/overlay_armature.c
@@ -37,6 +37,7 @@
#include "BKE_action.h"
#include "BKE_armature.h"
+#include "BKE_deform.h"
#include "BKE_modifier.h"
#include "DEG_depsgraph_query.h"
@@ -699,7 +700,7 @@ static void drw_shgroup_bone_ik_spline_lines(ArmatureDrawContext *ctx,
/* -------------------------------------------------------------------- */
/** \name Drawing Theme Helpers
*
- * Note, this section is duplicate of code in 'drawarmature.c'.
+ * \note this section is duplicate of code in 'drawarmature.c'.
*
* \{ */
@@ -1036,7 +1037,7 @@ static void draw_bone_update_disp_matrix_default(EditBone *eBone, bPoseChannel *
float(*disp_mat)[4];
float(*disp_tail_mat)[4];
- /* TODO : This should be moved to depsgraph or armature refresh
+ /* TODO: This should be moved to depsgraph or armature refresh
* and not be tight to the draw pass creation.
* This would refresh armature without invalidating the draw cache */
if (pchan) {
@@ -1200,9 +1201,9 @@ static void draw_bone_update_disp_matrix_bbone(EditBone *eBone, bPoseChannel *pc
float(*bone_mat)[4];
short bbone_segments;
- /* TODO : This should be moved to depsgraph or armature refresh
+ /* TODO: This should be moved to depsgraph or armature refresh
* and not be tight to the draw pass creation.
- * This would refresh armature without invalidating the draw cache */
+ * This would refresh armature without invalidating the draw cache. */
if (pchan) {
length = pchan->bone->length;
xwidth = pchan->bone->xwidth;
@@ -1268,7 +1269,7 @@ static void draw_bone_update_disp_matrix_custom(bPoseChannel *pchan)
float(*disp_tail_mat)[4];
float rot_mat[3][3];
- /* See TODO above */
+ /* See TODO: above. */
mul_v3_v3fl(bone_scale, pchan->custom_scale_xyz, PCHAN_CUSTOM_BONE_LENGTH(pchan));
bone_mat = pchan->custom_tx ? pchan->custom_tx->pose_mat : pchan->pose_mat;
disp_mat = pchan->disp_mat;
@@ -1889,7 +1890,7 @@ static void draw_bone_name(ArmatureDrawContext *ctx,
bool highlight = (pchan && (arm->flag & ARM_POSEMODE) && (boneflag & BONE_SELECTED)) ||
(eBone && (eBone->flag & BONE_SELECTED));
- /* Color Management: Exception here as texts are drawn in sRGB space directly. */
+ /* Color Management: Exception here as texts are drawn in sRGB space directly. */
UI_GetThemeColor4ubv(highlight ? TH_TEXT_HI : TH_TEXT, color);
float *head = pchan ? pchan->pose_head : eBone->head;
@@ -2018,7 +2019,7 @@ static void draw_armature_pose(ArmatureDrawContext *ctx)
((draw_ctx->object_mode == OB_MODE_OBJECT) &&
(scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) == 0) ||
/* Allow selection when in weight-paint mode
- * (selection code ensures this wont become active). */
+ * (selection code ensures this won't become active). */
((draw_ctx->object_mode & OB_MODE_ALL_WEIGHT_PAINT) &&
(draw_ctx->object_pose != NULL))))) &&
DRW_state_is_select();
@@ -2040,7 +2041,8 @@ static void draw_armature_pose(ArmatureDrawContext *ctx)
const Object *obact_orig = DEG_get_original_object(draw_ctx->obact);
- LISTBASE_FOREACH (bDeformGroup *, dg, &obact_orig->defbase) {
+ const ListBase *defbase = BKE_object_defgroup_list(obact_orig);
+ LISTBASE_FOREACH (const bDeformGroup *, dg, defbase) {
if (dg->flag & DG_LOCK_WEIGHT) {
pchan = BKE_pose_channel_find_name(ob->pose, dg->name);
diff --git a/source/blender/draw/engines/overlay/overlay_edit_mesh.c b/source/blender/draw/engines/overlay/overlay_edit_mesh.c
index 7639911286f..a7ed6c777e8 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_mesh.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_mesh.c
@@ -26,6 +26,7 @@
#include "DNA_mesh_types.h"
+#include "BKE_customdata.h"
#include "BKE_editmesh.h"
#include "draw_cache_impl.h"
diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c
index 9c58a2b574f..c2b130163e8 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_uv.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c
@@ -24,6 +24,7 @@
#include "draw_cache_impl.h"
#include "draw_manager_text.h"
+#include "BKE_customdata.h"
#include "BKE_editmesh.h"
#include "BKE_image.h"
#include "BKE_layer.h"
@@ -325,7 +326,7 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
if (pd->edit_uv.do_tiled_image_overlay) {
struct DRWTextStore *dt = DRW_text_cache_ensure();
uchar color[4];
- /* Color Management: Exception here as texts are drawn in sRGB space directly. */
+ /* Color Management: Exception here as texts are drawn in sRGB space directly. */
UI_GetThemeColorShade4ubv(TH_BACK, 60, color);
char text[16];
LISTBASE_FOREACH (ImageTile *, tile, &image->tiles) {
diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c
index 81b07b49784..235104245cc 100644
--- a/source/blender/draw/engines/overlay/overlay_engine.c
+++ b/source/blender/draw/engines/overlay/overlay_engine.c
@@ -200,7 +200,7 @@ static void OVERLAY_cache_init(void *vedata)
case CTX_MODE_OBJECT:
break;
default:
- BLI_assert(!"Draw mode invalid");
+ BLI_assert_msg(0, "Draw mode invalid");
break;
}
OVERLAY_antialiasing_cache_init(vedata);
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index 2e1c0165513..f5be9c846d1 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -887,7 +887,7 @@ static void camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb,
float *bundle_color_solid = G_draw.block.colorBundleSolid;
float *bundle_color_unselected = G_draw.block.colorWire;
uchar text_color_selected[4], text_color_unselected[4];
- /* Color Management: Exception here as texts are drawn in sRGB space directly. */
+ /* Color Management: Exception here as texts are drawn in sRGB space directly. */
UI_GetThemeColor4ubv(TH_SELECT, text_color_selected);
UI_GetThemeColor4ubv(TH_TEXT, text_color_unselected);
@@ -928,7 +928,7 @@ static void camera_view3d_reconstruction(OVERLAY_ExtraCallBuffers *cb,
const float *bundle_color;
if (track->flag & TRACK_CUSTOMCOLOR) {
/* Meh, hardcoded srgb transform here. */
- /* TODO change the actual DNA color to be linear. */
+ /* TODO: change the actual DNA color to be linear. */
srgb_to_linearrgb_v3_v3(bundle_color_custom, track->color);
bundle_color = bundle_color_custom;
}
@@ -1544,7 +1544,7 @@ static void OVERLAY_object_name(Object *ob, int theme_id)
{
struct DRWTextStore *dt = DRW_text_cache_ensure();
uchar color[4];
- /* Color Management: Exception here as texts are drawn in sRGB space directly. */
+ /* Color Management: Exception here as texts are drawn in sRGB space directly. */
UI_GetThemeColor4ubv(theme_id, color);
DRW_text_cache_add(dt,
diff --git a/source/blender/draw/engines/overlay/overlay_gpencil.c b/source/blender/draw/engines/overlay/overlay_gpencil.c
index aa26aa47faa..5c03d70d7be 100644
--- a/source/blender/draw/engines/overlay/overlay_gpencil.c
+++ b/source/blender/draw/engines/overlay/overlay_gpencil.c
@@ -431,7 +431,7 @@ static void OVERLAY_gpencil_color_names(Object *ob)
const DRWContextState *draw_ctx = DRW_context_state_get();
int cfra = DEG_get_ctime(draw_ctx->depsgraph);
- BKE_gpencil_visible_stroke_iter(
+ BKE_gpencil_visible_stroke_advanced_iter(
NULL, ob, NULL, overlay_gpencil_draw_stroke_color_name, ob, false, cfra);
}
diff --git a/source/blender/draw/engines/overlay/overlay_motion_path.c b/source/blender/draw/engines/overlay/overlay_motion_path.c
index a92f11aca38..e19d99dc597 100644
--- a/source/blender/draw/engines/overlay/overlay_motion_path.c
+++ b/source/blender/draw/engines/overlay/overlay_motion_path.c
@@ -177,7 +177,7 @@ static void motion_path_cache(OVERLAY_Data *vedata,
if (show_frame_no || (show_keyframes_no && show_keyframes)) {
int i;
uchar col[4], col_kf[4];
- /* Color Management: Exception here as texts are drawn in sRGB space directly. */
+ /* Color Management: Exception here as texts are drawn in sRGB space directly. */
UI_GetThemeColor3ubv(TH_TEXT_HI, col);
UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col_kf);
col[3] = col_kf[3] = 255;
diff --git a/source/blender/draw/engines/overlay/overlay_outline.c b/source/blender/draw/engines/overlay/overlay_outline.c
index f1467ff9794..e3f01d968ae 100644
--- a/source/blender/draw/engines/overlay/overlay_outline.c
+++ b/source/blender/draw/engines/overlay/overlay_outline.c
@@ -36,7 +36,7 @@
/* Returns the normal plane in NDC space. */
static void gpencil_depth_plane(Object *ob, float r_plane[4])
{
- /* TODO put that into private data. */
+ /* TODO: put that into private data. */
float viewinv[4][4];
DRW_view_viewmat_get(NULL, viewinv, true);
float *camera_z_axis = viewinv[2];
@@ -77,7 +77,7 @@ static void gpencil_depth_plane(Object *ob, float r_plane[4])
transpose_m4(mat);
/* mat is now a "normal" matrix which will transform
- * BBox space normal to world space. */
+ * BBox space normal to world space. */
mul_mat3_m4_v3(mat, r_plane);
normalize_v3(r_plane);
@@ -92,7 +92,7 @@ void OVERLAY_outline_init(OVERLAY_Data *vedata)
DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
if (DRW_state_is_fbo()) {
- /* TODO only alloc if needed. */
+ /* TODO: only alloc if needed. */
DRW_texture_ensure_fullscreen_2d(&txl->temp_depth_tx, GPU_DEPTH24_STENCIL8, 0);
DRW_texture_ensure_fullscreen_2d(&txl->outlines_id_tx, GPU_R16UI, 0);
@@ -263,13 +263,13 @@ static void OVERLAY_outline_gpencil(OVERLAY_PrivateData *pd, Object *ob)
gpencil_depth_plane(ob, iter.plane);
}
- BKE_gpencil_visible_stroke_iter(NULL,
- ob,
- gpencil_layer_cache_populate,
- gpencil_stroke_cache_populate,
- &iter,
- false,
- pd->cfra);
+ BKE_gpencil_visible_stroke_advanced_iter(NULL,
+ ob,
+ gpencil_layer_cache_populate,
+ gpencil_stroke_cache_populate,
+ &iter,
+ false,
+ pd->cfra);
}
static void OVERLAY_outline_volume(OVERLAY_PrivateData *pd, Object *ob)
diff --git a/source/blender/draw/engines/overlay/overlay_particle.c b/source/blender/draw/engines/overlay/overlay_particle.c
index 5fa74a8c3a6..e51f7032288 100644
--- a/source/blender/draw/engines/overlay/overlay_particle.c
+++ b/source/blender/draw/engines/overlay/overlay_particle.c
@@ -174,7 +174,7 @@ void OVERLAY_particle_cache_populate(OVERLAY_Data *vedata, Object *ob)
int draw_as = (part->draw_as == PART_DRAW_REND) ? part->ren_as : part->draw_as;
if (part->type == PART_HAIR) {
- /* Hairs should have been rendered by the render engine.*/
+ /* Hairs should have been rendered by the render engine. */
continue;
}
diff --git a/source/blender/draw/engines/overlay/overlay_private.h b/source/blender/draw/engines/overlay/overlay_private.h
index 969289a3219..03bfaf56f24 100644
--- a/source/blender/draw/engines/overlay/overlay_private.h
+++ b/source/blender/draw/engines/overlay/overlay_private.h
@@ -314,7 +314,7 @@ typedef struct OVERLAY_PrivateData {
DRWView *view_edit_text;
DRWView *view_reference_images;
- /** TODO get rid of this. */
+ /** TODO: get rid of this. */
ListBase smoke_domains;
ListBase bg_movie_clips;
@@ -333,8 +333,8 @@ typedef struct OVERLAY_PrivateData {
bool xray_enabled;
bool xray_enabled_and_not_wire;
float xray_opacity;
- short v3d_flag; /* TODO move to View3DOverlay */
- short v3d_gridflag; /* TODO move to View3DOverlay */
+ short v3d_flag; /* TODO: move to #View3DOverlay. */
+ short v3d_gridflag; /* TODO: move to #View3DOverlay. */
int cfra;
DRWState clipping_state;
OVERLAY_ShadingData shdata;
@@ -358,7 +358,7 @@ typedef struct OVERLAY_PrivateData {
bool select_vert;
bool select_face;
bool select_edge;
- int flag; /** Copy of v3d->overlay.edit_flag. */
+ int flag; /** Copy of #v3d->overlay.edit_flag. */
} edit_mesh;
struct {
bool use_weight;
diff --git a/source/blender/draw/engines/overlay/overlay_shader.c b/source/blender/draw/engines/overlay/overlay_shader.c
index c9c26e3faaa..7a7ae9a921b 100644
--- a/source/blender/draw/engines/overlay/overlay_shader.c
+++ b/source/blender/draw/engines/overlay/overlay_shader.c
@@ -1726,7 +1726,7 @@ OVERLAY_InstanceFormats *OVERLAY_shader_instance_formats_get(void)
{
{"boneStart", DRW_ATTR_FLOAT, 3},
{"boneEnd", DRW_ATTR_FLOAT, 3},
- {"wireColor", DRW_ATTR_FLOAT, 4}, /* TODO uchar color */
+ {"wireColor", DRW_ATTR_FLOAT, 4}, /* TODO: uchar color. */
{"boneColor", DRW_ATTR_FLOAT, 4},
{"headColor", DRW_ATTR_FLOAT, 4},
{"tailColor", DRW_ATTR_FLOAT, 4},
diff --git a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl
index c204949cc45..67d172fbd01 100644
--- a/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl
+++ b/source/blender/draw/engines/overlay/shaders/antialiasing_frag.glsl
@@ -105,7 +105,7 @@ void main()
float dist_raw = texelFetch(lineTex, center_texel, 0).b;
float dist = decode_line_dist(dist_raw);
- /* TODO Opti: use textureGather */
+ /* TODO: Opti: use textureGather. */
vec4 neightbor_col0 = texelFetchOffset(colorTex, center_texel, 0, ivec2(1, 0));
vec4 neightbor_col1 = texelFetchOffset(colorTex, center_texel, 0, ivec2(-1, 0));
vec4 neightbor_col2 = texelFetchOffset(colorTex, center_texel, 0, ivec2(0, 1));
diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
index 6398426952c..a2a478f400b 100644
--- a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
+++ b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_geom.glsl
@@ -54,7 +54,7 @@ void main(void)
* (avoid problems with point behind near plane).
* If the chosen point is parallel to the edge in screen space,
* choose the other point anyway.
- * This fixes some issue with cubes in orthographic views.*/
+ * This fixes some issue with cubes in orthographic views. */
if (vPos[0].z < vPos[3].z) {
hidden_point = (abs(fac0) > 1e-5) ? ssPos[0] : ssPos[3];
}
diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
index 45ebad0aafe..ddc6328e6a2 100644
--- a/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/armature_shape_outline_vert.glsl
@@ -36,7 +36,7 @@ void main()
/* This is slow and run per vertex, but it's still faster than
* doing it per instance on CPU and sending it on via instance attribute. */
mat3 normal_mat = transpose(inverse(mat3(model_mat)));
- /* TODO FIX: there is still a problem with this vector
+ /* TODO: FIX: there is still a problem with this vector
* when the bone is scaled or in persp mode. But it's
* barely visible at the outline corners. */
ssNor = normalize(normal_world_to_view(normal_mat * snor).xy);
diff --git a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
index 17e8d0da5d9..26796c82f66 100644
--- a/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
+++ b/source/blender/draw/engines/overlay/shaders/armature_shape_solid_frag.glsl
@@ -9,8 +9,8 @@ layout(location = 1) out vec4 lineOutput;
void main()
{
- /* Manual backface cullling.. Not ideal for performance
- * but needed for view clarity in xray mode and support
+ /* Manual back-face culling. Not ideal for performance
+ * but needed for view clarity in X-ray mode and support
* for inverted bone matrices. */
if ((inverted == 1) == gl_FrontFacing) {
discard;
diff --git a/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
index cb70a3b433c..b241a1f0568 100644
--- a/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/edit_uv_verts_vert.glsl
@@ -11,7 +11,7 @@ out vec4 fillColor;
out vec4 outlineColor;
out vec4 radii;
-/* TODO Theme? */
+/* TODO: Theme? */
const vec4 pinned_col = vec4(1.0, 0.0, 0.0, 1.0);
void main()
diff --git a/source/blender/draw/engines/overlay/shaders/extra_vert.glsl b/source/blender/draw/engines/overlay/shaders/extra_vert.glsl
index 74854dc0f8d..59c9d0a665d 100644
--- a/source/blender/draw/engines/overlay/shaders/extra_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/extra_vert.glsl
@@ -162,13 +162,13 @@ void main()
int color_class = int(floor(color.r));
float color_intensity = fract(color.r);
switch (color_class) {
- case 0: /* No eye (convergence plane) */
+ case 0: /* No eye (convergence plane). */
finalColor = vec4(1.0, 1.0, 1.0, 1.0);
break;
- case 1: /* Left eye */
+ case 1: /* Left eye. */
finalColor = vec4(0.0, 1.0, 1.0, 1.0);
break;
- case 2: /* Right eye */
+ case 2: /* Right eye. */
finalColor = vec4(1.0, 0.0, 0.0, 1.0);
break;
}
@@ -207,7 +207,7 @@ void main()
vec3 n1 = normalize(cross(edge, world_pos - p1));
bool persp = (ProjectionMatrix[3][3] == 0.0);
vec3 V = (persp) ? normalize(ViewMatrixInverse[3].xyz - world_pos) : ViewMatrixInverse[2].xyz;
- /* Discard non-silhouete edges. */
+ /* Discard non-silhouette edges. */
bool facing0 = dot(n0, V) > 0.0;
bool facing1 = dot(n1, V) > 0.0;
if (facing0 == facing1) {
diff --git a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl
index 1c54076f3ea..df10f3f7ae2 100644
--- a/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl
+++ b/source/blender/draw/engines/overlay/shaders/outline_detect_frag.glsl
@@ -279,7 +279,7 @@ void main()
vec2 line_start, line_end;
vec2 line_ofs;
bvec4 extra_edges, extra_edges2;
- /* TODO simplify this branching hell. */
+ /* TODO: simplify this branching hell. */
switch (edge_case) {
/* Straight lines. */
case YPOS:
diff --git a/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl b/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl
index 282799e1660..b89cd821b37 100644
--- a/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl
+++ b/source/blender/draw/engines/overlay/shaders/outline_prepass_geom.glsl
@@ -40,7 +40,7 @@ void main()
/* Don't outline if concave edge. */
/* That would hide a lot of non useful edge but it flickers badly.
- * TODO revisit later... */
+ * TODO: revisit later... */
// if (dot(n0, v13) > 0.01)
// return;
diff --git a/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl b/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl
index 9d102bd4295..052ad2a7f36 100644
--- a/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/paint_point_vert.glsl
@@ -14,7 +14,7 @@ void main()
vec3 world_pos = point_object_to_world(pos);
gl_Position = point_world_to_ndc(world_pos);
/* Add offset in Z to avoid zfighting and render selected wires on top. */
- /* TODO scale this bias using znear and zfar range. */
+ /* TODO: scale this bias using znear and zfar range. */
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
if (is_hidden) {
diff --git a/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl b/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl
index d5a42d2d309..6a937d846c4 100644
--- a/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/paint_wire_vert.glsl
@@ -16,7 +16,7 @@ void main()
vec3 world_pos = point_object_to_world(pos);
gl_Position = point_world_to_ndc(world_pos);
/* Add offset in Z to avoid zfighting and render selected wires on top. */
- /* TODO scale this bias using znear and zfar range. */
+ /* TODO: scale this bias using znear and zfar range. */
gl_Position.z -= (is_select ? 2e-4 : 1e-4);
if (is_hidden) {
diff --git a/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl b/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl
index 0b827601f8e..174b31b6816 100644
--- a/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/volume_velocity_vert.glsl
@@ -33,7 +33,7 @@ const vec3 corners[4] = vec3[4](vec3(0.0, 0.2, -0.5),
const int indices[12] = int[12](0, 1, 1, 2, 2, 0, 0, 3, 1, 3, 2, 3);
/* Straight Port from BKE_defvert_weight_to_rgb()
- * TODO port this to a color ramp. */
+ * TODO: port this to a color ramp. */
vec3 weight_to_color(float weight)
{
vec3 r_rgb = vec3(0.0);
diff --git a/source/blender/draw/engines/select/select_engine.c b/source/blender/draw/engines/select/select_engine.c
index c9c4a2076ef..86b4a0ac727 100644
--- a/source/blender/draw/engines/select/select_engine.c
+++ b/source/blender/draw/engines/select/select_engine.c
@@ -373,7 +373,7 @@ DrawEngineType draw_engine_select_type = {
NULL,
};
-/* Note: currently unused, we may want to register so we can see this when debugging the view. */
+/* NOTE: currently unused, we may want to register so we can see this when debugging the view. */
RenderEngineType DRW_engine_viewport_select_type = {
NULL,
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
index d0d52c8485b..9038aae533b 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_cavity_lib.glsl
@@ -43,7 +43,7 @@ void cavity_compute(vec2 screenco,
/* convert from -1.0...1.0 range to 0.0..1.0 for easy use with texture coordinates */
offset *= 0.5;
- /* Note. Putting noise usage here to put some ALU after texture fetch. */
+ /* NOTE: Putting noise usage here to put some ALU after texture fetch. */
vec2 rotX = noise.rg;
vec2 rotY = vec2(-rotX.y, rotX.x);
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
index 122c99ca536..8cbc8608f5b 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
@@ -59,7 +59,7 @@ void workbench_float_pair_decode(float data, out float v1, out float v2)
{
// const uint v1_mask = ~(0xFFFFFFFFu << ROUGHNESS_BITS);
// const uint v2_mask = ~(0xFFFFFFFFu << METALLIC_BITS);
- /* Same as above because some compiler are very dumb and think we use medium int. */
+ /* Same as above because some compiler are very dumb and think we use medium int. */
const int v1_mask = 0x1F;
const int v2_mask = 0x7;
int idata = int(data);
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl
index 6e10a656fc1..c5b2ce0fd99 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_composite_frag.glsl
@@ -24,7 +24,7 @@ void main()
workbench_float_pair_decode(mat_data.a, roughness, metallic);
#ifdef V3D_LIGHTING_MATCAP
- /* When using matcaps, mat_data.a is the backface sign. */
+ /* When using matcaps, mat_data.a is the back-face sign. */
N = (mat_data.a > 0.0) ? N : -N;
fragColor.rgb = get_matcap_lighting(base_color, N, I);
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
index a76a14fa750..2e229d4d83a 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_data_lib.glsl
@@ -12,7 +12,7 @@ struct WorldData {
float shadow_shift;
float shadow_mul;
float shadow_add;
- /* - 16 bytes alignment- */
+ /* - 16 bytes alignment - */
LightData lights[4];
vec4 ambient_color;
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
index 8f6940a6062..92d5df1a13a 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
@@ -394,7 +394,7 @@ void main()
vec2 pixel_size = 0.5 / vec2(textureSize(halfResColorTex, 0).xy);
vec2 uv = gl_FragCoord.xy * pixel_size;
- /* TODO MAKE SURE TO ALIGN SAMPLE POSITION TO AVOID OFFSET IN THE BOKEH */
+ /* TODO: MAKE SURE TO ALIGN SAMPLE POSITION TO AVOID OFFSET IN THE BOKEH. */
float depth = texelFetch(sceneDepthTex, ivec2(gl_FragCoord.xy), 0).r;
float zdepth = linear_depth(depth);
float coc = calculate_coc(zdepth);
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
index 690ba1b92bc..57d648d3565 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_image_lib.glsl
@@ -1,5 +1,5 @@
-/* TODO(fclem): deduplicate code. */
+/* TODO(fclem): deduplicate code. */
bool node_tex_tile_lookup(inout vec3 co, sampler2DArray ima, sampler1DArray map)
{
vec2 tile_pos = floor(co.xy);
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
index 9bd49bb84f8..48102b4dcca 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
@@ -198,7 +198,7 @@ void volume_properties(vec3 ls_pos, out vec3 scattering, out float extinction)
scattering *= exp(clamp(log(shadows) * densityScale * 0.1, -2.5, 0.0)) * M_PI;
# ifdef VOLUME_SMOKE
- /* 800 is arbitrary and here to mimic old viewport. TODO make it a parameter */
+ /* 800 is arbitrary and here to mimic old viewport. TODO: make it a parameter. */
scattering += emission.rgb * emission.a * 800.0;
# endif
#endif
@@ -247,7 +247,7 @@ vec4 volume_integration(vec3 ray_ori, vec3 ray_dir, float ray_inc, float ray_max
void main()
{
#ifdef VOLUME_SLICE
- /* Manual depth test. TODO remove. */
+ /* Manual depth test. TODO: remove. */
float depth = texelFetch(depthBuffer, ivec2(gl_FragCoord.xy), 0).r;
if (gl_FragCoord.z >= depth) {
discard;
diff --git a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
index 10a782c9987..8206add7412 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.c
@@ -247,7 +247,7 @@ void workbench_antialiasing_engine_init(WORKBENCH_Data *vedata)
GPU_ATTACHMENT_TEXTURE(wpd->smaa_weight_tx),
});
- /* TODO could be shared for all viewports. */
+ /* TODO: could be shared for all viewports. */
if (txl->smaa_search_tx == NULL) {
txl->smaa_search_tx = GPU_texture_create_2d(
"smaa_search", SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT, 1, GPU_R8, NULL);
diff --git a/source/blender/draw/engines/workbench/workbench_effect_cavity.c b/source/blender/draw/engines/workbench/workbench_effect_cavity.c
index 199abe8cb2b..b294b9a62ca 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_cavity.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_cavity.c
@@ -31,7 +31,7 @@
#include "BLI_rand.h"
-#include "../eevee/eevee_lut.h" /* TODO find somewhere to share blue noise Table */
+#include "../eevee/eevee_lut.h" /* TODO: find somewhere to share blue noise Table. */
#include "workbench_engine.h"
#include "workbench_private.h"
diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c
index a00453fe125..2261790226a 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_dof.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c
@@ -157,7 +157,7 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata)
const float *full_size = DRW_viewport_size_get();
const int size[2] = {max_ii(1, (int)full_size[0] / 2), max_ii(1, (int)full_size[1] / 2)};
#if 0 /* TODO(fclem): finish COC min_max optimization. */
- /* NOTE: We Ceil here in order to not miss any edge texel if using a NPO2 texture. */
+ /* NOTE: We Ceil here in order to not miss any edge texel if using a NPO2 texture. */
int shrink_h_size[2] = {ceilf(size[0] / 8.0f), size[1]};
int shrink_w_size[2] = {shrink_h_size[0], ceilf(size[1] / 8.0f)};
#endif
@@ -218,9 +218,9 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata)
float focus_dist = BKE_camera_object_dof_distance(camera);
float focal_len = cam->lens;
- /* TODO(fclem): deduplicate with eevee */
+ /* TODO(fclem): de-duplicate with EEVEE. */
const float scale_camera = 0.001f;
- /* we want radius here for the aperture number */
+ /* We want radius here for the aperture number. */
float aperture = 0.5f * scale_camera * focal_len / fstop;
float focal_len_scaled = scale_camera * focal_len;
float sensor_scaled = scale_camera * sensor;
diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c
index 0d7f2e67598..e9d6763fbe9 100644
--- a/source/blender/draw/engines/workbench/workbench_engine.c
+++ b/source/blender/draw/engines/workbench/workbench_engine.c
@@ -460,7 +460,7 @@ void workbench_cache_finish(void *ved)
workbench_update_material_ubos(wpd);
- /* TODO don't free reuse next redraw. */
+ /* TODO: don't free reuse next redraw. */
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
for (int k = 0; k < WORKBENCH_DATATYPE_MAX; k++) {
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index 800d1085505..aaa1a5a6ff6 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -126,7 +126,7 @@ BLI_INLINE void workbench_material_get_image(
break;
}
default:
- BLI_assert(!"Node type not supported by workbench");
+ BLI_assert_msg(0, "Node type not supported by workbench");
}
}
}
diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h
index 6247436feea..453ef9c7f8e 100644
--- a/source/blender/draw/engines/workbench/workbench_private.h
+++ b/source/blender/draw/engines/workbench/workbench_private.h
@@ -381,13 +381,13 @@ typedef struct WORKBENCH_ObjectData {
} WORKBENCH_ObjectData;
typedef struct WORKBENCH_ViewLayerData {
- /** Depth of field sample location array.*/
+ /** Depth of field sample location array. */
struct GPUUniformBuf *dof_sample_ubo;
- /** All constant data used for a render loop.*/
+ /** All constant data used for a render loop. */
struct GPUUniformBuf *world_ubo;
- /** Cavity sample location array.*/
+ /** Cavity sample location array. */
struct GPUUniformBuf *cavity_sample_ubo;
- /** Blue noise texture used to randomize the sampling of some effects.*/
+ /** Blue noise texture used to randomize the sampling of some effects. */
struct GPUTexture *cavity_jitter_tx;
/** Materials UBO's allocated in a memblock for easy bookkeeping. */
struct BLI_memblock *material_ubo;
diff --git a/source/blender/draw/engines/workbench/workbench_shadow.c b/source/blender/draw/engines/workbench/workbench_shadow.c
index 99d945c311e..3386d9b6390 100644
--- a/source/blender/draw/engines/workbench/workbench_shadow.c
+++ b/source/blender/draw/engines/workbench/workbench_shadow.c
@@ -65,7 +65,7 @@ static void workbench_shadow_update(WORKBENCH_PrivateData *wpd)
const float up[3] = {0.0f, 0.0f, 1.0f};
unit_m4(wpd->shadow_mat);
- /* TODO fix singularity. */
+ /* TODO: fix singularity. */
copy_v3_v3(wpd->shadow_mat[2], wpd->shadow_direction_ws);
cross_v3_v3v3(wpd->shadow_mat[0], wpd->shadow_mat[2], up);
normalize_v3(wpd->shadow_mat[0]);
diff --git a/source/blender/draw/engines/workbench/workbench_transparent.c b/source/blender/draw/engines/workbench/workbench_transparent.c
index edeb17cd9a4..ad855cb284c 100644
--- a/source/blender/draw/engines/workbench/workbench_transparent.c
+++ b/source/blender/draw/engines/workbench/workbench_transparent.c
@@ -46,7 +46,7 @@ void workbench_transparent_engine_init(WORKBENCH_Data *data)
DrawEngineType *owner = (DrawEngineType *)&workbench_transparent_engine_init;
/* Reuse same format as opaque pipeline to reuse the textures. */
- /* Note: Floating point texture is required for the reveal_tex as it is used for
+ /* NOTE: Floating point texture is required for the reveal_tex as it is used for
* the alpha accumulation component (see accumulation shader for more explanation). */
const eGPUTextureFormat accum_tex_format = GPU_RGBA16F;
const eGPUTextureFormat reveal_tex_format = NORMAL_ENCODING_ENABLED() ? GPU_RG16F : GPU_RGBA32F;
diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c
index ddda6d7b58e..daeadce3059 100644
--- a/source/blender/draw/engines/workbench/workbench_volume.c
+++ b/source/blender/draw/engines/workbench/workbench_volume.c
@@ -125,7 +125,7 @@ static void workbench_volume_modifier_cache_populate(WORKBENCH_Data *vedata,
fds->slice_axis - 1;
float dim[3];
BKE_object_dimensions_get(ob, dim);
- /* 0.05f to achieve somewhat the same opacity as the full view. */
+ /* 0.05f to achieve somewhat the same opacity as the full view. */
float step_length = max_ff(1e-16f, dim[axis] * 0.05f);
grp = DRW_shgroup_create(sh, vedata->psl->volume_ps);
@@ -266,7 +266,7 @@ static void workbench_volume_object_cache_populate(WORKBENCH_Data *vedata,
float dim[3];
BKE_object_dimensions_get(ob, dim);
- /* 0.05f to achieve somewhat the same opacity as the full view. */
+ /* 0.05f to achieve somewhat the same opacity as the full view. */
float step_length = max_ff(1e-16f, dim[axis] * 0.05f);
const float slice_position = volume->display.slice_depth;