Age | Commit message (Collapse) | Author |
|
|
|
Currently, the `eval` and `pdf` are not explicitly set to zero when a BSDF sample is invalid (e.g., below the upper hemisphere), when calling
`bsdf_sample` or `bsdf_eval`. It is assumed that `eval` and `pdf` are set to zero before these functions are called, which can cause problems if not.
This patch fixes this potential problem by explicitly setting `eval` and `pdf` to zero when the sampled direction is invalid.
I also added a sanity check if `eval` and `pdf` are valid (i.e., >= 0.f).
The check is activated when build in debug mode and with the `WITH_CYCLES_DEBUG` set to `ON`.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D14776
|
|
When converting from XYZ to RGB it can happen, in some sky models, that the resulting RGB values are negative.
Atm, this is not considered and the returned values for the sky model can be negative.
This patch clamps the returned RGB values to be `= 0.f`
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D14777
|
|
This fixes wrong render passs and bounce limits.
Differential Revision: https://developer.blender.org/D14737
|
|
This reverts commit b82de02e7ce857e20b842a074c0068b146a9fd79. It is causing
crashes in various regression tests.
Ref D14763
|
|
|
|
This is a stripped down version of D14645 without the scene specialisation optimisations.
The two major changes in this patch are:
- Enables more aggressive inlining on Apple Silicon resulting in a 1.1x speedup and 10% reduction in spill, at the cost of longer pipeline build times
- Revival of shader binary archives through a new ShaderCache which is shared between MetalDevice instances using the same physical MTLDevice. This mitigates the extra compile times via explicit caching (rather than, as before, relying on the implicit system shader cache which can be purged without notice)
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D14763
|
|
- Add missing doxy-section for Apply Parent Inverse Operator
- Use identity for None comparison in Python.
- Remove newline from operator doc-strings.
- Use '*' prefix multi-line C comment blocks.
- Separate filenames from doc-strings.
- Remove break after return.
|
|
The current code for computing tangents is not exactly fast.
This has been a long-standing issue, and recently came up again with T97378.
The main bottleneck is fetching the mesh data, since it's handled through a callback system and each vertex might have its data queried dozens of times.
I've tried a lot of things to optimize `mikktspace.c`, but unfortunately most weren't that useful:
- Vectorizing SVec3 gives a ~5% speedup, but I'm not sure if the additional ~70 lines of code are worth it
- Keeping an internal copy of the data instead of re-querying all the time helps a lot (~50-60% time reduction), but requires a lot of extra memory (~100 byte per face)
- Going C++ and replacing the internal quicksort with std::sort shows no difference
- Restructuring the entire file to be a header-only library so that the callbacks can be inlined gives ~10% reduction, but is a major change and deviation from the original library
In the end, two simple fixes that actually help remain:
- Don't re-query the number of faces in each loop iteration
- Don't bother looking for identical vertices if there's only one vertex with that hash
With this, time for the test case in T97378 goes from 6.64sec to 4.92sec. It's something I guess.
I feel like completely refactoring this library would not be a bad idea at some point, but for now it does the job...
Differential Revision: https://developer.blender.org/D14675
|
|
Based on patch by Sebastian Parborg.
|
|
Remove need for shadow caustic caster geometry to have a UV layout. UVs were
useful to maintain a consistent tangent frame across the surface while
performing the walk. A consistent tangent frame is necessary for rough
surfaces where a normal offset encodes the sampled h, which should point
towards the same direction across the mesh.
In order to get a continuous surface parametrization without UVs, the
technique described in this paper was implemented:
"The Natural-Constraint Representation of the Path Space for Efficient
Light Transport Simulation" (Supplementary Material), SIGGRAPH 2014.
In addition to implementing this feature:
* Shadow caustic casters without smooth normals are now ignored (triggered
some refactoring and cleaning).
* Hit point calculation was refactored using existing utils functions,
simplifying the code.
* The max number of solver iterations was reduced to 32, a solution is
usually found by then.
* Added generalized geometry term clamping (transfer matrix calculation can
sometimes get unstable).
* Add stop condition to Newton solver for more consistent CPU and GPU result.
* Add support for multi scatter GGX refraction.
Fixes T96990, T96991
Ref T94120
Differential Revision: https://developer.blender.org/D14623
|
|
|
|
This enables building of HIP binaries for AMD RDNA and RDNA2 GPUs.
This requires the 22.10 / ROCm 5.1 driver.
Ref T91571
Differential Revision: https://developer.blender.org/D14360
|
|
The fix does not fix the case of shaders comming from the OpenSubdiv API.
This reverts commit f5191b87608f6607aa1dbd4b9409174db351984b.
|
|
This reverts commit 390b9f1305059f5d8c7f944d44fc3e5821a3eb82. It seems to
break things on Linux for unknown reasons, so leave it out for now. A solution
to this will be required for Vega cards though.
|
|
|
|
This was caused by the use of a reserved keyword macro that is not
directly used but causes an error on some compiler.
Change the occurences to not match the macros.
|
|
Disable autopep8 for the block that yields passes in list_render_passes,
for better readability.
|
|
|
|
|
|
This adds support for rendering motion blur for volumes, using their
velocity field. This works for fluid simulations and imported VDB
volumes. For the latter, the name of the velocity field can be set per
volume object, with automatic detection of velocity fields that are
split into 3 scalar grids.
A new parameter is also added to scale velocity for more artistic control.
Like for Alembic and USD caches, a parameter to set the unit of time in
which the velocity vectors are expressed is also added. For Blender gas
simulations, the velocity unit should always be in seconds, so this is
only exposed for volume objects which may come from external OpenVDB
files.
These parameters are available under the `Render` panels for the fluid
domain and the volume object data properties respectively.
Credits: kernel advection code from Tangent Animation's Blackbird based
on earlier work by Geraldine Chua
Differential Revision: https://developer.blender.org/D14629
|
|
Noticed while looking into oneAPI patch.
Seems to be unused, without clear indication why/when it might be
needed. Removing the function simplifies adding the new backend.
Differential Revision: https://developer.blender.org/D14652
|
|
|
|
Keep the existing Rec.709 fit and convert to other colorspace if needed, it
seems accurate enough in practice, and keeps the same performance for the
default case.
|
|
From changes in 869a46df2980, ref D14454
|
|
Bonus: Added docs for `--debug-ghost`.
Differential Revision: https://developer.blender.org/D14610
|
|
This can be useful to match transforms to what native Cycles
would see in Blender, as USD typically uses centimeters, but
Blender uses meters. This patch also fixes the hardcoded focal
length multiplicator, which is now using the same units as
everything else. Default of "stageMetersPerUnit" is 0.01 to match
the USD default of centimeters.
Differential Revision: https://developer.blender.org/D14630
|
|
Also ensure space around text in C-comment blocks.
|
|
|
|
Propagate the fp settings from the main thread to all the worker threads (the fp settings includes the FZ settings among other things) - this guarantees consistency in execution of floating point math regardless if its executed in tbb thread arena or on main thread
Add FZ mode to arm64/aarch64 in parallel to the way its been done on intel processors, currently compiling for arm target does not set this mode at all, hence potentially runs slower and with possible results mismatch with intel x86.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D14454
|
|
This is not currently working, reverting until the driver/compiler has a fix.
This reverts commit c46e58817cd72d1481967d32e3c6f47f42933d39.
|
|
* Don't assume the display colorspace name fully defines the transform
to display space, this is not true in OpenColorIO 2 where view transforms
may be defined in more complexs ways than just specifying a colorspace.
* In places where we need to store the display colorspace name, resolve
<USE_DISPLAY_NAME> token manually.
Ref T96590
|
|
Did not affect Blender, but could happen with other integrations.
Differential Revision: https://developer.blender.org/D14538
|
|
As far as I can see, it makes a lot of sense to have the alpha channel here, it matches the 2.x behavior and also matches what Eevee is doing.
Differential Revision: https://developer.blender.org/D14595
|
|
Use the Extend method for these, as these do not work correctly. For UVs
it's better to extend the UVs from the same face, and for tangent space
the normals should be encoded in a matching tangent space.
Later the Adjacent Faces method might be improved to support these cases.
Ref T96977
Differential Revision: https://developer.blender.org/D14572
|
|
Didn't notice this to have real harmful behavior, but is still best
to do things properly.
|
|
Currently, only Lightgroups that exist in the current view layer can be
selected from object or world properties.
The internal UI code already has support for search fields that accept
unknown input, so I just added that to the API and use it for lightgroups.
When a lightgroup is entered that does not exist in the current view layer
(e.g. because it's completely new, because the view layer was switched or
because it was deleted earlier), a new button next to it becomes active and
adds it to the view layer when pressed.
Differential Revision: https://developer.blender.org/D14540
|
|
|
|
* Add missing GLEW and hgiGL libraries for Hydra
* Fix wrong case sensitive include
* Fix link errors by adding external libs to static Hydra lib
* Work around weird Hydra link error with MAX_SAMPLES
* Use Embree by default for Hydra
* Sync external libs code with standalone
* Update version number to match Blender
* Remove unneeded CLEW/GLEW from test executable
None of this should affect Cycles in Blender.
Ref T96731
|
|
|
|
Change uses of "Hair" in Render Settings UI in the property editor
and the "Hair Info" node to use the "Curves" name to reflect the
design described in T95355, where hair is just a use case of a more
general curves data type.
While these settings still affect the particle hair system,
the idea is that if we have to choose one naming scheme to align
with, we should choose the option that aligns with future plans
and current development efforts, especially since the particle
system is considered a legacy feature.
A few notes:
- "Principled Hair BSDF" is not affected since it's meant for hair.
- Python API property identifiers are not affected.
Differential Revision: https://developer.blender.org/D14573
|
|
Differential Revision: https://developer.blender.org/D14471
|
|
This revision allows to specify CUDA host compiler (nvcc's -ccbin command
line option) when configuring the build. It addresses the case where the
C/C++ compiler to be used in CUDA toolchain should be different from the
default C/C++ compiler, for instance in case of compilers versions conflicts
or multiple installed compilers.
The new CMake option is named `CUDA_HOST_COMPILER` and can be used as follows:
`cmake -DCUDA_HOST_COMPILER=<path-to-host-compiler>`
If the option is not specified, the build configuration behaves as previously.
Differential Revision: https://developer.blender.org/D14248
|
|
This commit furthers some of the changes that were started in
rBb9febb54a492 and subsequent commits by changing the way surface
objects are presented to render engines and other users of evaluated
objects in the same way. Instead of presenting evaluated surface objects
as an `OB_SURF` object with an evaluated mesh, `OB_SURF` objects
can now have an evaluated geometry set, which uses the same system
as other object types to deal with multi-type evaluated data.
This clarification makes it more obvious that lots of code that dealt
with the `DispList` type isn't used. It wasn't before either, now it's
just *by design*. Over 1100 lines can be removed. The legacy curve
draw cache code is much simpler now too. The idea behind the further
removal of `DispList` is that it's better to focus optimization efforts
on a single mesh data structure.
One expected functional change is that the evaluated mesh from surface
objects can now be used in geometry nodes with the object info node.
Cycles and the OBJ IO tests had to be tweaked to avoid using evaluated
surface objects instead of the newly exposed mesh objects.
Differential Revision: https://developer.blender.org/D14550
|
|
Stumbled over the `integrate_surface_volume_only_bounce` kernel
function not returning the right type. The others too showed up as
warnings when building Cycles as a standalone which didn't have
those warnings disabled.
Differential Revision: https://developer.blender.org/D14558
|
|
Adds support for linking with some of the dependencies of a USD
build instead of the precompiled libraries from Blender, specifically
OpenSubdiv, OpenVDB and TBB. Other dependencies keep using the
precompiled libraries from Blender, since they are linked statically
anyway so it does't matter as much. Plus they have interdependencies
that are difficult to resolve when only using selected libraries from
the USD build and can't simply assume that USD was built with all
of them.
This patch also makes building the Hydra render delegate via the
standalone repository work and fixes various small issues I ran into
in general on Windows (e.g. the use of both fixed paths and
`find_package` did not seem to work correctly). Building both the
standalone Cycles application and the Hydra render delegate at the
same time is supported now as well (the paths in the USD plugin JSON
file are updated accordingly).
All that needs to be done now to build is to specify a `PXR_ROOT`
or `USD_ROOT` CMake variable pointing to the USD installation,
everything else is taken care of automatically (CMake targets are
loaded from the `pxrTargets.cmake` of USD and linked into the
render delegate and OpenSubdiv, OpenVDB and TBB are replaced
with those from USD when they exist).
Differential Revision: https://developer.blender.org/D14523
|
|
|
|
|
|
Add ccl_gpu_kernel_postfix as a statement macro to prevent the following
declarations from being indented.
|
|
The initial commit only wrote direct and indirect lighting into the lightgroup passes,
but not rays that directly hit the light source itself.
|