Cleanup: correct spelling, comments

Hyphenate words in GLSL code-comments.
This commit is contained in:
Campbell Barton 2023-08-29 15:09:33 +10:00
parent 02955495cb
commit eec449ffe8
98 changed files with 202 additions and 198 deletions

View File

@ -101,7 +101,7 @@ vec4 curvemapping_evaluate_premulRGBF(vec4 col)
/* Using a triangle distribution which gives a more final uniform noise.
* See Banding in Games:A Noisy Rant(revision 5) Mikkel Gjøl, Playdead (slide 27) */
/* GPUs are rounding before writing to framebuffer so we center the distribution around 0.0. */
/* GPUs are rounding before writing to frame-buffer so we center the distribution around 0.0. */
/* Return triangle noise in [-1..1[ range */
float dither_random_value(vec2 co)
{
@ -165,11 +165,11 @@ vec4 OCIO_ProcessColor(vec4 col, vec4 col_overlay)
/* Convert to display space. */
col = OCIO_to_display(col);
/* Blend with overlay in UI colorspace.
/* Blend with overlay in UI color-space.
*
* UI colorspace here refers to the display linear color space,
* UI color-space here refers to the display linear color space,
* i.e: The linear color space w.r.t. display chromaticity and radiometry.
* We separate the colormanagement process into two steps to be able to
* We separate the color-management process into two steps to be able to
* merge UI using alpha blending in the correct color space. */
if (parameters.use_overlay) {
col.rgb = pow(col.rgb, vec3(parameters.exponent * 2.2));
@ -179,7 +179,7 @@ vec4 OCIO_ProcessColor(vec4 col, vec4 col_overlay)
col = clamp(col, 0.0, 1.0);
}
else {
/* When using extended colorspace, interpolate towards clamped color to improve display of
/* When using extended color-space, interpolate towards clamped color to improve display of
* alpha-blended overlays. */
col = mix(max(col, 0.0), clamp(col, 0.0, 1.0), col_overlay.a);
}

View File

@ -107,7 +107,7 @@ float bxdf_ggx_D(float NH, float a2)
float D_ggx_opti(float NH, float a2)
{
float tmp = (NH * a2 - NH) * NH + 1.0;
return M_PI * tmp * tmp; /* Doing RCP and mul a2 at the end */
return M_PI * tmp * tmp; /* Doing RCP and multiply a2 at the end. */
}
float bxdf_ggx_smith_G1(float NX, float a2)
@ -119,10 +119,10 @@ float G1_Smith_GGX_opti(float NX, float a2)
{
/* Using Brian Karis approach and refactoring by NX/NX
* this way the (2*NL)*(2*NV) in G = G1(V) * G1(L) gets canceled by the brdf denominator 4*NL*NV
* Rcp is done on the whole G later
* RCP is done on the whole G later
* Note that this is not convenient for the transmission formula */
return NX + sqrt(NX * (NX - NX * a2) + a2);
/* return 2 / (1 + sqrt(1 + a2 * (1 - NX*NX) / (NX*NX) ) ); /* Reference function */
// return 2 / (1 + sqrt(1 + a2 * (1 - NX*NX) / (NX*NX) ) ); /* Reference function. */
}
/* Compute the GGX BRDF without the Fresnel term, multiplied by the cosine foreshortening term. */

View File

@ -60,8 +60,8 @@ void main()
/* Balancing the adjustments made in G1_Smith. */
float G1_l = NL * 2.0 / G1_Smith_GGX_opti(NL, a2);
/* btdf = abs(VH*LH) * (ior*ior) * D * G(V) * G(L) / (Ht2 * NV)
* pdf = (VH * abs(LH)) * (ior*ior) * D * G(V) / (Ht2 * NV) */
// btdf = abs(VH*LH) * (ior*ior) * D * G(V) * G(L) / (Ht2 * NV)
// pdf = (VH * abs(LH)) * (ior*ior) * D * G(V) / (Ht2 * NV)
float btdf = G1_l * abs(VH * LH) / (VH * abs(LH));
btdf_accum += btdf;

View File

@ -79,7 +79,7 @@ void closure_Diffuse_indirect_end(ClosureInputDiffuse cl_in,
ClosureEvalCommon cl_common,
inout ClosureOutputDiffuse cl_out)
{
/* If not enough light has been accumulated from probes, use the world specular cubemap
/* If not enough light has been accumulated from probes, use the world specular cube-map
* to fill the remaining energy needed. */
if (cl_common.diffuse_accum > 0.0) {
vec3 probe_radiance = probe_evaluate_world_diff(cl_eval.probe_sampling_dir);

View File

@ -123,7 +123,7 @@ void closure_Glossy_cubemap_eval(ClosureInputGlossy cl_in,
ClosureCubemapData cube,
inout ClosureOutputGlossy cl_out)
{
/* Ensure cubemap probes contribution only gets applied once when running split pass */
/* Ensure cube-map probes contribution only gets applied once when running split pass */
#ifndef RESOLVE_SSR
vec3 probe_radiance = probe_evaluate_cube(
cube.id, cl_common.P, cl_eval.probe_sampling_dir, cl_in.roughness);
@ -138,7 +138,7 @@ void closure_Glossy_indirect_end(ClosureInputGlossy cl_in,
{
/* Ensure specular contribution only gets applied once when running split pass */
#ifndef RESOLVE_SSR
/* If not enough light has been accumulated from probes, use the world specular cubemap
/* If not enough light has been accumulated from probes, use the world specular cube-map
* to fill the remaining energy needed. */
if (specToggle && cl_common.specular_accum > 0.0) {
vec3 probe_radiance = probe_evaluate_world_spec(cl_eval.probe_sampling_dir, cl_in.roughness);

View File

@ -75,7 +75,7 @@
{ \
CLOSURE_EVAL_DECLARE(t0, t1, t2, t3); \
\
/* Starts at 1 because 0 is world cubemap. */ \
/* Starts at 1 because 0 is world cube-map. */ \
for (int i = 1; cl_common.specular_accum > 0.0 && i < prbNumRenderCube && i < MAX_PROBE; \
i++) { \
ClosureCubemapData cube = closure_cubemap_eval_init(i, cl_common); \
@ -216,17 +216,17 @@ struct ClosureEvalCommon {
vec3 P;
/** Normal vector, always facing camera. */
vec3 N;
/** Normal vector, always facing camera. (viewspace) */
/** Normal vector, always facing camera. (view-space) */
vec3 vN;
/** Surface position. (viewspace) */
/** Surface position. (view-space) */
vec3 vP;
/** Geometric normal, always facing camera. */
vec3 Ng;
/** Geometric normal, always facing camera. (viewspace) */
/** Geometric normal, always facing camera. (view-space) */
vec3 vNg;
/** Random numbers. 3 random sequences. zw is a random point on a circle. */
/** Random numbers. 3 random sequences. `zw` is a random point on a circle. */
vec4 rand;
/** Specular probe accumulator. Shared between planar and cubemap probe. */
/** Specular probe accumulator. Shared between planar and cube-map probe. */
float specular_accum;
/** Diffuse probe accumulator. */
float diffuse_accum;
@ -237,7 +237,7 @@ struct ClosureOutput {
vec3 radiance;
};
/* Workaround for screenspace shadows in SSR pass. */
/* Workaround for screen-space shadows in SSR pass. */
float FragDepth;
ClosureEvalCommon closure_Common_eval_init(ClosureInputCommon cl_in)

View File

@ -114,7 +114,7 @@ void closure_Refraction_indirect_end(ClosureInputRefraction cl_in,
ClosureEvalCommon cl_common,
inout ClosureOutputRefraction cl_out)
{
/* If not enough light has been accumulated from probes, use the world specular cubemap
/* If not enough light has been accumulated from probes, use the world specular cube-map
* to fill the remaining energy needed. */
if (specToggle && cl_common.specular_accum > 0.0) {
vec3 probe_radiance = probe_evaluate_world_spec(cl_eval.probe_sampling_dir,

View File

@ -61,7 +61,7 @@ void closure_Translucent_indirect_end(ClosureInputTranslucent cl_in,
ClosureEvalCommon cl_common,
inout ClosureOutputTranslucent cl_out)
{
/* If not enough light has been accumulated from probes, use the world specular cubemap
/* If not enough light has been accumulated from probes, use the world specular cube-map
* to fill the remaining energy needed. */
if (cl_common.diffuse_accum > 0.0) {
vec3 probe_radiance = probe_evaluate_world_diff(cl_in.N);

View File

@ -2,7 +2,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/* Fallback implementation for hardware not supporting cubemap arrays.
/* Fallback implementation for hardware not supporting cube-map arrays.
* `samplerCubeArray` fallback declaration as sampler2DArray in `glsl_shader_defines.glsl`. */
#ifndef GPU_ARB_texture_cube_map_array

View File

@ -133,7 +133,7 @@ float dof_load_gather_coc(sampler2D gather_input_coc_buffer, vec2 uv, float lod)
return coc * 0.5;
}
/* Distribute weights between near/slightfocus/far fields (slide 117). */
/* Distribute weights between near/slight-focus/far fields (slide 117). */
#define layer_threshold 4.0
/* Make sure it overlaps. */
#define layer_offset_fg (0.5 + 1.0)
@ -502,7 +502,8 @@ void dof_gather_accumulate_sample_ring(DofGatherData ring_data,
}
}
/* FIXME(@fclem): Seems to be wrong since it needs `ringcount + 1` as input for slightfocus gather.
/* FIXME(@fclem): Seems to be wrong since it needs `ringcount + 1` as input for slight-focus
* gather.
*/
int dof_gather_total_sample_count(const int ring_count, const int ring_density)
{

View File

@ -298,7 +298,7 @@ void main()
in_Glossy_0.roughness = roughness;
/* Do a full deferred evaluation of the glossy BSDF. The only difference is that we inject the
* SSR resolve before the cubemap iter. BRDF term is already computed during main pass and is
* SSR resolve before the cube-map iter. BRDF term is already computed during main pass and is
* passed as specular color. */
CLOSURE_EVAL_FUNCTION_1(ssr_resolve, Glossy);

View File

@ -53,7 +53,7 @@ float light_translucent_power_with_falloff(LightData ld, vec3 N, vec4 l_vector)
float shadow_cube_radial_depth(vec3 cubevec, float tex_id, int shadow_id)
{
float depth = sample_cube(sssShadowCubes, cubevec, tex_id).r;
/* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadowmaps) */
/* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadow-maps) */
const float depth_bias = 3.1e-5;
depth = saturate(depth - depth_bias);
@ -107,13 +107,13 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f
depths.z = sample_cascade(sssShadowCascades, shpos.xy - ofs.xy, tex_id).r;
depths.w = sample_cascade(sssShadowCascades, shpos.xy - ofs.yx, tex_id).r;
/* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadowmaps) */
/* To reverting the constant bias from shadow rendering. (Tweaked for 16bit shadow-maps) */
float depth_bias = 3.1e-5;
depths = saturate(depths - depth_bias);
d = saturate(d - depth_bias);
/* Size of a texel in world space.
* FIXME This is only correct if l_right is the same right vector used for shadowmap creation.
* FIXME This is only correct if l_right is the same right vector used for shadow-map creation.
* This won't work if the shadow matrix is rotated (soft shadows).
* TODO: precompute. */
float unit_world_in_uv_space = length(mat3(scascade(data_id).shadowmat[int(id)]) * ld.l_right);
@ -133,10 +133,10 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f
vec3 cubevec = transform_point(scube(data_id).shadowmat, P);
dist = length(cubevec);
cubevec /= dist;
/* tex_id == data_id for cube shadowmap */
/* `tex_id == data_id` for cube shadow-map. */
float tex_id = float(data_id);
d = shadow_cube_radial_depth(cubevec, tex_id, shadow_id);
/* NOTE: The offset is irregular in respect to cubeface uvs. But it has
/* NOTE: The offset is irregular in respect to cube-face uvs. But it has
* a much more uniform behavior than biasing based on face derivatives. */
depths.x = shadow_cube_radial_depth(cubevec + T * ofs, tex_id, shadow_id);
depths.y = shadow_cube_radial_depth(cubevec + B * ofs, tex_id, shadow_id);
@ -149,7 +149,7 @@ vec3 light_translucent(LightData ld, vec3 P, vec3 N, vec4 l_vector, vec2 rand, f
float s = min(d, min_v4(depths));
/* To avoid light leak from depth discontinuity and shadowmap aliasing. */
/* To avoid light leak from depth discontinuity and shadow-map aliasing. */
float slope_bias = (abs(dx) + abs(dy)) * 0.5;
s -= slope_bias;

View File

@ -147,7 +147,7 @@ void main()
if (NL > 0.0) {
/* Coarse Approximation of the mapping distortion
* Unit Sphere -> Cubemap Face */
* Unit Sphere -> Cube-map Face. */
const float dist = 4.0 * M_PI / 6.0;
/* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html : Equation 13 */
float lod = clamp(lodFactor - 0.5 * log2(pdf * dist), 0.0, lodMax);

View File

@ -47,7 +47,7 @@ void main()
float NH = max(1e-8, dot(N, H)); /* cosTheta */
/* Coarse Approximation of the mapping distortion
* Unit Sphere -> Cubemap Face */
* Unit Sphere -> Cube-map Face. */
const float dist = 4.0 * M_PI / 6.0;
/* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html : Equation 13 */
float lod = clamp(lodFactor - 0.5 * log2(pdf * dist), 0.0, lodMax);

View File

@ -60,7 +60,7 @@ void main()
/* clamp to [0-1] */
cos.xy = fract(cos.xy);
/* get cubemap vector */
/* Get cube-map vector. */
cos = normalize(octahedral_to_cubemap_proj(cos.xy));
vec3 T, B;

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/* Non-geometry shader equivalent for eevee_legacy_lightprobe_vert + eevee_legacy_lightprobe_geom.
* generates geometry instance per cubeface for multi-layered rendering. */
* generates geometry instance per cube-face for multi-layered rendering. */
void main()
{

View File

@ -167,7 +167,7 @@ float sample_cube_shadow(int shadow_id, vec3 P)
/* TODO: Shadow Cube Array. */
float face = cubeFaceIndexEEVEE(cubevec);
vec2 coord = cubeFaceCoordEEVEE(cubevec, face, shadowCubeTexture);
/* tex_id == data_id for cube shadowmap */
/* `tex_id == data_id` for cube shadow-map. */
float tex_id = float(data_id);
return texture(shadowCubeTexture, vec4(coord, tex_id * 6.0 + face, dist));
}

View File

@ -21,7 +21,7 @@ struct Ray {
vec3 direction;
};
/* Inputs expected to be in viewspace. */
/* Inputs expected to be in view-space. */
void raytrace_clip_ray_to_near_plane(inout Ray ray)
{
float near_dist = get_view_z_from_depth(0.0);
@ -30,7 +30,7 @@ void raytrace_clip_ray_to_near_plane(inout Ray ray)
}
}
/* Screenspace ray ([0..1] "uv" range) where direction is normalize to be as small as one
/* Screen-space ray ([0..1] "uv" range) where direction is normalize to be as small as one
* full-resolution pixel. The ray is also clipped to all frustum sides.
*/
struct ScreenSpaceRay {
@ -180,7 +180,7 @@ bool raytrace(Ray ray,
/* Reject hit if background. */
hit = hit && (depth_sample != 1.0);
#endif
/* Refine hit using intersection between the sampled heightfield and the ray.
/* Refine hit using intersection between the sampled height-field and the ray.
* This simplifies nicely to this single line. */
time = mix(prev_time, time, saturate(prev_delta / (prev_delta - delta)));
@ -236,7 +236,7 @@ bool raytrace_planar(Ray ray, RayTraceParameters params, int planar_ref_id, out
}
/* Reject hit if background. */
hit = hit && (depth_sample != 1.0);
/* Refine hit using intersection between the sampled heightfield and the ray.
/* Refine hit using intersection between the sampled height-field and the ray.
* This simplifies nicely to this single line. */
time = mix(prev_time, time, saturate(prev_delta / (prev_delta - delta)));

View File

@ -119,7 +119,7 @@ vec3 light_volume_light_vector(LightData ld, vec3 P)
vec3 participating_media_extinction(vec3 wpos, sampler3D volume_extinction)
{
/* Waiting for proper volume shadowmaps and out of frustum shadow map. */
/* Waiting for proper volume shadow-maps and out of frustum shadow map. */
vec3 ndc = project_point(ProjectionMatrix, transform_point(ViewMatrix, wpos));
vec3 volume_co = ndc_to_volume(ndc * 0.5 + 0.5);

View File

@ -21,7 +21,7 @@ float bxdf_ggx_D(float NH, float a2)
float bxdf_ggx_D_opti(float NH, float a2)
{
float tmp = (NH * a2 - NH) * NH + 1.0;
/* Doing RCP and mul a2 at the end. */
/* Doing RCP and multiply a2 at the end. */
return M_PI * tmp * tmp;
}
@ -34,7 +34,7 @@ float bxdf_ggx_smith_G1_opti(float NX, float a2)
{
/* Using Brian Karis approach and refactoring by NX/NX
* this way the `(2*NL)*(2*NV)` in `G = G1(V) * G1(L)` gets canceled by the BRDF denominator
* `4*NL*NV` Rcp is done on the whole G later. Note that this is not convenient for the
* `4*NL*NV` RCP is done on the whole G later. Note that this is not convenient for the
* transmission formula. */
return NX + sqrt(NX * (NX - NX * a2) + a2);
}
@ -53,7 +53,7 @@ float bsdf_ggx(vec3 N, vec3 L, vec3 V, float roughness)
float G = bxdf_ggx_smith_G1(NV, a2) * bxdf_ggx_smith_G1(NL, a2);
float D = bxdf_ggx_D(NH, a2);
/* brdf * NL = `((D * G) / (4 * NV * NL)) * NL`. */
/* BRDF * NL = `((D * G) / (4 * NV * NL)) * NL`. */
return (0.25 * D * G) / NV;
}

View File

@ -2,7 +2,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/* Fallback implementation for hardware not supporting cubemap arrays.
/* Fallback implementation for hardware not supporting cube-map arrays.
* `samplerCubeArray` fallback declaration as sampler2DArray in `glsl_shader_defines.glsl`. */
#ifndef GPU_ARB_texture_cube_map_array

View File

@ -265,7 +265,7 @@ void dof_gather_accumulate_sample_ring(DofGatherData ring_data,
}
/* FIXME(fclem) Seems to be wrong since it needs `ringcount + 1` as input for
* slightfocus gather. */
* slight-focus gather. */
/* This should be replaced by web_sample_count_get() but doing so is breaking other things. */
int dof_gather_total_sample_count(const int ring_count, const int ring_density)
{
@ -635,7 +635,7 @@ void dof_slight_focus_gather(depth2D depth_tx,
pair_data[i].color = safe_color(textureLod(color_tx, sample_uv, 0.0));
pair_data[i].dist = ring_dist;
if (DOF_BOKEH_TEXTURE) {
/* Contains subpixel distance to bokeh shape. */
/* Contains sub-pixel distance to bokeh shape. */
ivec2 lut_texel = ivec2(round(sample_offset)) + dof_max_slight_focus_radius;
pair_data[i].dist = texelFetch(bkh_lut_tx, lut_texel, 0).r;
}

View File

@ -45,7 +45,7 @@ const bool no_slight_focus_pass = false;
const bool no_focus_pass = false;
const bool no_hole_fill_pass = false;
/* Distribute weights between near/slightfocus/far fields (slide 117). */
/* Distribute weights between near/slight-focus/far fields (slide 117). */
const float dof_layer_threshold = 4.0;
/* Make sure it overlaps. */
const float dof_layer_offset_fg = 0.5 + 1.0;

View File

@ -53,7 +53,7 @@ vec3 dof_neighborhood_clamp(vec2 frag_coord, vec3 color, float center_coc, float
for (int i = 0; i < 4; i++) {
/**
* Visit the 4 half-res texels around (and containing) the fullres texel.
* Here a diagram of a fullscreen texel (f) in the bottom left corner of a half res texel.
* Here a diagram of a full-screen texel (f) in the bottom left corner of a half res texel.
* We sample the stable half-resolution texture at the 4 location denoted by (h).
* ┌───────┬───────┐
* │ h │ h │

View File

@ -226,7 +226,7 @@ vec2 dof_pixel_history_motion_vector(ivec2 texel_sample)
}
/* Load color using a special filter to avoid losing detail.
* \a texel is sample position with subpixel accuracy. */
* \a texel is sample position with sub-pixel accuracy. */
DofSample dof_sample_history(vec2 input_texel)
{
#if 1 /* Bilinar. */

View File

@ -334,7 +334,7 @@ void film_combined_neighbor_boundbox(ivec2 texel, out vec4 min_c, out vec4 max_c
* Compute Variance of neighborhood as described in:
* "An Excursion in Temporal Supersampling" by Marco Salvi at GDC 2016.
* and:
* "A Survey of Temporal Antialiasing Techniques" by Yang et al.
* "A Survey of Temporal Anti-aliasing Techniques" by Yang et al.
*/
/* First 2 moments. */
@ -352,7 +352,7 @@ void film_combined_neighbor_boundbox(ivec2 texel, out vec4 min_c, out vec4 max_c
const float gamma = 1.25;
/* Standard deviation. */
vec4 sigma = sqrt(abs(mu2 - sqr(mu1)));
/* eq. 6 in "A Survey of Temporal Antialiasing Techniques". */
/* eq. 6 in "A Survey of Temporal Anti-aliasing Techniques". */
min_c = mu1 - gamma * sigma;
max_c = mu1 + gamma * sigma;
#else

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Custom fullscreen triangle with placeholders varyings.
* Custom full-screen triangle with placeholders varyings.
*/
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
@ -12,7 +12,7 @@
void main()
{
/* Fullscreen triangle. */
/* Full-screen triangle. */
int v = gl_VertexID % 3;
float x = float((v & 1) << 2) - 1.0;
float y = float((v & 2) << 1) - 1.0;

View File

@ -21,7 +21,7 @@ struct CullingTile {
vec4 bounds;
};
/* Corners are expected to be in viewspace so that the cone is starting from the origin.
/* Corners are expected to be in view-space so that the cone is starting from the origin.
* Corner order does not matter. */
vec4 tile_bound_cone(vec3 v00, vec3 v01, vec3 v10, vec3 v11)
{
@ -37,7 +37,7 @@ vec4 tile_bound_cone(vec3 v00, vec3 v01, vec3 v10, vec3 v11)
return vec4(center, angle_cosine);
}
/* Corners are expected to be in viewspace. Returns Z-aligned bounding cylinder.
/* Corners are expected to be in view-space. Returns Z-aligned bounding cylinder.
* Corner order does not matter. */
vec4 tile_bound_cylinder(vec3 v00, vec3 v01, vec3 v10, vec3 v11)
{

View File

@ -124,7 +124,7 @@ void main()
if (gl_LocalInvocationID.z % 4 == 0u) {
/* Encode 4 cells into one volume sample. */
ivec4 cell_validity_bits = ivec4(0);
/* Encode validty of each samples in the grid cell. */
/* Encode validity of each samples in the grid cell. */
for (int cell = 0; cell < 4; cell++) {
for (int i = 0; i < 8; i++) {
ivec3 offset = lightprobe_irradiance_grid_cell_corner(i);

View File

@ -22,7 +22,7 @@ MotionRect compute_motion_rect(ivec2 tile, vec2 motion)
#if DEBUG_BYPASS_DILATION
return MotionRect(tile, ivec2(1));
#endif
/* Ceil to number of tile touched. */
/* `ceil()` to number of tile touched. */
ivec2 point1 = tile + ivec2(sign(motion) * ceil(abs(motion) / float(MOTION_BLUR_TILE_SIZE)));
ivec2 point2 = tile;

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Convert from a cubemap vector to an octahedron UV coordinate.
* Convert from a cube-map vector to an octahedron UV coordinate.
*/
vec2 octahedral_uv_from_direction(vec3 co)
{

View File

@ -20,7 +20,7 @@
#define RAY_BIAS_REFRACTION 0.02
#define RAY_BIAS_DIFFUSE 0.02
/* Returns viewspace ray. */
/* Returns view-space ray. */
vec3 ray_generate_direction(vec2 noise, ClosureReflection reflection, vec3 V, out float pdf)
{
vec2 noise_offset = sampling_rng_2D_get(SAMPLING_RAYTRACE_U);
@ -39,7 +39,7 @@ vec3 ray_generate_direction(vec2 noise, ClosureReflection reflection, vec3 V, ou
return sample_ggx_reflect(Xi, roughness_sqr, V, N, T, B, pdf);
}
/* Returns viewspace ray. */
/* Returns view-space ray. */
vec3 ray_generate_direction(vec2 noise, ClosureRefraction refraction, vec3 V, out float pdf)
{
vec2 noise_offset = sampling_rng_2D_get(SAMPLING_RAYTRACE_U);
@ -58,7 +58,7 @@ vec3 ray_generate_direction(vec2 noise, ClosureRefraction refraction, vec3 V, ou
return sample_ggx_refract(Xi, roughness_sqr, refraction.ior, V, N, T, B, pdf);
}
/* Returns viewspace ray. */
/* Returns view-space ray. */
vec3 ray_generate_direction(vec2 noise, ClosureDiffuse diffuse, vec3 V, out float pdf)
{
vec2 noise_offset = sampling_rng_2D_get(SAMPLING_RAYTRACE_U);

View File

@ -26,7 +26,7 @@ void main()
if (all(equal(gl_LocalInvocationID, uvec3(0)))) {
/* Clear num_groups_x to 0 so that we can use it as counter in the compaction phase.
* Note that these writes are subject to race condition, but we write the same value
* from all workgroups. */
* from all work-groups. */
denoise_dispatch_buf.num_groups_x = 0u;
denoise_dispatch_buf.num_groups_y = 1u;
denoise_dispatch_buf.num_groups_z = 1u;

View File

@ -58,7 +58,7 @@ void main()
bool hit = false;
float hit_time = 0.0;
/* Transform the ray into viewspace. */
/* Transform the ray into view-space. */
Ray ray_view;
ray_view.origin = transform_point(drw_view.viewmat, ray.origin);
ray_view.direction = transform_direction(drw_view.viewmat, ray.direction);

View File

@ -14,7 +14,7 @@
#pragma BLENDER_REQUIRE(eevee_ray_types_lib.glsl)
/* Inputs expected to be in viewspace. */
/* Inputs expected to be in view-space. */
void raytrace_clip_ray_to_near_plane(inout Ray ray)
{
float near_dist = get_view_z_from_depth(0.0);
@ -24,7 +24,7 @@ void raytrace_clip_ray_to_near_plane(inout Ray ray)
}
/**
* Raytrace against the given hizbuffer heightfield.
* Raytrace against the given HIZ-buffer height-field.
*
* \param stride_rand: Random number in [0..1] range. Offset along the ray to avoid banding
* artifact when steps are too large.
@ -33,7 +33,7 @@ void raytrace_clip_ray_to_near_plane(inout Ray ray)
* \param discard_backface: If true, raytrace will return false if we hit a surface from behind.
* \param allow_self_intersection: If false, raytrace will return false if the ray is not covering
* at least one pixel.
* \param ray: Viewspace ray. Direction premultiplied by maximum length.
* \param ray: View-space ray. Direction premultiplied by maximum length.
*
* \return True if there is a valid intersection.
*/
@ -117,7 +117,7 @@ bool raytrace_screen(RayTraceData rt_data,
/* Reject hit if background. */
hit = hit && (depth_sample != 1.0);
#endif
/* Refine hit using intersection between the sampled heightfield and the ray.
/* Refine hit using intersection between the sampled height-field and the ray.
* This simplifies nicely to this single line. */
time = mix(prev_time, time, saturate(prev_delta / (prev_delta - delta)));

View File

@ -14,7 +14,7 @@ struct Ray {
float max_time;
};
/* Screenspace ray ([0..1] "uv" range) where direction is normalize to be as small as one
/* Screen-space ray ([0..1] "uv" range) where direction is normalize to be as small as one
* full-resolution pixel. The ray is also clipped to all frustum sides.
* Z component is device normalized Z (aka. depth buffer value).
* W component is device normalized Z + Thickness.

View File

@ -60,7 +60,7 @@ vec4 reflection_probe_eval(ClosureReflection reflection,
if (NL > 0.0) {
/* Coarse Approximation of the mapping distortion
* Unit Sphere -> Cubemap Face */
* Unit Sphere -> Cube-map Face. */
const float dist = 4.0 * M_PI / 6.0;
/* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html : Equation 13 */

View File

@ -2,7 +2,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/* Shader to convert cubemap to octahedral projection. */
/* Shader to convert cube-map to octahedral projection. */
#pragma BLENDER_REQUIRE(eevee_octahedron_lib.glsl)

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Debug drawing for virtual shadowmaps.
* Debug drawing for virtual shadow-maps.
* See eShadowDebug for more information.
*/
@ -16,7 +16,7 @@
#pragma BLENDER_REQUIRE(eevee_sampling_lib.glsl)
#pragma BLENDER_REQUIRE(eevee_shadow_tilemap_lib.glsl)
/** Control the scaling of the tilemap splat. */
/** Control the scaling of the tile-map splat. */
const float pixel_scale = 4.0;
vec3 debug_random_color(ivec2 v)
@ -102,11 +102,11 @@ bool debug_tilemaps(vec3 P, LightData light)
int tilemap = px.x / SHADOW_TILEMAP_RES;
int tilemap_index = light.tilemap_index + tilemap;
if ((px.y < SHADOW_TILEMAP_RES) && (tilemap_index <= light_tilemap_max_get(light))) {
/* Debug actual values in the tilemap buffer. */
/* Debug actual values in the tile-map buffer. */
ShadowTileMapData tilemap = tilemaps_buf[tilemap_index];
int tile_index = shadow_tile_offset(px % SHADOW_TILEMAP_RES, tilemap.tiles_index, 0);
ShadowTileData tile = shadow_tile_unpack(tiles_buf[tile_index]);
/* Leave 1 px border between tilemaps. */
/* Leave 1 px border between tile-maps. */
if (!any(equal(ivec2(gl_FragCoord.xy) % (SHADOW_TILEMAP_RES * debug_tile_size_px), ivec2(0))))
{
gl_FragDepth = 0.0;

View File

@ -4,7 +4,7 @@
#pragma BLENDER_REQUIRE(eevee_shadow_tilemap_lib.glsl)
/** \a unormalized_uv is the uv coordinates for the whole tilemap [0..SHADOW_TILEMAP_RES]. */
/** \a unormalized_uv is the uv coordinates for the whole tile-map [0..SHADOW_TILEMAP_RES]. */
vec2 shadow_page_uv_transform(
vec2 atlas_size, uvec3 page, uint lod, vec2 unormalized_uv, ivec2 tile_lod0_coord)
{
@ -80,7 +80,7 @@ mat4x4 shadow_load_normal_matrix(LightData light)
}
}
/* Returns minimum bias (in world space unit) needed for a given geometry normal and a shadowmap
/* Returns minimum bias (in world space unit) needed for a given geometry normal and a shadow-map
* page to avoid self shadowing artifacts. Note that this can return a negative bias to better
* match the surface. */
float shadow_slope_bias_get(vec2 atlas_size, LightData light, vec3 lNg, vec3 lP, vec2 uv, uint lod)
@ -106,9 +106,9 @@ float shadow_slope_bias_get(vec2 atlas_size, LightData light, vec3 lNg, vec3 lP,
struct ShadowSample {
/* Signed delta in world units from the shading point to the occluder. Negative if occluded. */
float occluder_delta;
/* Tile coordinate inside the tilemap [0..SHADOW_TILEMAP_RES). */
/* Tile coordinate inside the tile-map [0..SHADOW_TILEMAP_RES). */
ivec2 tile_coord;
/* UV coordinate inside the tilemap [0..SHADOW_TILEMAP_RES). */
/* UV coordinate inside the tile-map [0..SHADOW_TILEMAP_RES). */
vec2 uv;
/* Minimum slope bias to apply during comparison. */
float bias;

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Allocation.
* Virtual shadow-mapping: Allocation.
*
* Allocates pages to tiles needing them.
* Note that allocation can fail, in this case the tile is left with no page.

View File

@ -3,9 +3,9 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Page Clear.
* Virtual shadow-mapping: Page Clear.
*
* Equivalent to a framebuffer depth clear but only for pages pushed to the clear_page_buf.
* Equivalent to a frame-buffer depth clear but only for pages pushed to the clear_page_buf.
*/
#pragma BLENDER_REQUIRE(common_math_lib.glsl)

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Defrag.
* Virtual shadow-mapping: Defrag.
*
* Defragment the cached page buffer making one continuous array.
*
@ -11,11 +11,11 @@
* Here is an example of the behavior of this buffer during one update cycle:
*
* Initial state: 5 cached pages. Buffer starts at index 2 and ends at 6.
* [--xxxxx---------]
* `[--xxxxx---------]`
* After page free step: 2 cached pages were removed (r), 3 pages were inserted in the cache (i).
* [--xrxrxiii------]
* `[--xrxrxiii------]`
* After page defrag step: The buffer is compressed into only 6 pages.
* [----xxxxxx------]
* `[----xxxxxx------]`
*/
#pragma BLENDER_REQUIRE(eevee_shadow_page_ops_lib.glsl)

View File

@ -3,9 +3,9 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Tile page freeing.
* Virtual shadow-mapping: Tile page freeing.
*
* Releases the allocated pages held by tilemaps that have been become unused.
* Releases the allocated pages held by tile-maps that have been become unused.
* Also reclaim cached pages if the tiles needs them.
* Note that we also count the number of new page allocations needed.
*/

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Usage un-tagging
* Virtual shadow-mapping: Usage un-tagging
*
* Remove used tag from masked tiles (LOD overlap).
*/
@ -22,7 +22,7 @@ void main()
* the level underneath. If this adds up to 4 the underneath tile is flag unused as its data
* is not needed for rendering.
*
* This is because 2 receivers can tag used the same area of the shadowmap but with different
* This is because 2 receivers can tag used the same area of the shadow-map but with different
* LODs. */
bool is_used = false;
ivec2 tile_co = ivec2(gl_GlobalInvocationID.xy);

View File

@ -106,7 +106,7 @@ void shadow_page_cache_update_page_ref(uint page_index, uint new_page_index)
tiles_buf[tile_index] = shadow_tile_pack(tile);
}
/* Update cached page reference when a tile referencing a cached page moves inside the tilemap. */
/* Update cached page reference when a tile referencing a cached page moves inside the tile-map. */
void shadow_page_cache_update_tile_ref(uint page_index, uint new_tile_index)
{
pages_cached_buf[page_index].y = new_tile_index;

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Update tagging
* Virtual shadow-mapping: Update tagging
*
* Any updated shadow caster needs to tag the shadow map tiles it was in and is now into.
* This is done in 2 pass of this same shader. One for past object bounds and one for new object
@ -70,7 +70,7 @@ void main()
AABB aabb_tag;
AABB aabb_map = shape_aabb(vec3(-0.99999), vec3(0.99999));
/* Directionnal winmat have no correct near/far in the Z dimension at this point.
/* Directional `winmat` have no correct near/far in the Z dimension at this point.
* Do not clip in this dimension. */
if (tilemap.projection_type != SHADOW_PROJECTION_CUBEFACE) {
aabb_map.min.z = -FLT_MAX;

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Usage tagging
* Virtual shadow-mapping: Usage tagging
*
* Shadow pages are only allocated if they are visible.
* This pass scan the depth buffer and tag all tiles that are needed for light shadowing as

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Usage tagging
* Virtual shadow-mapping: Usage tagging
*
* Shadow pages are only allocated if they are visible.
* This ray-marches the current fragment along the bounds depth and tags all the intersected shadow

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Usage tagging
* Virtual shadow-mapping: Usage tagging
*
* Shadow pages are only allocated if they are visible.
* This contains the common logic used for tagging shadows for opaque and transparent receivers.
@ -167,7 +167,7 @@ void shadow_tag_usage_tilemap_punctual(uint l_idx, vec3 P, float dist_to_cam, fl
/**
* \a radius Radius of the tagging area in world space.
* Used for downsampled/ray-marched tagging, so all the shadowmap texels covered get correctly
* Used for downsampled/ray-marched tagging, so all the shadow-map texels covered get correctly
* tagged.
*/
void shadow_tag_usage(vec3 vP, vec3 P, vec3 V, float radius, float dist_to_cam, vec2 pixel)

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Usage tagging
* Virtual shadow-mapping: Usage tagging
*
* Shadow pages are only allocated if they are visible.
* This pass iterates the surfels buffer and tag all tiles that are needed for light shadowing as

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Usage tagging
* Virtual shadow-mapping: Usage tagging
*
* Shadow pages are only allocated if they are visible.
* This renders the bounding boxes for transparent objects in order to tag the correct shadows.

View File

@ -112,7 +112,7 @@ void main()
EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES - 1));
EXPECT_NEAR(coords.uv, vec2(SHADOW_TILEMAP_RES), 1e-3);
/* Test clipmap level selection. */
/* Test clip-map level selection. */
camera_lP = vec3(2.0, 2.0, 0.0);
/* Follows ShadowDirectional::end_sync(). */
@ -143,7 +143,7 @@ void main()
EXPECT_EQ(coords.tile_coord, ivec2(0));
EXPECT_NEAR(coords.uv, vec2(0), 1e-3);
/* Test clipmap offset. */
/* Test clip-map offset. */
light.clipmap_base_offset = ivec2(31, 1);
lP = vec3(2.0001, 0.0001, 0.0);
@ -160,7 +160,7 @@ void main()
coords = shadow_directional_coordinates(light, lP);
EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES / 2) + ivec2(1, 0));
/* Test clipmap negative offsets. */
/* Test clip-map negative offsets. */
light.clipmap_base_offset = ivec2(-31, -1);
lP = vec3(-2.0001, -0.0001, 0.0);
@ -185,7 +185,7 @@ void main()
LightData light;
light.type = LIGHT_SUN_ORTHO;
light.clipmap_lod_min = 0; /* Range [-0.5..0.5]. */
light.clipmap_lod_max = 2; /* 3 tilemaps. */
light.clipmap_lod_max = 2; /* 3 tile-maps. */
light.tilemap_index = 1;
light._position = vec3(0.0);
light._clipmap_lod_bias = light.clipmap_lod_min - 1;
@ -236,7 +236,7 @@ void main()
// EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES - 1));
// EXPECT_NEAR(coords.uv, vec2(SHADOW_TILEMAP_RES), 1e-3);
/* Test clipmap level selection. */
/* Test clip-map level selection. */
// camera_lP = vec3(2.0, 2.0, 0.0);
/* Follows ShadowDirectional::end_sync(). */
@ -267,7 +267,7 @@ void main()
// EXPECT_EQ(coords.tile_coord, ivec2(0));
// EXPECT_NEAR(coords.uv, vec2(0), 1e-3);
/* Test clipmap offset. */
/* Test clip-map offset. */
// light.clipmap_base_offset = ivec2(31, 1);
// lP = vec3(2.0001, 0.0001, 0.0);
@ -284,7 +284,7 @@ void main()
// coords = shadow_directional_coordinates(light, lP);
// EXPECT_EQ(coords.tile_coord, ivec2(SHADOW_TILEMAP_RES / 2) + ivec2(1, 0));
/* Test clipmap negative offsets. */
/* Test clip-map negative offsets. */
// light.clipmap_base_offset = ivec2(-31, -1);
// lP = vec3(-2.0001, -0.0001, 0.0);

View File

@ -3,10 +3,10 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Bounds computation for directional shadows.
* Virtual shadow-mapping: Bounds computation for directional shadows.
*
* Iterate through all shadow casters and extract min/max per directional shadow.
* This needs to happen first in the pipeline to allow tagging all relevant tilemap as dirty if
* This needs to happen first in the pipeline to allow tagging all relevant tile-map as dirty if
* their range changes.
*/
@ -65,7 +65,7 @@ void main()
atomicMin(light_buf[l_idx].clip_near, global_min);
atomicMax(light_buf[l_idx].clip_far, global_max);
/* TODO(fclem): This feel unnecessary but we currently have no indexing from
* tilemap to lights. This is because the lights are selected by culling phase. */
* tile-map to lights. This is because the lights are selected by culling phase. */
for (int i = light.tilemap_index; i <= light_tilemap_max_get(light); i++) {
int index = tilemaps_buf[i].clip_data_index;
atomicMin(tilemaps_clip_buf[index].clip_near, global_min);

View File

@ -3,9 +3,9 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Tilemap to texture conversion.
* Virtual shadow-mapping: Tile-map to texture conversion.
*
* For all visible light tilemaps, copy page coordinate to a texture.
* For all visible light tile-maps, copy page coordinate to a texture.
* This avoids one level of indirection when evaluating shadows and allows
* to use a sampler instead of a SSBO bind.
*/
@ -151,7 +151,7 @@ void main()
/* Tile coordinate relative to chosen viewport origin. */
ivec2 viewport_tile_co = tile_co_lod - rect_min;
/* We need to add page indirection to the render map for the whole viewport even if this one
* might extend outside of the shadowmap range. To this end, we need to wrap the threads to
* might extend outside of the shadow-map range. To this end, we need to wrap the threads to
* always cover the whole mip. This is because the viewport cannot be bigger than the mip
* level itself. */
int lod_res = SHADOW_TILEMAP_RES >> lod;

View File

@ -3,11 +3,11 @@
* SPDX-License-Identifier: GPL-2.0-or-later */
/**
* Virtual shadowmapping: Setup phase for tilemaps.
* Virtual shadow-mapping: Setup phase for tile-maps.
*
* Clear the usage flag.
* Also tag for update shifted tiles for directional shadow clipmaps.
* Dispatched with one local thread per LOD0 tile and one workgroup per tilemap.
* Also tag for update shifted tiles for directional shadow clip-maps.
* Dispatched with one local thread per LOD0 tile and one work-group per tile-map.
*/
#pragma BLENDER_REQUIRE(gpu_shader_utildefines_lib.glsl)
@ -43,7 +43,7 @@ void main()
int clip_index = tilemap.clip_data_index;
if (clip_index == -1) {
/* Noop. This is the case for unused tilemaps that are getting pushed to the free heap. */
/* Noop. This is the case for unused tile-maps that are getting pushed to the free heap. */
}
else if (tilemap.projection_type != SHADOW_PROJECTION_CUBEFACE) {
ShadowTileMapClip clip_data = tilemaps_clip_buf[clip_index];
@ -60,7 +60,7 @@ void main()
tilemaps_clip_buf[clip_index].clip_far = floatBitsToOrderedInt(-FLT_MAX);
}
else {
/* For cubefaces, simply use the light near and far distances. */
/* For cube-faces, simply use the light near and far distances. */
tilemaps_clip_buf[clip_index].clip_near_stored = tilemap.clip_near;
tilemaps_clip_buf[clip_index].clip_far_stored = tilemap.clip_far;
}
@ -74,7 +74,7 @@ void main()
ivec2 tile_wrapped = ivec2((ivec2(SHADOW_TILEMAP_RES) + tile_shifted) % SHADOW_TILEMAP_RES);
/* If this tile was shifted in and contains old information, update it.
* Note that cubemap always shift all tiles on update. */
* Note that cube-map always shift all tiles on update. */
bool do_update = !in_range_inclusive(tile_shifted, ivec2(0), ivec2(SHADOW_TILEMAP_RES - 1));
/* TODO(fclem): Might be better to resize the depth stored instead of a full render update. */

View File

@ -6,7 +6,7 @@
#pragma BLENDER_REQUIRE(common_shape_lib.glsl)
/* ---------------------------------------------------------------------- */
/** \name Tilemap data
/** \name Tile-map data
* \{ */
int shadow_tile_index(ivec2 tile)
@ -19,7 +19,7 @@ ivec2 shadow_tile_coord(int tile_index)
return ivec2(tile_index % SHADOW_TILEMAP_RES, tile_index / SHADOW_TILEMAP_RES);
}
/* Return bottom left pixel position of the tilemap inside the tilemap atlas. */
/* Return bottom left pixel position of the tile-map inside the tile-map atlas. */
ivec2 shadow_tilemap_start(int tilemap_index)
{
return SHADOW_TILEMAP_RES *
@ -93,8 +93,8 @@ int shadow_tile_offset(ivec2 tile, int tiles_index, int lod)
/** \note: Will clamp if out of bounds. */
ShadowTileData shadow_tile_load(usampler2D tilemaps_tx, ivec2 tile_co, int tilemap_index)
{
/* NOTE(@fclem): This clamp can hide some small imprecision at clipmap transition.
* Can be disabled to check if the clipmap is well centered. */
/* NOTE(@fclem): This clamp can hide some small imprecision at clip-map transition.
* Can be disabled to check if the clip-map is well centered. */
tile_co = clamp(tile_co, ivec2(0), ivec2(SHADOW_TILEMAP_RES - 1));
uint tile_data =
texelFetch(tilemaps_tx, shadow_tile_coord_in_atlas(tile_co, tilemap_index), 0).x;
@ -105,7 +105,7 @@ ShadowTileData shadow_tile_load(usampler2D tilemaps_tx, ivec2 tile_co, int tilem
* This function should be the inverse of ShadowDirectional::coverage_get().
*
* \a lP shading point position in light space, relative to the to camera position snapped to
* the smallest clipmap level (`shadow_world_to_local(light, P) - light._position`).
* the smallest clip-map level (`shadow_world_to_local(light, P) - light._position`).
*/
int shadow_directional_level(LightData light, vec3 lP)
{
@ -113,13 +113,13 @@ int shadow_directional_level(LightData light, vec3 lP)
if (light.type == LIGHT_SUN) {
/* We need to hide one tile worth of data to hide the moving transition. */
const float narrowing = float(SHADOW_TILEMAP_RES) / (float(SHADOW_TILEMAP_RES) - 1.0001);
/* Since the distance is centered around the camera (and thus by extension the tilemap),
/* Since the distance is centered around the camera (and thus by extension the tile-map),
* we need to multiply by 2 to get the lod level which covers the following range:
* [-coverage_get(lod)/2..coverage_get(lod)/2] */
lod = log2(length(lP) * narrowing * 2.0);
}
else {
/* The narrowing need to be stronger since the tilemap position is not rounded but floored. */
/* The narrowing need to be stronger since the tile-map position is not rounded but floored. */
const float narrowing = float(SHADOW_TILEMAP_RES) / (float(SHADOW_TILEMAP_RES) - 2.5001);
/* Since we want half of the size, bias the level by -1. */
float lod_min_half_size = exp2(float(light.clipmap_lod_min - 1));
@ -130,11 +130,11 @@ int shadow_directional_level(LightData light, vec3 lP)
}
struct ShadowCoordinates {
/* Index of the tilemap to containing the tile. */
/* Index of the tile-map to containing the tile. */
int tilemap_index;
/* LOD of the tile to load relative to the min level. Always positive. */
int lod_relative;
/* Tile coordinate inside the tilemap. */
/* Tile coordinate inside the tile-map. */
ivec2 tile_coord;
/* UV coordinates in [0..SHADOW_TILEMAP_RES) range. */
vec2 uv;
@ -158,7 +158,7 @@ ShadowCoordinates shadow_directional_coordinates_at_level(LightData light, vec3
{
ShadowCoordinates ret;
/* This difference needs to be less than 32 for the later shift to be valid.
* This is ensured by ShadowDirectional::clipmap_level_range(). */
* This is ensured by `ShadowDirectional::clipmap_level_range()`. */
int level_relative = level - light.clipmap_lod_min;
ret.tilemap_index = light.tilemap_index + level_relative;
@ -173,7 +173,7 @@ ShadowCoordinates shadow_directional_coordinates_at_level(LightData light, vec3
ret.uv /= exp2(float(ret.lod_relative));
ret.uv = ret.uv * float(SHADOW_TILEMAP_RES) + float(SHADOW_TILEMAP_RES / 2);
ret.uv -= vec2(clipmap_offset);
/* Clamp to avoid out of tilemap access. */
/* Clamp to avoid out of tile-map access. */
ret.tile_coord = clamp(ivec2(ret.uv), ivec2(0.0), ivec2(SHADOW_TILEMAP_RES - 1));
return ret;
}
@ -218,7 +218,7 @@ ShadowCoordinates shadow_punctual_coordinates(LightData light, vec3 lP, int face
ret.uv = lP.xy / abs(lP.z);
/* UVs in [0..SHADOW_TILEMAP_RES] range. */
ret.uv = ret.uv * float(SHADOW_TILEMAP_RES / 2) + float(SHADOW_TILEMAP_RES / 2);
/* Clamp to avoid out of tilemap access. */
/* Clamp to avoid out of tile-map access. */
ret.tile_coord = clamp(ivec2(ret.uv), ivec2(0), ivec2(SHADOW_TILEMAP_RES - 1));
return ret;
}

View File

@ -131,7 +131,7 @@ void init_interface()
#ifdef GPU_VERTEX_SHADER
void shadow_viewport_layer_set(int view_id, int lod)
{
/* We still render to a layered framebuffer in the case of Metal + Tile Based Renderer.
/* We still render to a layered frame-buffer in the case of Metal + Tile Based Renderer.
* Since it needs correct depth buffering, each view needs to not overlap each others.
* It doesn't matter much for other platform, so we use that as a way to pass the view id. */
gpu_Layer = view_id;

View File

@ -5,7 +5,7 @@
/**
* Virtual Shadow map output.
*
* Meshes are rasterize onto an empty framebuffer. Each generated fragment then checks which
* Meshes are rasterize onto an empty frame-buffer. Each generated fragment then checks which
* virtual page it is supposed to go and load the physical page address.
* If a physical page exists, we then use atomicMin to mimic a less-than depth test and write to
* the destination texel.

View File

@ -112,7 +112,7 @@ vec3 volume_light(LightData ld, vec3 L, float l_dist)
vec3 volume_participating_media_extinction(vec3 wpos, sampler3D volume_extinction)
{
/* Waiting for proper volume shadowmaps and out of frustum shadow map. */
/* Waiting for proper volume shadow-maps and out of frustum shadow map. */
vec3 ndc = project_point(ProjectionMatrix, transform_point(ViewMatrix, wpos));
vec3 volume_co = ndc_to_volume(ndc * 0.5 + 0.5);

View File

@ -34,7 +34,7 @@ void blend_mode_output(
case MODE_HARDLIGHT: {
/* Reminder: Blending func is multiply blend `(dst.rgba * src.rgba)`. */
/**
* We need to separate the overlay equation into 2 term (one mul and one add).
* We need to separate the overlay equation into 2 term (one multiply and one add).
* This is the standard overlay equation (per channel):
* `rtn = (src < 0.5) ? (2.0 * src * dst) : (1.0 - 2.0 * (1.0 - src) * (1.0 - dst));`
* We rewrite the second branch like this:

View File

@ -10,7 +10,7 @@
* we approximate it by using the smooth-step function and a 1.05 factor to the disc radius.
*/
#define M_1_SQRTPI 0.5641895835477563 /* 1/sqrt(pi) */
#define M_1_SQRTPI 0.5641895835477563 /* `1/sqrt(pi)`. */
#define DISC_RADIUS (M_1_SQRTPI * 1.05)
#define LINE_SMOOTH_START (0.5 - DISC_RADIUS)

View File

@ -22,7 +22,7 @@ void main()
bool is_persp = (drw_view.winmat[3][3] == 0.0);
/* This is the local space camera ray (not normalize).
* In perspective mode it's also the viewspace position
* In perspective mode it's also the view-space position
* of the sphere center. */
vec3 cam_ray = (is_persp) ? model_view_matrix[3].xyz : vec3(0.0, 0.0, -1.0);
cam_ray = mat3(sphereMatrix) * cam_ray;

View File

@ -22,7 +22,7 @@ void main()
bool is_persp = (drw_view.winmat[3][3] == 0.0);
/* This is the local space camera ray (not normalize).
* In perspective mode it's also the viewspace position
* In perspective mode it's also the view-space position
* of the sphere center. */
vec3 cam_ray = (is_persp) ? model_view_matrix[3].xyz : vec3(0.0, 0.0, -1.0);
cam_ray = mat3(sphereMatrix) * cam_ray;
@ -51,7 +51,7 @@ void main()
float cos_b = cos(a);
float sin_b = sqrt(clamp(1.0 - cos_b * cos_b, 0.0, 1.0));
#if 1
/* Instead of choosing the biggest circle in screenspace,
/* Instead of choosing the biggest circle in screen-space,
* we choose the nearest with the same angular size. This
* permit us to leverage GL_ARB_conservative_depth in the
* fragment shader. */

View File

@ -10,7 +10,7 @@
* we approximate it by using the smooth-step function and a 1.05 factor to the disc radius.
*/
#define M_1_SQRTPI 0.5641895835477563 /* 1/sqrt(pi) */
#define M_1_SQRTPI 0.5641895835477563 /* `1/sqrt(pi)`. */
#define DISC_RADIUS (M_1_SQRTPI * 1.05)
#define GRID_LINE_SMOOTH_START (0.5 - DISC_RADIUS)

View File

@ -55,7 +55,7 @@ void main()
half_size += (geometry_flat_out.finalColorOuter.a > 0.0) ? max(sizeEdge, 1.0) : 0.0;
if (do_smooth_wire) {
/* Add 1 px for AA */
/* Add 1px for AA */
half_size += 0.5;
}

View File

@ -189,7 +189,7 @@ void main()
half_size += (geometry_flat_out.finalColorOuter.a > 0.0) ? max(sizeEdge, 1.0) : 0.0;
if (do_smooth_wire) {
/* Add 1 px for AA */
/* Add 1px for AA */
half_size += 0.5;
}

View File

@ -98,7 +98,7 @@ void main()
half_size += (lineStyle == OVERLAY_UV_LINE_STYLE_OUTLINE) ?
max(sizeEdge * (doSmoothWire ? 1.0 : 3.0), 1.0) :
0.0;
/* Add 1 px for AA */
/* Add 1px for AA */
if (doSmoothWire) {
half_size += 0.5;
}

View File

@ -20,7 +20,7 @@
* For an alternate approach, see:
* https://developer.nvidia.com/gpugems/gpugems2/part-iii-high-quality-rendering/chapter-22-fast-prefiltered-lines
*/
#define M_1_SQRTPI 0.5641895835477563 /* 1/sqrt(pi) */
#define M_1_SQRTPI 0.5641895835477563 /* `1/sqrt(pi)`. */
#define DISC_RADIUS (M_1_SQRTPI * 1.05)
#define GRID_LINE_SMOOTH_START (0.5 + DISC_RADIUS)
#define GRID_LINE_SMOOTH_END (0.5 - DISC_RADIUS)

View File

@ -93,7 +93,7 @@ bool line_offset(bvec2 edges, vec2 ofs, inout vec2 line_point)
return false;
}
/* Changes Antialiasing pattern and makes line thicker. 0.0 is thin. */
/* Changes Anti-aliasing pattern and makes line thicker. 0.0 is thin. */
#define PROXIMITY_OFS -0.35
/* Use surrounding edges to approximate the outline direction to create smooth lines. */
@ -225,7 +225,7 @@ void main()
has_edge_neg_x = has_edge_neg_y = false;
}
/* WATCH: Keep in sync with outlineId of the prepass. */
/* WATCH: Keep in sync with outlineId of the pre-pass. */
uint color_id = ref_col >> 14u;
if (ref_col == 0u) {
fragColor = vec4(0.0);
@ -247,7 +247,7 @@ void main()
const float epsilon = 3.0 / 8388608.0;
bool occluded = (ref_depth > scene_depth + epsilon);
/* NOTE: We never set alpha to 1.0 to avoid Antialiasing destroying the line. */
/* NOTE: We never set alpha to 1.0 to avoid Anti-aliasing destroying the line. */
fragColor *= (occluded ? alphaOcclu : 1.0) * (254.0 / 255.0);
int edge_case = 0;

View File

@ -47,7 +47,7 @@ void main()
thickness);
vec3 world_pos;
if (hairThicknessRes > 1) {
/* Calculate the thickness, thicktime, worldpos taken into account the outline. */
/* Calculate the thickness, thick-time, worldpos taken into account the outline. */
float outline_width = point_world_to_ndc(center_wpos).w * 1.25 * sizeViewportInv.y *
drw_view.wininv[1][1];
thickness += outline_width;

View File

@ -18,7 +18,7 @@ vec3 rotate(vec3 vec, vec4 quat)
void main()
{
/* Drawsize packed in alpha. */
/* Draw-size packed in alpha. */
float draw_size = ucolor.a;
vec3 world_pos = part_pos;

View File

@ -8,7 +8,7 @@ void main()
float dist_squared = dot(centered, centered);
const float rad_squared = 0.25;
/* Round point with jaggy edges. */
/* Round point with jagged edges. */
if (dist_squared > rad_squared) {
discard;
return;

View File

@ -7,7 +7,7 @@
#define CAVITY_BUFFER_RANGE 4.0
/* From http://aras-p.info/texts/CompactNormalStorage.html
* Using Method #4: Spheremap Transform */
* Using Method #4: Sphere-map Transform */
vec3 workbench_normal_decode(vec4 enc)
{
vec2 fenc = enc.xy * 4.0 - 2.0;
@ -20,7 +20,7 @@ vec3 workbench_normal_decode(vec4 enc)
}
/* From http://aras-p.info/texts/CompactNormalStorage.html
* Using Method #4: Spheremap Transform */
* Using Method #4: Sphere-map Transform */
vec2 workbench_normal_encode(bool front_face, vec3 n)
{
n = normalize(front_face ? n : -n);

View File

@ -9,7 +9,7 @@
void main()
{
/* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */
/* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */
vec3 I = get_view_vector_from_screen_uv(uvcoordsvar.st);
vec3 N = workbench_normal_decode(texture(normalBuffer, uvcoordsvar.st));
vec4 mat_data = texture(materialBuffer, uvcoordsvar.st);

View File

@ -340,7 +340,7 @@ void main()
void main()
{
/* Fullscreen pass */
/* Full-screen pass. */
vec2 pixel_size = 0.5 / vec2(textureSize(halfResColorTex, 0).xy);
vec2 uv = gl_FragCoord.xy * pixel_size;

View File

@ -28,7 +28,7 @@ void main()
out_color += texture(colorTex, uvs) * (1.0 - mixFactor);
}
out_color /= taaAccumulatedWeight;
/* Exit log2 space used for Antialiasing. */
/* Exit log2 space used for Anti-aliasing. */
out_color = exp2(out_color) - 0.5;
/* Avoid float precision issue. */

View File

@ -12,7 +12,7 @@
void main()
{
vec2 uv = uvcoordsvar.st;
/* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */
/* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */
vec3 V = get_view_vector_from_screen_uv(uv);
vec3 N = workbench_normal_decode(texture(normal_tx, uv));
vec4 mat_data = texture(material_tx, uv);

View File

@ -52,7 +52,7 @@ float calculate_transparent_weight(void)
void main()
{
/* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */
/* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */
vec2 uv_viewport = gl_FragCoord.xy * world_data.viewport_size_inv;
vec3 I = get_view_vector_from_screen_uv(uv_viewport);
vec3 N = normalize(normal_interp);
@ -90,7 +90,7 @@ void main()
void main()
{
/* Normal and Incident vector are in viewspace. Lighting is evaluated in viewspace. */
/* Normal and Incident vector are in view-space. Lighting is evaluated in view-space. */
vec2 uv_viewport = gl_FragCoord.xy * world_data.viewport_size_inv;
vec3 I = get_view_vector_from_screen_uv(uv_viewport);
vec3 N = normalize(normal_interp);

View File

@ -274,7 +274,7 @@ NOTE: the other tuning knobs are now in the shader function inputs!
/* (#B1#) */
float FxaaLuma(vec4 rgba)
{
/* NOTE: sqrt because the sampled colors are in a linear colorspace!
/* NOTE: sqrt because the sampled colors are in a linear color-space!
* this approximates a perceptual conversion, which is good enough for the
* algorithm */
return sqrt(dot(rgba.rgb, vec3(0.2126, 0.7152, 0.0722)));

View File

@ -70,7 +70,7 @@ float gpencil_stroke_thickness_modulate(float thickness, vec4 ndc_pos, vec4 view
thickness = max(1.0, thickness * gpThicknessScale + gpThicknessOffset);
if (gpThicknessIsScreenSpace) {
/* Multiply offset by view Z so that offset is constant in screenspace.
/* Multiply offset by view Z so that offset is constant in screen-space.
* (e.i: does not change with the distance to camera) */
thickness *= ndc_pos.w;
}
@ -234,7 +234,7 @@ vec4 gpencil_vertex(vec4 viewport_size,
vec2 ss_adj = gpencil_project_to_screenspace(ndc_adj, viewport_size);
vec2 ss1 = gpencil_project_to_screenspace(ndc1, viewport_size);
vec2 ss2 = gpencil_project_to_screenspace(ndc2, viewport_size);
/* Screenspace Lines tangents. */
/* Screen-space Lines tangents. */
float line_len;
vec2 line = safe_normalize_len(ss2 - ss1, line_len);
vec2 line_adj = safe_normalize((use_curr) ? (ss1 - ss_adj) : (ss_adj - ss2));

View File

@ -70,7 +70,7 @@ float gpencil_stroke_thickness_modulate(float thickness, vec4 ndc_pos, vec4 view
thickness = max(1.0, thickness * gpThicknessScale + gpThicknessOffset);
if (gpThicknessIsScreenSpace) {
/* Multiply offset by view Z so that offset is constant in screenspace.
/* Multiply offset by view Z so that offset is constant in screen-space.
* (e.i: does not change with the distance to camera) */
thickness *= ndc_pos.w;
}
@ -241,7 +241,7 @@ vec4 gpencil_vertex(vec4 viewport_size,
vec2 ss_adj = gpencil_project_to_screenspace(ndc_adj, viewport_size);
vec2 ss1 = gpencil_project_to_screenspace(ndc1, viewport_size);
vec2 ss2 = gpencil_project_to_screenspace(ndc2, viewport_size);
/* Screenspace Lines tangents. */
/* Screen-space Lines tangents. */
float line_len;
vec2 line = safe_normalize_len(ss2 - ss1, line_len);
vec2 line_adj = safe_normalize((use_curr) ? (ss1 - ss_adj) : (ss_adj - ss2));

View File

@ -27,9 +27,9 @@
uniform int hairStrandsRes = 8;
/**
* hairThicknessRes : Subdiv around the hair.
* hairThicknessRes : Subdivide around the hair.
* 1 - Wire Hair: Only one pixel thick, independent of view distance.
* 2 - Polystrip Hair: Correct width, flat if camera is parallel.
* 2 - Poly-strip Hair: Correct width, flat if camera is parallel.
* 3+ - Cylinder Hair: Massive calculation but potentially perfect. Still need proper support.
*/
uniform int hairThicknessRes = 1;

View File

@ -174,7 +174,7 @@ void make_orthonormal_basis(vec3 N, out vec3 T, out vec3 B)
/* ---- Encode / Decode Normal buffer data ---- */
/* From http://aras-p.info/texts/CompactNormalStorage.html
* Using Method #4: Spheremap Transform */
* Using Method #4: Sphere-map Transform */
vec2 normal_encode(vec3 n, vec3 view)
{
float p = sqrt(n.z * 8.0 + 8.0);

View File

@ -78,20 +78,20 @@ struct PatchCoord {
};
/* This structure is a carbon copy of OpenSubDiv's PatchCoord.QuadNode.
* Each child is a bitfield. */
* Each child is a bit-field. */
struct QuadNode {
uvec4 child;
};
bool is_set(uint i)
{
/* QuadNode.Child.isSet is the first bit of the bitfield. */
/* QuadNode.Child.isSet is the first bit of the bit-field. */
return (i & 0x1u) != 0;
}
bool is_leaf(uint i)
{
/* QuadNode.Child.isLeaf is the second bit of the bitfield. */
/* QuadNode.Child.isLeaf is the second bit of the bit-field. */
return (i & 0x2u) != 0;
}

View File

@ -208,7 +208,7 @@ uniform mat4 ModelMatrixInverse;
#endif
/** Transform shortcuts. */
/* Rule of thumb: Try to reuse world positions and normals because converting through viewspace
/* Rule of thumb: Try to reuse world positions and normals because converting through view-space
* will always be decomposed in at least 2 matrix operation. */
/**
@ -260,13 +260,13 @@ vec3 point_world_to_view(vec3 p)
return (ViewMatrix * vec4(p, 1.0)).xyz;
}
/* Viewspace Z is used to adjust for perspective projection.
/* View-space Z is used to adjust for perspective projection.
* Homogenous W is used to convert from NDC to homogenous space.
* Offset is in viewspace, so positive values are closer to the camera. */
* Offset is in view-space, so positive values are closer to the camera. */
float get_homogenous_z_offset(float vs_z, float hs_w, float vs_offset)
{
if (vs_offset == 0.0) {
/* Don't calculate homogenous offset if viewspace offset is zero. */
/* Don't calculate homogenous offset if view-space offset is zero. */
return 0.0;
}
else if (ProjectionMatrix[3][3] == 0.0) {

View File

@ -1357,7 +1357,7 @@ void UI_view2d_dot_grid_draw(const View2D *v2d,
int count_x;
float start_x;
/* Count points that fit in viewport minus space for the scrollbars. */
/* Count points that fit in viewport minus space for the scroll-bars. */
grid_axis_start_and_count(
step, v2d->cur.xmin, v2d->cur.xmax - V2D_SCROLL_WIDTH, &start_x, &count_x);
int count_y;

View File

@ -5,7 +5,7 @@
/** \file
* \ingroup edscene
*
* Define `ED_scene_api_*` functions.
* Define `ED_scene_fps_*` functions.
*/
#include <cmath>

View File

@ -5,8 +5,8 @@
void main()
{
/* The position represents a 0-1 square, we first scale it by the size we want to have it on
* screen next we divide by the fullscreen size, this will bring everything in range [0,1]. Next
* we scale to NDC range [-1,1]. */
* screen next we divide by the full-screen size, this will bring everything in range [0,1].
* Next we scale to NDC range [-1,1]. */
gl_Position = vec4((((pos * size + dst_offset) / fullscreen) * 2.0 - 1.0), 1.0, 1.0);
vec2 uvoff = (src_offset / fullscreen);
uvcoordsvar = vec4(pos + uvoff, 0.0, 0.0);

View File

@ -146,7 +146,7 @@ TestOutputRawData as_raw_data(mat4x4 v) { WRITE_MATRIX(v); }
int g_test_id = 0;
#ifdef GPU_METAL
/* Vector comparison in MSL return a bvec. Collapse it like in GLSL. */
/* Vector comparison in MSL return a `bvec`. Collapse it like in GLSL. */
# define COLLAPSE_BOOL(OP) bool(all(OP))
#else
# define COLLAPSE_BOOL(OP) (OP)

View File

@ -14,7 +14,7 @@ void main()
float normalized_distance = fract(distance_along_line / dashLength);
/* Checking if `normalized_distance <= dashFactor` is already enough for a basic
* dash, however we want to handle a nice antialias. */
* dash, however we want to handle a nice anti-alias. */
float dash_center = dashLength * dashFactor * 0.5;
float normalized_distance_triangle =

View File

@ -115,7 +115,7 @@ void main(void)
gl_Position.xy += exp_axis * node_link_data.aspect * expand_dist;
/* If the link is not muted or is not a reroute arrow the points are squashed to the center of
* the line. Magic numbers are defined in drawnode.c */
* the line. Magic numbers are defined in `drawnode.cc`. */
if ((expand.x == 1.0 && !doMuted) ||
(expand.y != 1.0 && (pos.x < 0.70 || pos.x > 0.71) && !doArrow))
{

View File

@ -143,10 +143,11 @@ vec2 do_tria()
}
else if (triaType == 5.0) {
/* ROUNDBOX_TRIA_HOLD_ACTION_ARROW */
/* We use a single triangle to cut the round rect in half. The edge will not be Antialiased. */
/* We use a single triangle to cut the round rect in half.
* The edge will not be Anti-aliased. */
pos = tria2 ? vec2(0.0) : arrow_pos[min(vidx, 2)]; /* Only keep 1 triangle. */
pos = pos.x * vec2(0.707, 0.707) + pos.y * vec2(-0.707, 0.707); /* Rotate (45deg) */
pos += vec2(-1.7, 2.4); /* Translate (hardcoded, might want to remove) */
pos += vec2(-1.7, 2.4); /* Translate (hard-coded, might want to remove). */
size *= 0.4; /* Scale */
uvInterp = arrow_uvs[vidx];
uvInterp -= vec2(0.05, 0.05); /* Translate */

View File

@ -125,7 +125,7 @@ void tex_box_blend(
* in between we blend between two textures, and in the middle we a blend
* between three textures.
*
* the Nxyz values are the barycentric coordinates in an equilateral
* the `Nxyz` values are the barycentric coordinates in an equilateral
* triangle, which in case of blending, in the middle has a smaller
* equilateral triangle where 3 textures blend. this divides things into
* 7 zones, with an if () test for each zone

View File

@ -47,7 +47,7 @@ void node_tex_musgrave_fBm_1d(vec3 co,
fac = value;
}
/* 1D Musgrave Multifractal
/* 1D Musgrave Multi-fractal
*
* H: highest fractal dimension
* lacunarity: gap between successive frequencies
@ -133,7 +133,7 @@ void node_tex_musgrave_hetero_terrain_1d(vec3 co,
fac = value;
}
/* 1D Hybrid Additive/Multiplicative Multifractal Terrain
/* 1D Hybrid Additive/Multiplicative Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -186,7 +186,7 @@ void node_tex_musgrave_hybrid_multi_fractal_1d(vec3 co,
fac = value;
}
/* 1D Ridged Multifractal Terrain
/* 1D Ridged Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -272,7 +272,7 @@ void node_tex_musgrave_fBm_2d(vec3 co,
fac = value;
}
/* 2D Musgrave Multifractal
/* 2D Musgrave Multi-fractal
*
* H: highest fractal dimension
* lacunarity: gap between successive frequencies
@ -358,7 +358,7 @@ void node_tex_musgrave_hetero_terrain_2d(vec3 co,
fac = value;
}
/* 2D Hybrid Additive/Multiplicative Multifractal Terrain
/* 2D Hybrid Additive/Multiplicative Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -411,7 +411,7 @@ void node_tex_musgrave_hybrid_multi_fractal_2d(vec3 co,
fac = value;
}
/* 2D Ridged Multifractal Terrain
/* 2D Ridged Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -497,7 +497,7 @@ void node_tex_musgrave_fBm_3d(vec3 co,
fac = value;
}
/* 3D Musgrave Multifractal
/* 3D Musgrave Multi-fractal
*
* H: highest fractal dimension
* lacunarity: gap between successive frequencies
@ -583,7 +583,7 @@ void node_tex_musgrave_hetero_terrain_3d(vec3 co,
fac = value;
}
/* 3D Hybrid Additive/Multiplicative Multifractal Terrain
/* 3D Hybrid Additive/Multiplicative Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -636,7 +636,7 @@ void node_tex_musgrave_hybrid_multi_fractal_3d(vec3 co,
fac = value;
}
/* 3D Ridged Multifractal Terrain
/* 3D Ridged Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -722,7 +722,7 @@ void node_tex_musgrave_fBm_4d(vec3 co,
fac = value;
}
/* 4D Musgrave Multifractal
/* 4D Musgrave Multi-fractal
*
* H: highest fractal dimension
* lacunarity: gap between successive frequencies
@ -808,7 +808,7 @@ void node_tex_musgrave_hetero_terrain_4d(vec3 co,
fac = value;
}
/* 4D Hybrid Additive/Multiplicative Multifractal Terrain
/* 4D Hybrid Additive/Multiplicative Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies
@ -861,7 +861,7 @@ void node_tex_musgrave_hybrid_multi_fractal_4d(vec3 co,
fac = value;
}
/* 4D Ridged Multifractal Terrain
/* 4D Ridged Multi-fractal Terrain
*
* H: fractal dimension of the roughest area
* lacunarity: gap between successive frequencies

View File

@ -315,7 +315,7 @@ struct SStruct {
/* Texture-write functions. */
#define imageStore(_tex, _coord, _value) _texture_write_internal(_tex, _coord, _value)
/* Cubemap support always available when using Metal. */
/* Cube-map support always available when using Metal. */
#define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod)
/* Singular return values from texture functions of type DEPTH are often indexed with either .r or
@ -1032,6 +1032,7 @@ inline float2x2 operator-(float2x2 a)
* normalized to a float.
* The implementation should query the attribute type using vertex_fetch_get_attr_type(attr_name):
*
* \code{.cc}
* float fweight = 0.0;
* if(vertex_fetch_get_attr_type(in_weight) == GPU_SHADER_ATTR_TYPE_INT) {
* int iweight = vertex_fetch_attribute(gl_VertexID, in_weight, int);
@ -1039,6 +1040,7 @@ inline float2x2 operator-(float2x2 a)
* } else {
* fweight = = vertex_fetch_attribute(gl_VertexID, in_weight, float);
* }
* \endcode
*
* Note: These uniforms are generated as part of the same data block used for regular uniforms
* and attribute data is written prior to each draw call, depending on the configuration of

View File

@ -2,7 +2,7 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/* Cubemap support and fallback implementation declarations. */
/* Cube-map support and fallback implementation declarations. */
#ifdef GPU_ARB_texture_cube_map_array
# define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod)
#else

View File

@ -5,7 +5,7 @@
#ifdef GPU_VERTEX_SHADER
void main()
{
/* Fullscreen triangle. */
/* Full-screen triangle. */
int v = gl_VertexID % 3;
float x = -1.0 + float((v & 1) << 2);
float y = -1.0 + float((v & 2) << 1);