diff options
author | Dilith Jayakody <dilithjay@gmail.com> | 2021-07-20 17:53:34 +0300 |
---|---|---|
committer | Dilith Jayakody <dilithjay@gmail.com> | 2021-07-20 17:53:34 +0300 |
commit | 227e1429e8a4c9c3f1485924f3713bd502424cc2 (patch) | |
tree | 8829731347b8025a777a31c8ae89d755c4a0d0e4 /source/blender/draw/engines/eevee | |
parent | 71ef45f142b3efc2fd1032ce0e92ec4abdacc1ed (diff) |
Merge branch 'master' into soc-2021-curves
Diffstat (limited to 'source/blender/draw/engines/eevee')
52 files changed, 123 insertions, 122 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; |