diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-01 03:35:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-01 03:51:10 +0300 |
commit | 63f0e150edaeea26fbcc48f62597f4f5c71cc64a (patch) | |
tree | 275c7ec1f9732fd992ce8351cf0da284211edb99 /source/blender/draw/engines | |
parent | 480a09a92f7f1f28aabb4ad84b86ddccd6580afc (diff) |
Cleanup: comments (long lines) in draw
Diffstat (limited to 'source/blender/draw/engines')
24 files changed, 85 insertions, 61 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_bloom.c b/source/blender/draw/engines/eevee/eevee_bloom.c index e5d33daa0d0..b0013151a70 100644 --- a/source/blender/draw/engines/eevee/eevee_bloom.c +++ b/source/blender/draw/engines/eevee/eevee_bloom.c @@ -206,31 +206,32 @@ void EEVEE_bloom_cache_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *ved if ((effects->enabled_effects & EFFECT_BLOOM) != 0) { /** Bloom algorithm * - * Overview : + * Overview: * - Downsample the color buffer doing a small blur during each step. * - Accumulate bloom color using previously downsampled color buffers * and do an upsample blur for each new accumulated layer. * - Finally add accumulation buffer onto the source color buffer. * * [1/1] is original copy resolution (can be half or quarter res for performance) + * <pre> + * [DOWNSAMPLE CHAIN] [UPSAMPLE CHAIN] * - * [DOWNSAMPLE CHAIN] [UPSAMPLE CHAIN] - * - * Source Color ── [Blit] ──> Bright Color Extract [1/1] Final Color - * | Λ - * [Downsample First] Source Color ─> + [Resolve] - * v | - * Color Downsampled [1/2] ────────────> + Accumulation Buffer [1/2] - * | Λ - * ─── ─── - * Repeat Repeat - * ─── ─── - * v | - * Color Downsampled [1/N-1] ──────────> + Accumulation Buffer [1/N-1] - * | Λ - * [Downsample] [Upsample] - * v | - * Color Downsampled [1/N] ─────────────────────────┘ + * Source Color ─ [Blit] ─> Bright Color Extract [1/1] Final Color + * | Λ + * [Downsample First] Source Color ─> + [Resolve] + * v | + * Color Downsampled [1/2] ────────────> + Accumulation Buffer [1/2] + * | Λ + * ─── ─── + * Repeat Repeat + * ─── ─── + * v | + * Color Downsampled [1/N-1] ──────────> + Accumulation Buffer [1/N-1] + * | Λ + * [Downsample] [Upsample] + * v | + * Color Downsampled [1/N] ─────────────────────────┘ + * </pre> */ DRWShadingGroup *grp; const bool use_highres = true; 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 62ccf30e12c..0864d869451 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -141,10 +141,12 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), float focus_dist = BKE_camera_object_dof_distance(camera); float focal_len = cam->lens; - /* this is factor that converts to the scene scale. focal length and sensor are expressed in mm - * unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though - * because the shader reads coordinates in world space, which is in blender units. - * Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */ + /* this is factor that converts to the scene scale. focal length and sensor are expressed in + * mm unit.scale_length is how many meters per blender unit we have. We want to convert to + * blender units though because the shader reads coordinates in world space, which is in + * blender units. + * Note however that focus_distance is already in blender units and shall not be scaled here + * (see T48157). */ float scale = (scene_eval->unit.system) ? scene_eval->unit.scale_length : 1.0f; float scale_camera = 0.001f / scale; /* we want radius here for the aperture number */ diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 550821ee92a..a4a17de7a57 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -145,7 +145,8 @@ static void planar_pool_ensure_alloc(EEVEE_Data *vedata, int num_planar_ref) width, height, max_ii(1, num_planar_ref), GPU_DEPTH_COMPONENT24, 0, NULL); } else if (num_planar_ref == 0) { - /* Makes Opengl Happy : Create a placeholder texture that will never be sampled but still bound to shader. */ + /* Makes Opengl Happy : Create a placeholder texture that will never be sampled but still + * bound to shader. */ txl->planar_pool = DRW_texture_create_2d_array( 1, 1, 1, GPU_RGBA8, DRW_TEX_FILTER | DRW_TEX_MIPMAP, NULL); txl->planar_depth = DRW_texture_create_2d_array(1, 1, 1, GPU_DEPTH_COMPONENT24, 0, NULL); diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c index 917043d70e7..270defb039b 100644 --- a/source/blender/draw/engines/eevee/eevee_lights.c +++ b/source/blender/draw/engines/eevee/eevee_lights.c @@ -680,7 +680,8 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli) power = 1.0f / (evli->sizex * evli->sizey * 4.0f * M_PI) * /* 1/(w*h*Pi) */ 80.0f; /* 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. */ + /* Scale power to account for the lower area of the ellipse compared to the surrounding + * rectangle. */ power *= 4.0f / M_PI; } } @@ -693,8 +694,9 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli) } else { power = 1.0f / (evli->radius * evli->radius * M_PI); /* 1/(r²*Pi) */ - /* Make illumation power closer to cycles for bigger radii. Cycles uses a cos^3 term that we cannot reproduce - * so we account for that by scaling the light power. This function is the result of a rough manual fitting. */ + /* Make illumation power closer to cycles for bigger radii. Cycles uses a cos^3 term that we + * cannot reproduce so we account for that by scaling the light power. This function is the + * result of a rough manual fitting. */ power += 1.0f / (2.0f * M_PI); /* power *= 1 + r²/2 */ } return power; @@ -1383,7 +1385,8 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) DRW_draw_pass(psl->shadow_pass); } - /* 0.001f is arbitrary, but it should be relatively small so that filter size is not too big. */ + /* 0.001f is arbitrary, but it should be relatively small so that filter size is not too big. + */ float filter_texture_size = la->soft * 0.001f; float filter_pixel_size = ceil(filter_texture_size / srd->cube_texel_size); linfo->filter_size = srd->cube_texel_size * ((filter_pixel_size > 1.0f) ? 1.5f : 0.0f); diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index ae145546856..8d90a2d29cc 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -1409,9 +1409,9 @@ static void material_opaque(Material *ma, } else { if (use_translucency) { - /* NOTE: This is a nasty workaround, because the sss profile might not have been generated - * but the UBO is still declared in this case even if not used. But rendering without a - * bound UBO might result in crashes on certain platform. */ + /* NOTE: This is a nasty workaround, because the sss profile might not have been + * generated but the UBO is still declared in this case even if not used. + * But rendering without a bound UBO might result in crashes on certain platform. */ DRW_shgroup_uniform_block(*shgrp, "sssProfile", e_data.dummy_sss_profile); } } diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c index a3603fc3d64..22c7dd00b97 100644 --- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c +++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c @@ -296,8 +296,9 @@ void EEVEE_reflection_compute(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v /* Resolve at fullres */ int sample = (DRW_state_is_image_render()) ? effects->taa_render_sample : effects->taa_current_sample; - /* Doing a neighbor shift only after a few iteration. We wait for a prime number of cycles to avoid - * noise correlation. This reduces variance faster. */ + /* Doing a neighbor shift only after a few iteration. + * We wait for a prime number of cycles to avoid noise correlation. + * This reduces variance faster. */ effects->ssr_neighbor_ofs = ((sample / 5) % 8) * 4; switch ((sample / 11) % 4) { case 0: 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 f23303c5b93..32076b47d8c 100644 --- a/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/ambient_occlusion_lib.glsl @@ -1,7 +1,8 @@ /* Based on Practical Realtime Strategies for Accurate Indirect Occlusion * http://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf - * http://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pptx */ + * http://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pptx + */ #if defined(MESH_SHADER) # if !defined(USE_ALPHA_HASH) 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 2edc827b7fa..3a5f20b952e 100644 --- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl @@ -319,7 +319,8 @@ float line_unit_sphere_intersect_dist(vec3 lineorigin, vec3 linedirection) float line_unit_box_intersect_dist(vec3 lineorigin, vec3 linedirection) { - /* https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ */ + /* https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ + */ vec3 firstplane = (vec3(1.0) - lineorigin) / linedirection; vec3 secondplane = (vec3(-1.0) - lineorigin) / linedirection; vec3 furthestplane = max(firstplane, secondplane); 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 3ec695fcdbc..518eff29c62 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_temporal_aa.glsl @@ -14,7 +14,8 @@ vec4 safe_color(vec4 c) /** * Adapted from https://casual-effects.com/g3d/G3D10/data-files/shader/Film/Film_temporalAA.pix - * which is adapted from https://github.com/gokselgoktas/temporal-anti-aliasing/blob/master/Assets/Resources/Shaders/TemporalAntiAliasing.cginc + * which is adapted from + * https://github.com/gokselgoktas/temporal-anti-aliasing/blob/master/Assets/Resources/Shaders/TemporalAntiAliasing.cginc * which is adapted from https://github.com/playdeadgames/temporal * Optimization by Stubbesaurus and epsilon adjustment to avoid division by zero. * diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl index 0c7be71d914..a70ac686efd 100644 --- a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl @@ -161,7 +161,8 @@ vec3 probe_evaluate_cube(int pd_id, vec3 W, vec3 R, float roughness) /* From Frostbite PBR Course * Distance based roughness - * http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf */ + * http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf + */ float original_roughness = roughness; float linear_roughness = sqrt(roughness); float distance_roughness = saturate(dist * linear_roughness / length(intersection)); diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl index c8b57c5dec2..37b0ebb33cf 100644 --- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl @@ -282,7 +282,8 @@ void CLOSURE_NAME(vec3 N /* ---------------- SPECULAR ENVIRONMENT LIGHTING ----------------- */ /* ---------------------------------------------------------------- */ - /* Accumulate incoming light from all sources until accumulator is full. Then apply Occlusion and BRDF. */ + /* Accumulate incoming light from all sources until accumulator is full. Then apply Occlusion and + * BRDF. */ #ifdef CLOSURE_GLOSSY vec4 spec_accum = vec4(0.0); #endif diff --git a/source/blender/draw/engines/eevee/shaders/ltc_lib.glsl b/source/blender/draw/engines/eevee/shaders/ltc_lib.glsl index 88dd9f46b55..2cf8501de9b 100644 --- a/source/blender/draw/engines/eevee/shaders/ltc_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/ltc_lib.glsl @@ -164,8 +164,8 @@ void ltc_transform_quad(vec3 N, vec3 V, mat3 Minv, inout vec3 corners[4]) corners[3] = normalize(Minv * corners[3]); } -/* If corners have already pass through ltc_transform_quad(), then N **MUST** be vec3(0.0, 0.0, 1.0), - * corresponding to the Up axis of the shading basis. */ +/* If corners have already pass through ltc_transform_quad(), + * then N **MUST** be vec3(0.0, 0.0, 1.0), corresponding to the Up axis of the shading basis. */ float ltc_evaluate_quad(vec3 corners[4], vec3 N) { /* Approximation using a sphere of the same solid angle than the quad. diff --git a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl index 49c4569f585..82581f2327b 100644 --- a/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/raytrace_lib.glsl @@ -84,8 +84,8 @@ void prepare_raycast(vec3 ray_origin, ss_end.w = project_point(ProjectionMatrix, ray_end).z; /* XXX This is a hack a better method is welcome ! */ - /* We take the delta between the offseted depth and the depth and substract it from the ray depth. - * This will change the world space thickness appearance a bit but we can have negative + /* We take the delta between the offseted depth and the depth and substract it from the ray + * depth. This will change the world space thickness appearance a bit but we can have negative * values without worries. We cannot do this in viewspace because of the perspective division. */ ss_start.w = 2.0 * ss_start.z - ss_start.w; ss_end.w = 2.0 * ss_end.z - ss_end.w; diff --git a/source/blender/draw/engines/eevee/shaders/shadow_store_frag.glsl b/source/blender/draw/engines/eevee/shaders/shadow_store_frag.glsl index 5c0f5adda27..f24032c4360 100644 --- a/source/blender/draw/engines/eevee/shaders/shadow_store_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/shadow_store_frag.glsl @@ -36,7 +36,8 @@ vec3 octahedral_to_cubemap_proj(vec2 co) } /* Marco Salvi's GDC 2008 presentation about shadow maps pre-filtering techniques slide 24 */ -/* http://advances.realtimerendering.com/s2009/SIGGRAPH%202009%20-%20Lighting%20Research%20at%20Bungie.pdf Slide 55*/ +/* http://advances.realtimerendering.com/s2009/SIGGRAPH%202009%20-%20Lighting%20Research%20at%20Bungie.pdf + * Slide 55. */ #define ln_space_prefilter_step(ref, sample) exp(sample - ref) #define ln_space_prefilter_finalize(ref, sum) (ref + log(shadowInvSampleCount * sum)) diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index 29749ce6712..d0f8826c914 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -216,7 +216,8 @@ static DrawEngineType draw_engine_external_type = { NULL, }; -/* Note: currently unused, we should not register unless we want to see this when debugging the view. */ +/* Note: currently unused, + * we should not register unless we want to see this when debugging the view. */ RenderEngineType DRW_engine_viewport_external_type = { NULL, diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c index c1014bb5ca4..7dabbcf4c41 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -634,8 +634,9 @@ GPUBatch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd) float(*points2d)[2] = MEM_mallocN(sizeof(*points2d) * totpoints, __func__); /* Convert points to array and triangulate - * Here a cache is not used because while drawing the information changes all the time, so the cache - * would be recalculated constantly, so it is better to do direct calculation for each function call + * Here a cache is not used because while drawing the information changes all the time, so the + * cache would be recalculated constantly, so it is better to do direct calculation for each + * function call */ for (int i = 0; i < totpoints; i++) { const tGPspoint *pt = &points[i]; diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 1f50b76ac82..4b6c913785d 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1072,7 +1072,8 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, DRW_gpencil_recalc_geometry_caches(ob, gpl, gp_style, src_gps); } - /* if the fill has any value, it's considered a fill and is not drawn if simplify fill is enabled */ + /* if the fill has any value, it's considered a fill and is not drawn if simplify fill is + * enabled */ if ((stl->storage->simplify_fill) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_REMOVE_FILL_LINE)) { if ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || @@ -1367,7 +1368,8 @@ static void gpencil_copy_frame(bGPDframe *gpf, bGPDframe *derived_gpf) } } -/* Triangulate stroke for high quality fill (this is done only if cache is null or stroke was modified) */ +/* Triangulate stroke for high quality fill (this is done only if cache is null or stroke was + * modified) */ void DRW_gpencil_triangulate_stroke_fill(Object *ob, bGPDstroke *gps) { BLI_assert(gps->totpoints >= 3); diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 6fa07245396..ea578187765 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -328,7 +328,8 @@ void GPENCIL_cache_init(void *vedata) stl->g_data->shgrps_edit_point = NULL; if (!stl->shgroups) { - /* Alloc maximum size because count strokes is very slow and can be very complex due onion skinning. + /* Alloc maximum size because count strokes is very slow and can be very complex due onion + * skinning. */ stl->shgroups = MEM_mallocN(sizeof(GPENCIL_shgroup) * GPENCIL_MAX_SHGROUPS, "GPENCIL_shgroup"); } diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c index b133d9310b0..355235618f6 100644 --- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c +++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c @@ -119,10 +119,11 @@ static void GPENCIL_dof_nearfar(Object *camera, float coc, float nearfar[2]) float focus_dist = BKE_camera_object_dof_distance(camera); float focal_len = cam->lens; - /* this is factor that converts to the scene scale. focal length and sensor are expressed in mm - * unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though - * because the shader reads coordinates in world space, which is in blender units. - * Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */ + /* This is factor that converts to the scene scale. focal length and sensor are expressed in mm + * unit.scale_length is how many meters per blender unit we have. We want to convert to blender + * units though because the shader reads coordinates in world space, which is in blender units. + * Note however that focus_distance is already in blender units and shall not be scaled here + * (see T48157). */ float scale = (scene->unit.system) ? scene->unit.scale_length : 1.0f; float scale_camera = 0.001f / scale; /* we want radius here for the aperture number */ diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl index 16ec0ee9374..acf60fc2d59 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl @@ -180,7 +180,8 @@ void main() gl_FragDepth = min(-0.05, (gl_FragCoord.z / gl_FragCoord.w)); } else if (xraymode == GP_XRAY_3DSPACE) { - /* if 3D mode, move slightly the fill to avoid z-fighting between stroke and fill on same stroke */ + /* if 3D mode, move slightly the fill to avoid z-fighting between stroke and fill on same + * stroke */ if (drawmode == GP_DRAWMODE_3D) { gl_FragDepth = gl_FragCoord.z * 1.0001; } 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 54440f7b120..0428b0d408c 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 @@ -362,9 +362,9 @@ void main() for (int dX = -1; dX <= 1; ++dX) { for (int dY = -1; dY <= 1; ++dY) { vec2 offset = vec2(float(dX), float(dY)); - /* If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + (dY + R) of the - * pixel array. This will fill the pixel array, with the top left pixel of the window at pixel[0] and the - * bottom right pixel of the window at pixel[N-1]. */ + /* If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) + + * (dY + R) of the pixel array. This will fill the pixel array, with the top left pixel of + * the window at pixel[0] and the bottom right pixel of the window at pixel[N-1]. */ v[(dX + 1) * 3 + (dY + 1)] = toVec(texture(blurTex, uv + offset * pixel_size * rad)); } } 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 26ebe7a4553..a1c269d5a65 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl @@ -64,7 +64,8 @@ float max_v3(vec3 v) float line_unit_box_intersect_dist(vec3 lineorigin, vec3 linedirection) { - /* https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ */ + /* https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/ + */ vec3 firstplane = (vec3(1.0) - lineorigin) / linedirection; vec3 secondplane = (vec3(-1.0) - lineorigin) / linedirection; vec3 furthestplane = min(firstplane, secondplane); diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c index f55b744481e..3dea99a76cf 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_dof.c +++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c @@ -243,9 +243,10 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata, Object *camera) /* TODO(fclem) deduplicate with eevee */ /* this is factor that converts to the scene scale. focal length and sensor are expressed in mm - * unit.scale_length is how many meters per blender unit we have. We want to convert to blender units though - * because the shader reads coordinates in world space, which is in blender units. - * Note however that focus_distance is already in blender units and shall not be scaled here (see T48157). */ + * unit.scale_length is how many meters per blender unit we have. We want to convert to blender + * units though because the shader reads coordinates in world space, which is in blender units. + * Note however that focus_distance is already in blender units and shall not be scaled here + * (see T48157). */ float scale = (scene_eval->unit.system) ? scene_eval->unit.scale_length : 1.0f; float scale_camera = 0.001f / scale; /* we want radius here for the aperture number */ diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c index 6151c1f54dd..c403e358d6a 100644 --- a/source/blender/draw/engines/workbench/workbench_materials.c +++ b/source/blender/draw/engines/workbench/workbench_materials.c @@ -43,7 +43,8 @@ void workbench_material_update_data(WORKBENCH_PrivateData *wpd, Material *mat, WORKBENCH_MaterialData *data) { - /* When V3D_SHADING_TEXTURE_COLOR is active, use V3D_SHADING_MATERIAL_COLOR as fallback when no texture could be determined */ + /* When V3D_SHADING_TEXTURE_COLOR is active, use V3D_SHADING_MATERIAL_COLOR as fallback when no + * texture could be determined */ int color_type = wpd->shading.color_type == V3D_SHADING_TEXTURE_COLOR ? V3D_SHADING_MATERIAL_COLOR : wpd->shading.color_type; |