Add optional argument `STRIP_LEADING_C_COMMENTS` to CMake macros:
data_to_c_simple & data_to_c.
Strip leading C-style comments that don't bloat binary size.
Comments are replaced with blank lines so line numbers in error messages
match. Reduces Blender's binary size by ~70kb.
Implements the paper [A Microfacet-based Hair Scattering
Model](https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.14588) by
Weizhen Huang, Matthias B. Hullin and Johannes Hanika.
### Features:
- This is a far-field model, as opposed to the previous near-field
Principled Hair BSDF model. The hair is expected to be less noisy, but
lower roughness values takes longer to render due to numerical
integration along the hair width. The hair also appears to be flat when
viewed up-close.
- The longitudinal width of the scattering lobe differs along the
azimuth, providing a higher contrast compared to the evenly spread
scattering in the near-field Principled Hair BSDF model. For a more
detailed comparison, please refer to the original paper.
- Supports elliptical cross-sections, adding more realism as human hairs
are usually elliptical. The orientation of the cross-section is aligned
with the curve normal, which can be adjusted using geometry nodes.
Default is minimal twist. During sampling, light rays that hit outside
the hair width will continue propogating as if the material is
transparent.
- There is non-physical modulation factors for the first three
lobes (Reflection, Transmission, Secondary Reflection).
### Missing:
- A good default for cross-section orientation. There was an
attempt (9039f76928) to default the orientation to align with the curve
normal in the mathematical sense, but the stability (when animated) is
unclear and it would be a hassle to generalise to all curve types. After
the model is in main, we could experiment with the geometry nodes team
to see what works the best as a default.
Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/105600
This transform generates code `if ( gamma != vec3(1., 1., 1.) )`
which is not compatible with Metal.
This patch adds an extra OCIO code processing which converts syntax
to a portable version. It only handles this specific case for the
processing performance reasons.
To reproduce the issue add the following look at the end of the
config.ocio:
```
- !<Look>
name: Grading
process_space: Filmic Log
description: TEST
transform: !<GroupTransform>
children:
- !<GradingPrimaryTransform>
style: log
contrast: {rgb: [0.7, 0.7, 0.7], master: 1}
saturation: 1.15
pivot: {contrast: -0.2}
```
Ref #110685
Pull Request: https://projects.blender.org/blender/blender/pulls/111231
The `Find*.cmake` modules originally used uppercase commands to match
CMake's own conventions. Since then CMake uses lower-case and even
within our own find modules, using all uppercase wasn't done
consistently. Opt for lowercase everywhere.
The recent change to header copyrights [0] unintentionally changed
"Blender Foundation" to "Blender Authors" for the WIN32 file path
which blender is installed into.
Revert lines changed that aren't related to copyright text.
[0]: e955c94ed38595cb12fa6cf517b6ba8033017141
This adds a new Ghost function, GHOST_GetPixelAtCursor, that allows
picking colors from outside of Blender windows. This only has an
implementation for the Windows platform, but this should allow other
platforms to also do so if possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/105324
This PR adds the Lacunarity and Normalize inputs to the Noise node
similar to the Voronoi node.
The Lacunarity input controls the scale factor by which each
successive Perlin noise octave is scaled. Which was previously hard
coded to a factor of 2.
The Noise node normalizes its output to the [0, 1] range by default.
The Normalize option makes it possible for the user to disable that.
To keep the behavior consistent with past versions it is enabled by
default.
To make the aforementioned normalization control easer to implement,
the fractal noise code now accumulates signed noise and remaps the
final sum, as opposed to accumulating positive [0, 1] noise.
Pull Request: https://projects.blender.org/blender/blender/pulls/110839
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.
While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.
Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.
Some directories in `./intern/` have also been excluded:
- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.
An "AUTHORS" file has been added, using the chromium projects authors
file as a template.
Design task: #110784
Ref !110783.
With the introduction of metal and vulkan we use a different
GPU backend selection which broke the dialog box for unsupported
platforms.
Blender asserted and segfaulted before the dialog was being shown
to the user.
This patch solves this by introducing a dummy GPU backend in case no
GPU backend was supported by OpenGL, Metal and Vulkan Backend.
It also adds the showMessageBox to GHOST_SystemCocoa.
Related to #110335
Pull Request: https://projects.blender.org/blender/blender/pulls/110919
In the commonly used cycles headers, it's enough to include
much smaller <iosfwd> than the full <iostream>. While looking at it,
removed inclusion of some other headers from commonly used headers,
that seemed to not be needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/111063
Overall, this commit reworks the component layering in the Principled BSDF
in order to ensure that energy is preserved and conserved.
This includes:
- Implementing support for the OSL `layer()` function
- Implementing albedo estimation for some of the closures for layering purposes
- The specular layer that the Principled BSDF uses has a proper tabulated
albedo lookup, the others are still approximations
- Removing the custom "Principled Diffuse" and replacing it with the classic
lambertian Diffuse, since the layering logic takes care of energy now
- Making the merallic component independent of the IOR
Note that this changes the look of the Principled BSDF noticeably in some
cases, but that's needed, since the cases where it looks different are the
ones that strongly violate energy conservation (mostly grazing reflections
with strong Specular).
Pull Request: https://projects.blender.org/blender/blender/pulls/110864
Instead of storing the backtrace in all memory blocks, and trying to get
meaningful info out of this list of pointers when printing leaked ones,
just use `__asan_describe_address` when ASAN is enabled.
This also work on Windows, in addition to linux and (presumably) OSX,
but does require to build with ASAN enabled.
The previous code was not working very well anymore, for some reason the
call to `backtrace_symbols` seems to fail to give any meaningful
information nowadays on most of Blender code. And it was only
implemented for linux and OSX.
Based on an idea from @LazyDodo, many thanks!
Pull Request: https://projects.blender.org/blender/blender/pulls/111006
The fact that the guarded-allocated memory blocks are all linked to the
static `membase` listbase is enough for LSAN to not detect them as
leaks.
So this commit adds a new (private) callback to clear the memlist, which
is only used in the destructor of the `MemLeakDetector` class.
Many thanks to @Sergey for identifying the root issue here.
Pull Request: https://projects.blender.org/blender/blender/pulls/110995
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).
However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.
This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.
Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).
Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.
Pull Request #110944
Many calls to add_check_c_compiler_flag add_check_cxx_compiler_flag
resulted in over long lines & visual noise. Replace with a function that
takes multiple (cache_var flag) pairs to reduce duplication.
Make it so transform between color spaces which is a no-op does not
peroform any calculations.
This was initially found when working on #110941, but the issue can
be replicated easily by renaming "Linear" to "Linear Rec.709" and
adding alias as "Linear".
Doing so would result in a failure of the compositor_matte_test.
The reason for that is due to the image data-block still referring
to the "Linear" color space, the name-based comparison not detecting
that "Linear" and "Linear Rec.709" are the same spaces, and that the
cryptomatte requires bit-perfect floating point values.
Pull Request: https://projects.blender.org/blender/blender/pulls/110959
Add a High Dynamic Range option in the Color Management > Display panel.
This enables display of extended color ranges above 1.0 for the 3D
viewport, image editor and render previews.
This requires a monitor that can display HDR colors, and a view
transform designed for HDR output. The Standard view transform works,
but Filmic does not as it was designed to bring values into the 0..1
range for SDR displays.
This patch is limited to allowing the display to visualize extended
colors, but does not include future looking work to better integrate HDR
into the full workflow.
It is implemented by rendering to high bit-depth texture formats for
the user interface, and uncapping the color range in color management.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/105662
This add the possibility to define different
viewports inside a single framebuffer and
let the vertex shader decide which viewport
to render to.
This only contain the GL and VK implementation.
The Vulkan implementation works but still
has a validation error related to shader features
and extension. The test passes nonetheless.
Pull Request: https://projects.blender.org/blender/blender/pulls/110923
Both the `Math` node and the `Vector Math` currently only explicitly
support modulo using truncated division which is oftentimes not the
type of modulo desired as it behaves differently for negative numbers
and positive numbers.
Floored Modulo can be created by either using the `Wrap` operation or
a combination of multiple `Math` nodes. However both methods obfuscate
the actual intend of the artist and the math operation that is actually
used.
This patch adds modulo using floored division to the scalar `Math` node,
explicitly stating the intended math operation and renames the already
existing `"Modulo"` operation to `"Truncated Modulo"` to avoid confusion.
Only the ui name is changed, so this should not break compatibility.
Pull Request: https://projects.blender.org/blender/blender/pulls/110728
The current core was only detecting sRGB transform when it is defined
as sRGB->Linear using srgb.spi1d. If it is defined as an inverse of
Linear->sRGB using srgb_inv.spi1d, or as an analytical formula using
ExponentWithLinearTransform then the code did not detect the color
as sRGB on anything by Apple Silicon platform.
The naming of the checks could be improved to make it more clear that
the check is only used to allow lossless access to 8bit sRGB textures.
Ref #110685
Pull Request: https://projects.blender.org/blender/blender/pulls/110889
This pull request covers up a subtle difference between the CPU and GPU
when rendering with a light tree. Specifically a case where the user
has a sun light with a small angle.
The difference was caused by the dot() function being different between
CPU and GPU backends, with the GPU showing more meaningful
floating-point precision losses when working with small suns.
Pull Request: https://projects.blender.org/blender/blender/pulls/110307
The issue was an out-of-bounds read access when checking whether
the world volume emission needs to be accumulated.
Solution is to check for this case. Done in the generic place, so
that the shade_volume kernel is more readable and no branching
added there, and there is no impact on scenes without the light
linking.
Assume that the world emissive volume belongs to the default light
linking group, as there is no way to link it explicitly to anything.
Pull Request: https://projects.blender.org/blender/blender/pulls/110733
This replaces the Sheen model used in the Principled BSDF with the
model from #108869 that is already used in the Sheen BSDF now.
The three notable differences are:
- At full intensity (Sheen = 1.0), the new model is significantly
stronger than the old one. For existing files, the intensity is
adjusted to keep the overall look similar.
- The Sheen Tint input is now a color input, instead of the
previous blend factor between white and the base color.
- There is now a Sheen roughness control, which can be used to
tweak the look between velvet-like and dust-like.
Pull Request: https://projects.blender.org/blender/blender/pulls/109949
MSVC_VER 1937 included 17.7 preview 1 and 2 that didn't support the flag
while developers may be using these versions already because of the
issues with 17.6. We now check for preview 3 specifically.
Starting with MSVC 17.7 preview 3, /jumptablerdata is available and
allows to ensure switch tables don't get mixed with the code, helping on
performance when there is contention in a large switch statement, such
as in svm.h.
Pull Request: https://projects.blender.org/blender/blender/pulls/110470
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.
Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.
the only way forward appears to be back.
this reverts :
19422044edbd8e8d524db3d02768c4a52f5274be
a670b53abe82f7a36d2caa0d8ae2c67c2bc8c39a
0f541db97c47e5fcd1c71160d71642235d9ea743
be516e8c814dbf7bc43ea91c6913be9f7f96e006
3e88a2f44c413fa7f671f638409a975d59f8c1fb
4e64b772f5ed8f352c2744baece802f70e2430e7
9547e7a317d6f86ab8fbfb3d440f127c2ab75df2
07fe6c5a57d7bcf89318204c0319db1f4a2f5cbd
The problematic commit was 07fe6c5a57d7bcf89318204c0319db1f4a2f5cbd
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.
Pull Request: https://projects.blender.org/blender/blender/pulls/110438
<algorithm> header include is missing from some sycl headers, this will
be fixed upstream with https://github.com/intel/llvm/pull/10424,
meanwhile, we work around it by including it directly.
Implements part of #101689.
The "poly" name was chosen to distinguish the `MLoop` + `MPoly`
combination from the `MFace` struct it replaced. Those two structures
persisted together for a long time, but nowadays `MPoly` is gone, and
`MFace` is only used in some legacy code like the particle system.
To avoid unnecessarily using a different term, increase consistency
with the UI and with BMesh, and generally make code a bit easier to
read, this commit replaces the `poly` term with `poly`. Most variables
that use the term are renamed too. `Mesh.totface` and `Mesh.fdata` now
have a `_legacy` suffix to reduce confusion. In a next step, `pdata`
can be renamed to `face_data` as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/109819
This is only used as temporary state while evaluating SVM nodes,
there's no point in storing it in the ShaderData for later.
Since ShaderData size is relevant for GPU performance, we should
save the space and only keep it where needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/110366
There's no reason why this would need to be its own closure, it was
just a slightly different microfacet distribution with a hardcoded
IOR and intensity multiplier internally.
No functional change, just cleaning up the mess of custom OSL closures.
Pull Request: https://projects.blender.org/blender/blender/pulls/109951
This was already unsupported in combination with Multiscattering GGX,
prevented the Principled BSDF from using microfaced-based Fresnel for
Glass materials, and would have made future improvements even trickier.
Pull Request: https://projects.blender.org/blender/blender/pulls/109950
Previously Glass Fresnel used to get baked into the closure weight,
so the MNEE code could just ignore it.
However, now that it's part of the closure implementation, we need
to account for it in the MNEE throughput calculation as well.
The maximum OpenGL versions supported on mac
doesn't meet the minimum required version (>=4.3) anymore.
This removes all the OpenGL paths in GHOST
Cocoa backend and from the drop down menu in
the user preferences.
Pull Request: https://projects.blender.org/blender/blender/pulls/110185
Previously the normal strength linearly interpolated and extrapolated
the normal in world space. Instead do it in tangent space, in a way
that ensure the normal remains above the surface and valid.
Pull Request: https://projects.blender.org/blender/blender/pulls/109763
This removes the GL 3.3 fallback because default viewport engine
now require some features only present in GL 4.3.
Blender now also check for GL version 4.6 instead of 4.5 in some
cases.
Note that this does not remove the OpenGL support on Apple
hardware.
Pull Request: https://projects.blender.org/blender/blender/pulls/109390
Changes to the kernel source would not update the HIP RT binaries, leading
to render errors due to the kernel being mismatched with Blender.
The code this was copied from was inside a macro that defines the sources
variable, but it's not defined here.
Ref #109418
Pull Request: https://projects.blender.org/blender/blender/pulls/110073
Allows Win32 key repeat filtering to support multiple simultaneously
repeating keys, as can happen with modifiers. Removes
m_keycode_last_repeat_key and instead checks current down status.
Pull Request: https://projects.blender.org/blender/blender/pulls/109991
The `UCKeyTranslate` function was being used wrong.
The `deadKeyState` param should use `kUCKeyTranslateNoDeadKeysMask`
instead of `kUCKeyTranslateNoDeadKeysBit` (optionally could also use
`(1 << kUCKeyTranslateNoDeadKeysBit`)).
This commit also dispenses with accessing the keyAction, as this is not
crucial for determining the key.
Comments have also been added to better describe the code.
Pull Request: https://projects.blender.org/blender/blender/pulls/109987
Use modifier keys that are pressed before activating a new window.
Allows call of `wm_window_update_eventstate_modifiers` on
`GHOST_kEventWindowActivate` by using `GetAsyncKeyState` instead of
`GetKeyState` in GHOST_SystemWin32::getModifierKeys, which retrieves
actual hardware state.
Pull Request: https://projects.blender.org/blender/blender/pulls/110020
the initialization of m_pkts with an int threw an error with
17.7P3 since it decided int -> uint64_t required a narrowing
conversion. Not sure why it got picky here all of a sudden
but given it's not wrong, we may as well fix it properly.
This change changes the queueSize parameter to size_t and
adds a bounds check at the calling site to ensure the value
it gets will be positive before casting.
this option was already unselectable in the UI, and is treated as GGX
with zero roughness. Upon building the shader graph, we only convert a
closure to `SHARP` when option Filter Glossy is not used and the
roughness is below certain threshold. The benefit is that we can avoid
calling `bsdf_eval()` or return earlier in some cases, but the thresholds
vary across files.
This patch removes `SHARP` closures altogether, and checks if the
roughness value is below a global threshold `BSDF_ROUGHNESS_THRESH`
after blurring, in which case the flag `SD_BSDF_HAS_EVAL` is not set.
The global threshold is set to be `5e-7f` because threshold smaller than
that seems to have caused problem in the past (c6aa0217ac). Also removes
a bunch of functions, variables and arguments that were only there
because we converted closures under certain conditions.
Pull Request: https://projects.blender.org/blender/blender/pulls/109902
The Voronoi distance output is clamped at 8, which is apparent for distance
metrics like Minkowski with low exponents.
This patch fixes that by setting the initial distance of the search loop to
FLT_MAX instead of 8. And for the Smooth variant of F1, the "h" parameter is set
to 1 for the first iteration using a signal value, effectively ignoring the
initial distance and using the computed distance at the first iteration instead.
Pull Request: https://projects.blender.org/blender/blender/pulls/109286
There's quite a few libraries that depend on dna_type_offsets.h
but had gotten to it by just adding the folder that contains it to
their includes INC section without declaring a dependency to
bf_dna in the LIB section.
which occasionally lead to the lib building before bf_dna and the
header being missing, while this generally gets fixed in CMake by
adding bf_dna to the LIB section of the lib, however until last
week all libraries in the LIB section were linked as INTERFACE so
adding it in there did not resolve the build issue.
To make things still build, we sprinkled add_dependencies wherever
we needed it to force a build order.
This diff :
Declares public include folders for the bf_dna target so there's
no more fudging the INC section required to get to them.
Removes all dna related paths from the INC section for all
libraries.
Adds an alias target bf:dna to signify it has been updated to
modern cmake
Declares a dependency on bf::dna for all libraries that require it
Removes (almost) all calls to add_dependencies for bf_dna
Future work:
Because of the manual dependency management that was done, there is
now some "clutter" with libs depending on bf_dna that realistically
don't. Example bf_intern_opencolorio itself has no dependency on
bf_dna at all, doesn't need it, doesn't use it. However the
dna include folder had been added to it in the past since bf_blenlib
uses dna headers in some of its public headers and
bf_intern_opencolorio does use those blenlib headers.
Given bf_blenlib now correctly declares the dependency on bf_dna
as public bf_intern_opencolorio will get the dna header directory
automatically from CMake, hence some cleanup could be done for
bf_intern_opencolorio
Because 99% of the changes in this diff have been automated, this diff
does not seek to address these issues as there is no easy way to
determine why a certain dependency is in place. A developer will have
to make a pass a this at some later point in time. As I'd rather not
mix automated and manual labour.
There are a few libraries that could not be automatically processed
(ie bf_blendthumb) that also will need this manual look-over.
Pull Request: https://projects.blender.org/blender/blender/pulls/109835
Using area-preserving mapping from cone to disk. Has somewhat distortion
near 90°.
The texture rotates with the transformation of the light object, can
have negative and non-uniform scaling.
Pull Request: https://projects.blender.org/blender/blender/pulls/109842
When blender is not focused and a selection is executed
with the mouse, since there is no conversion from `wl_fixed` to `int`,
the bounds of the selection can cause the selection box to be too large,
causing `draw_select_framebuffer_depth_only_setup` to fail when create
`g_select_buffer.texture_depth`.
Ref !109834
So that there is some lighting when there are no lights in the scene,
and black when there are lights. This matches the behavior of other
Hydra renderers.
Ref #96731
* Use pi factor to convert between radiant flux and intensity
* Mark lights as normalized on export
* Add spot light export support
* Add treatAsPoint support for import and export
* Empirically match normalized distant light
* Fix wrong unnormalized point/sphere/disk light unit in Cycles
Overall it should be much closer now for all light types. Point and distant
light units are inconsistent between renderers, so not possible to match
everything there.
Ref #109404
Pull Request: https://projects.blender.org/blender/blender/pulls/109795
This fixes the issue described in https://projects.blender.org/blender/blender/issues/108957.
Instead of modeling distant lights like a disk light at infinity, it models them as cones. This way, the radiance is constant across the entire range of directions that it covers.
For smaller angles, the difference is very subtle, but for very large angles it becomes obvious (here's the file from #108957, the angle is 179°):
| Old | New |
| - | - |
| ![old_bigsun.png](/attachments/4ef8e7a7-1a29-4bdf-a74c-3cfa103bf1e7) | ![new_bigsun.png](/attachments/d53c7749-2672-40b6-9048-ccf2fffceeb7) |
One notable detail is the sampling method: Using `sample_uniform_cone` can increase noise, since the sampling method no longer preserves the stratification of the samples. This is visible in the "light tree multi distant" test scene.
Turns out we can do better, and after a bit of testing I found a way to adapt the concentric Shirley mapping to uniform cone sampling. I hope the comment explains the logic behind it reasonably well.
Here's the result, note that even the noise distribution is the same when using the new sampling:
| Method | Old | New, basic sampling | New, concentric sampling |
| - | - |- | - |
| Image | ![old.png](/attachments/b3258a70-f015-4065-a774-193974cce439) | ![new_basic.png](/attachments/a9008576-0af6-4152-a687-c800fd958bbd) | ![new_concentric.png](/attachments/769b6c43-34bc-434e-a4fd-ce69addd1ba5) |
| Render time (at higher spp)| 9.03sec | 8.79sec | 8.96sec |
I'm not sure if I got the `light->normalized` handling right, since I don't really know what the expectation from Hydra is here.
Co-authored-by: Weizhen Huang <weizhen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/108996
The spotlight is now treated as a sphere instead of a view-aligned disk.
The implementation remains almost identical to that of a point light,
except for the spotlight attenuation and spot blend. There is no
attenuation inside the sphere. Ref #108505
Other changes include:
## Sampling
Instead of sampling the disk area, the new implementation samples either
the cone of the visible portion on the sphere or the spread cone, based
on which cone has a smaller solid angle. This reduces noise when the
spotlight has a large radius and a small spread angle.
| Before | After |
| -- | -- |
|![spot_size_before.png](/attachments/04ea864a-6bf9-40fe-b11b-61c838ae70cf)|![spot_size_after.png](/attachments/7077eaf9-b7a8-41b1-a8b6-aabf1eadb4f4)
## Texture
Spot light can now project texture using UV coordinates.
<video src="/attachments/6db989d2-7a3c-4b41-9340-f5690d48c4fb"
title="spot_light_texture.mp4" controls></video>
## Normalization
Previously, the normalization factor for the spotlight was \(\pi r^2\),
the area of a disk. This factor has been adjusted to \(4\pi r^2\) to
account for the surface area of a sphere. This change also affects point
light since they share the same kernel type.
## Versioning
Some pipeline uses the `Normal` socket of the Texture Coordinate node for
projection, because `ls->Ng` was set to the incoming direction at the
current shading point. Now that `ls->Ng` corresponds to the normal
direction of a point on the sphere (except when the radius is zero),
we replace these nodes with a combination of the Geometry shader node
and the Vector Transform node, which gives the same result as before.
![versioning.png](/attachments/5bbfcacc-26c5-4f7f-8360-c42bcd851f68)
Example file see https://archive.blender.org/developer/T93676
Pull Request: https://projects.blender.org/blender/blender/pulls/109329
This introduces an alias target `bf::intern::atomic` for
`bf_intern_atomic`. This has the following benefits:
- Any target name with `::` in it will be recognized as an actual
target by cmake, rather than a library name it may not know about.
and will be validated by cmake to exist. Which means if you make
a typo in the LIB section, CMake will error out telling you it
doesn't know about this specific target rather than passing it on
to the build system, where you'll either get build or linker errors
because of said typo.
- Given there is quite a cleanup still to do in the build system,
it won't always be obvious which targets have been updated to
modern targets and which still need to be done. Having a namespaced
target name is a good indicator there.
Pull Request: https://projects.blender.org/blender/blender/pulls/109784
GHOST_ContextCGL used an incorrect compiler directive. When reading
the comment we could also remove it. In order to do the right thing
(fixing directive vs removing code) we opened this pull request to
ask feedback.
Pull Request: https://projects.blender.org/blender/blender/pulls/109686