Commit: 8213d1735dd805467f5b78d871427228e3d488f1 Author: Miguel Pozo Date: Mon Jan 9 17:09:32 2023 +0100 Branches: tmp-workbench-rewrite2 https://developer.blender.org/rB8213d1735dd805467f5b78d871427228e3d488f1
Fix comments style =================================================================== M source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh M source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc M source/blender/draw/engines/workbench/workbench_effect_dof.cc M source/blender/draw/engines/workbench/workbench_private.hh M source/blender/draw/engines/workbench/workbench_shadow.cc =================================================================== diff --git a/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh b/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh index bd813a36c6e..c437605574d 100644 --- a/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh +++ b/source/blender/draw/engines/workbench/shaders/infos/workbench_composite_info.hh @@ -58,7 +58,7 @@ GPU_SHADER_CREATE_INFO(workbench_next_composite) .fragment_source("workbench_next_composite_frag.glsl") .additional_info("draw_fullscreen", "draw_view"); -// Lighting +/* Lighting */ GPU_SHADER_CREATE_INFO(workbench_next_resolve_opaque_studio).define("WORKBENCH_LIGHTING_STUDIO"); @@ -68,7 +68,7 @@ GPU_SHADER_CREATE_INFO(workbench_next_resolve_opaque_matcap) GPU_SHADER_CREATE_INFO(workbench_next_resolve_opaque_flat).define("WORKBENCH_LIGHTING_FLAT"); -// Effects +/* Effects */ GPU_SHADER_CREATE_INFO(workbench_next_resolve_curvature) .define("WORKBENCH_CURVATURE") @@ -78,9 +78,9 @@ GPU_SHADER_CREATE_INFO(workbench_next_resolve_cavity) .define("WORKBENCH_CAVITY") .sampler(8, ImageType::FLOAT_2D, "jitter_tx") /* TODO(Miguel Pozo): GPU_SAMPLER_REPEAT is set in CavityEffect, it doesn't work here ? */ - .uniform_buf(5, "float4", "cavity_samples[512]"); + .uniform_buf(5, "vec4", "cavity_samples[512]"); -// Variations +/* Variations */ #define WORKBENCH_FINAL_VARIATION(name, ...) \ GPU_SHADER_CREATE_INFO(name).additional_info(__VA_ARGS__).do_static_compilation(true); diff --git a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc index 17e1acb15e4..313aad6244e 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc +++ b/source/blender/draw/engines/workbench/workbench_effect_antialiasing.cc @@ -13,7 +13,7 @@ class TaaSamples { samples = blender::Array<float2>(size); BLI_jitter_init((float(*)[2])samples.begin(), size); - /* find closest element to center */ + /* Find closest element to center */ int closest_index = 0; float closest_squared_distance = 1.0f; @@ -29,7 +29,7 @@ class TaaSamples { float2 closest_sample = samples[closest_index]; for (float2 &sample : samples) { - /* move jitter samples so that closest sample is in center */ + /* Move jitter samples so that closest sample is in center */ sample -= closest_sample; /* Avoid samples outside range (wrap around). */ sample = {fmodf(sample.x + 0.5f, 1.0f), fmodf(sample.y + 0.5f, 1.0f)}; @@ -37,7 +37,7 @@ class TaaSamples { sample = (sample * 2.0f) - 1.0f; } - /* swap center sample to the start of the array */ + /* Swap center sample to the start of the array */ if (closest_index != 0) { swap_v2_v2(samples[0], samples[closest_index]); } @@ -96,7 +96,7 @@ static void setup_taa_weights(const float2 offset, float r_weights[9], float &r_ for (int y = -1; y <= 1; y++, i++) { float2 sample_co = float2(x, y) - offset; float r = len_v2(sample_co); - /* fclem: is radial distance ok here? */ + /* fclem: Is radial distance ok here? */ float weight = filter_blackman_harris(r, filter_width); r_weight_sum += weight; r_weights[i] = weight; @@ -215,7 +215,7 @@ void AntiAliasingPass::setup_view(View &view, int2 resolution) /* TODO(Miguel Pozo): New API equivalent? */ const DRWView *default_view = DRW_view_default_get(); float4x4 winmat, viewmat, persmat; - /* construct new matrices from transform delta */ + /* Construct new matrices from transform delta */ DRW_view_winmat_get(default_view, winmat.ptr(), false); DRW_view_viewmat_get(default_view, viewmat.ptr(), false); DRW_view_persmat_get(default_view, persmat.ptr(), false); diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.cc b/source/blender/draw/engines/workbench/workbench_effect_dof.cc index 25b0c6de74e..11d5cd33f4c 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_dof.cc +++ b/source/blender/draw/engines/workbench/workbench_effect_dof.cc @@ -128,7 +128,7 @@ void DofPass::init(const SceneState &scene_state) float focus_dist = BKE_camera_object_dof_distance(scene_state.camera_object); float focal_len = camera->lens; - /* TODO(fclem): de-duplicate with EEVEE. */ + /* TODO(fclem): De-duplicate with EEVEE. */ const float scale_camera = 0.001f; /* We want radius here for the aperture number. */ float aperture = 0.5f * scale_camera * focal_len / fstop; diff --git a/source/blender/draw/engines/workbench/workbench_private.hh b/source/blender/draw/engines/workbench/workbench_private.hh index a0bc247798c..a413dc17ec5 100644 --- a/source/blender/draw/engines/workbench/workbench_private.hh +++ b/source/blender/draw/engines/workbench/workbench_private.hh @@ -119,8 +119,9 @@ class CavityEffect { bool curvature_enabled_; bool cavity_enabled_; - static const int max_samples_ = 512; /* This value must be kept in sync with the one declared at - * workbench_composite_info.hh (cavity_samples) */ + /* This value must be kept in sync with the one declared at + * workbench_composite_info.hh (cavity_samples) */ + static const int max_samples_ = 512; UniformArrayBuffer<float4, max_samples_> samples_buf; void load_samples_buf(int ssao_samples); @@ -295,13 +296,13 @@ class ShadowPass { ObjectRef &ob_ref, SceneState &scene_state, const bool has_transp_mat); - void draw( - Manager &manager, - View &view, - SceneResources &resources, - int2 resolution, - GPUTexture &depth_stencil_tx, - bool force_fail_method /*Needed when there are opaque "In Front" objects in the scene*/); + void draw(Manager &manager, + View &view, + SceneResources &resources, + int2 resolution, + GPUTexture &depth_stencil_tx, + /*Needed when there are opaque "In Front" objects in the scene*/ + bool force_fail_method); }; class OutlinePass { diff --git a/source/blender/draw/engines/workbench/workbench_shadow.cc b/source/blender/draw/engines/workbench/workbench_shadow.cc index aaba9a76877..85f12d9e71e 100644 --- a/source/blender/draw/engines/workbench/workbench_shadow.cc +++ b/source/blender/draw/engines/workbench/workbench_shadow.cc @@ -52,12 +52,12 @@ void ShadowPass::ShadowView::setup(View &view, float3 light_direction, bool forc */ /* Frustum Planes indices */ - const int x_neg = 0; /* left */ - const int x_pos = 5; /* right */ - const int y_neg = 1; /* bottom */ - const int y_pos = 3; /* top */ - const int z_pos = 4; /* near */ - const int z_neg = 2; /* far */ + const int x_neg = 0; /* Left */ + const int x_pos = 5; /* Right */ + const int y_neg = 1; /* Bottom */ + const int y_pos = 3; /* Top */ + const int z_pos = 4; /* Near */ + const int z_neg = 2; /* Far */ int3 corner_faces[8] = {{x_neg, y_neg, z_pos}, {x_neg, y_neg, z_neg}, _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs