Commit Graph

12 Commits

Author SHA1 Message Date
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Campbell Barton 72d2355af5 Cleanup: remove redundant cast, use const casts 2021-06-08 00:23:09 +10:00
Hans Goudey fd414b4906 Cleanup: Use const arguments for volume code
The problem was that you could getting write access to a grid from a
`const Volume *` without breaking const correctness. I encountered this
when working on support for volumes in the bounding box node. For
geometry nodes there is an important distinction between getting data
"for read" and "for write", with the former returning a `const` version
of the data.

Also, for volumes it was necessary to cast away const, since all of
the relevant functions in `volume.cc` didn't have const versions. This
patch adds `const` in these places, distinguising between "for read"
and "for write" versions of functions where necessary.

The downside is that loading and unloading in the global volume cache
needs const write-access to some member variables. I see that as an
inherent problem that comes up with caching that never has a beautiful
solution anyway.

Some of the const-ness could probably be propogated futher in EEVEE
code, but I'll leave that out, since there is another level of caching.

Differential Revision: https://developer.blender.org/D10916
2021-04-08 12:00:26 -05:00
Jacques Lucke 63a9f24b55 Volumes: simplify volumes in modifiers or on load
This changes how the simplify volumes setting works. Before, it only
affeted viewport rendering. This was an issue, because all internal
computations would still have to happen on the high resolution volumes.
With this patch, the simplify setting already affects file loading and
procedural generation of volumes.

Rendering does not have to care about the simplify option anymore,
it just gets the correct simplified version from the depsgraph.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9176
2020-10-20 11:00:16 +02:00
Jacques Lucke 365bf103d1 Volumes: support lower resolution in viewport
The adds a new option to simplify volumes in the viewport.
The setting can be found in the Simplify panel in the render properties.

Volume objects use OpenVDB grids, which are sparse. For rendering,
we have to convert sparse grids to dense grids (for now). Those require
significantly more memory. Therefore, it's often a good idea to reduce
the resolution of volumes in the viewport.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9040

Ref T73201.
2020-10-01 17:59:04 +02:00
Jacques Lucke e12767a035 Volumes: support selection and outlines in viewport
Previously, one could only select a volume object in the outliner
or by clicking on the object origin. This patch allows you to click
on the actual volume.

Furthermore, the generated (invisible) mesh that is used for
selection is also used to draw an outline for the volume object now.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D9022
2020-09-29 12:39:41 +02:00
Clément Foucault 0006f78cb6 Revert "BKE: Fix compiling with clang-tidy and readability-non-const-parameter"
This reverts commit 637a5c964a.

I commited the previous commit because I wasn't building with openvdb.

Compiling with openvdb fix the clang-tidy errror.
2020-09-08 20:18:10 +02:00
Clément Foucault 637a5c964a BKE: Fix compiling with clang-tidy and readability-non-const-parameter 2020-09-08 18:29:00 +02:00
Jacques Lucke 91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
Campbell Barton 35e3abb912 Cleanup: remove old header conventions recently re-introduced 2020-03-20 12:19:09 +11:00
Brecht Van Lommel 7537cad576 Volumes: add render settings for volume datablock
* Space: volume density and step size in object or world space
* Step Size: override automatic step size
* Clipping: values below this are ignored for tighter volume bounds

The last two are Cycles only currently.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel fd53b72871 Objects: Eevee and workbench rendering of new Volume, Hair, PointCloud
Only the volume drawing part is really finished and exposed to the user. Hair
plugs into the existing hair rendering code and is fairly straightforward. The
pointcloud drawing is a hack using overlays rather than Eevee and workbench.

The most tricky part for volume rendering is the case where each volume grid
has a different transform, which requires an additional matrix in the shader
and non-trivial logic in Eevee volume drawing. In the common case were all the
transforms match we don't use the additional per-grid matrix in the shader.

Ref T73201, T68981

Differential Revision: https://developer.blender.org/D6955
2020-03-18 11:23:05 +01:00