Commit Graph

4355 Commits

Author SHA1 Message Date
Omar Emara
405ec79a0a Fix #112883: GPU compositor crops viewed image
The GPU compositor crops the viewed images to the render resolution.
While the original size and content of the input to the viewer should be
retained as is.

This patch fixes that by specializing compositors that can use composite
outputs to be able to view images of any arbitrary size. This is still
missing the translation offset of the viewer, but this shall be tackled
separately.
2023-10-12 14:03:12 +03:00
Clément Foucault
4bddbe85f6 EEVEE-Next: Move out of experimental options
See #93220
2023-10-11 20:38:28 +02:00
Hans Goudey
8f27baf388 Merge branch 'blender-v4.0-release' 2023-10-09 23:54:43 +02:00
Hans Goudey
976eaae02f Cleanup: Move BKE_object.hh to C++
Simplifies the fix to #111120, where the object bounds functions
may return a C++ type instead of `BoundBox`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113462
2023-10-09 23:41:53 +02:00
Brecht Van Lommel
03b2523df8 Merge branch 'blender-v4.0-release' into main 2023-10-09 16:14:39 +02:00
Bogdan Nagirniak
7d7e3d0986 Fix Hydra Storm border rendering being wrong in the viewport
Pull Request: https://projects.blender.org/blender/blender/pulls/113376
2023-10-09 16:01:58 +02:00
Omar Emara
8860dc9910 Fix: GPU compositor always returns first view
The experimental GPU compositor always returned the first view in
multi-view rendering. This patch fixes that by also checking for the
view name of the context when searching for the appropriate pass.
2023-10-05 13:51:56 +03:00
Brecht Van Lommel
66056fead0 Fix #112632: crash batch generating previews with Cycles
Don't assume existence of GPU backend in (background) preview rendering.

Also add null pointer checks and rely on assert instead to detect
invalid usage of GPU_render_begin/end, so that potential future mistakes
don't cause crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112971
2023-09-28 16:13:09 +02:00
Bogdan Nagirniak
c0a0de617c Hydra: export Blender shader nodes as MaterialX node graph
This adds initial support for rendering Cycles and EEVEE shaders in Hydra
render engines that support MaterialX. Not all nodes are currently
supported, see the detailed compatibility list in #112864.

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl Pidhirskyi <vpidhirskyi@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/111765
2023-09-26 18:52:41 +02:00
Campbell Barton
d2c271ec84 CMake: use bf_io_ prefix for IO tests
This simplifies running built-in IO tests with:

  ctest -R bf_io_

Also use "bf_io_" prefix for the libraries since it was already used
by some and it's a useful hint the libraries are used for IO.
2023-09-23 20:22:19 +10:00
Campbell Barton
5fbcb4c27e Cleanup: remove spaces from commented arguments
Also use local enums for `MA_BM_*` in versioning code.
2023-09-22 12:21:18 +10:00
Hans Goudey
867f99c2af Cleanup: Move depsgraph headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/110816
2023-09-22 03:18:17 +02:00
Sergey Sharybin
10c5c94eaf Fix #112486: VSE: Rendering transparent frames produces errors/crashes
A mistake in some of the previous refactor which was aimed to make the
byte buffer to be stored as uint8_t. One of the array size calculation
was missing multiplication by 4 channels.

Pull Request: https://projects.blender.org/blender/blender/pulls/112508
2023-09-18 12:22:12 +02:00
Campbell Barton
52c4051d13 Cleanup: use doxy sections 2023-09-08 23:09:51 +10:00
Sergey Sharybin
1f03148fee Cleanup: Remove unused field and update comments in Render
Pull Request: https://projects.blender.org/blender/blender/pulls/111690
2023-08-30 17:43:24 +02:00
Hans Goudey
f5b7813f3c Cleanup: Remove unnecessary mesh C API function 2023-08-24 13:10:41 -04:00
Campbell Barton
24a8d6425a CMake: include missing files in source files 2023-08-24 11:51:25 +10:00
Campbell Barton
a56200c1ed Cleanup: sort cmake file lists 2023-08-24 11:38:41 +10:00
Campbell Barton
5a8cb665e0 Cleanup: various non-functional C++ changes 2023-08-19 23:52:47 +10:00
Campbell Barton
bf35eb9cbc Cleanup: format 2023-08-18 08:38:02 +10:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
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.
2023-08-16 00:20:26 +10:00
Sergey Sharybin
9094a3a9ab Refactor: Make display_init a base render method
Should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111047
2023-08-14 11:18:28 +02:00
Sergey Sharybin
f604235206 Refactor: Make display_clear a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
ace2f6a183 Refactor: Make display_update a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
964b83aa8b Refactor: Make current_scene_update a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
0193c5029b Refactor: Make stats_draw a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
ed058088b3 Refactor: Make progress a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
6df46fd2fc Refactor: Make draw_lock a base render method
Also semantically separate draw_lock and draw_unlock, as it
is more clear than a single method with a boolean argument.

Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
bddc790166 Refactor: Make test_break a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
dd5ef3f91a Refactor: Make prepare_viewlayer a base render method
Should be no functional changes.
2023-08-14 11:18:24 +02:00
Sergey Sharybin
c664618e10 Cleanup: Add _cb suffix to the callbacks stored in Render
Should be no functional changes.

Preparing for introduction of member function which are
available in the base class.
2023-08-14 11:18:24 +02:00
Brecht Van Lommel
1d2b2e23a0 Fix Hydra render delegate handling paths with certain characters wrong
Use appropriate function for converting paths. This adds an ugly
dependency on a function that is private to python/, similar to how it
is done for Freestyle. Solving that will be for a separate change.

Ref #110765
2023-08-11 17:41:06 +02:00
Jacques Lucke
cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Aras Pranckevicius
d973355b3a Cleanup: reduce amount of math-related includes
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
2023-08-10 14:51:40 +03:00
Campbell Barton
a087790938 Cleanup: declare ReadEWAData const in struct and callbacks 2023-08-10 16:02:53 +10:00
Jason Fielder
2367ed2ef2 macOS: Enable support for EDR rendering
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
2023-08-09 14:25:15 +02:00
Campbell Barton
bff7962c80 Cleanup: remove redundant struct/void in C++, function style casts 2023-08-09 13:37:37 +10:00
Campbell Barton
8d0268b09c Cleanup: spelling in comments 2023-08-09 11:20:59 +10:00
Campbell Barton
1a675d0c47 Cleanup: format disabled code 2023-08-09 10:49:53 +10:00
Campbell Barton
faaac97239 Cleanup: format 2023-08-09 10:46:10 +10:00
Colin Marmond
b8eb7d18e9 Nodes: experimental node previews in the shader editor
First implementation of node previews in the shader node editor. Using
the same user interface as compositor node previews, most shader nodes
can now be previewed (except group in/output and material output).

This is currently still an experimental feature, as polishing of the
user experience and performance improvements are planned. These will
be easier to do as incremental changes on this implementation.

See #110353 for details on the work that remains to be done and known
limitations.

Implementation notes:

We take advantage of the `RenderResult` available as `ImBuf` images to
store a `Render` for every viewed nested node tree present in a
`SpaceNode`. The computation is initiated at the moment of drawing nodes
overlays.

One render is started for the current nodetree, having a `ViewLayer`
associated with each previewed node. We separate the previewed nodes in
two categories: the shader ones and the non-shader ones.
- For non-shader nodes, we use AOVs which highly speed up the rendering
  process by rendering every non-shader nodes at the same time. They are
  rendered in the first `ViewLayer`.
- For shader nodes, we render them each in a different `ViewLayer`, by
  rerouting the node to the output of the material in the preview scene.

The preview scene takes the same aspect as the Material preview scene,
and the same preview object is used.

At the moment of drawing the node overlay, we take the `Render` of the
viewed node tree and extract the `ImBuf` of the wanted viewlayer/pass
for each previewed node.

Pull Request: https://projects.blender.org/blender/blender/pulls/110065
2023-08-08 17:36:06 +02:00
Campbell Barton
0f120b6364 Fix hydra API, incorrect Python API handling of invalid arguments
Exceptions must return nullptr, not None.
2023-08-07 22:10:35 +10:00
Campbell Barton
ae4286d12b Cleanup: function style casts for C++, nullptr & other minor changes 2023-08-07 22:02:15 +10:00
Campbell Barton
8b8fe49d34 License headers: add SPDX-FileCopyrightText 2023-08-06 18:59:05 +10:00
Campbell Barton
a81063e4a1 Cleanup: use const mtex for TexCallData & multitex_* functions 2023-08-05 14:26:29 +10:00
Campbell Barton
7f34ad736a Cleanup: spelling in comments 2023-08-05 13:54:25 +10:00
Hans Goudey
c15d391e86 Cleanup: Various cleanups in newly C++ headers
Mostly remove unnecessary struct and typedef keywords.
Move a few more small wm headers to C++ as well.
2023-08-04 17:55:14 -04:00
Hans Goudey
bc8c892c65 Cleanup: Move WM headers to C++
Also move a few more headers that included WM headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/110815
2023-08-04 23:11:22 +02:00
Brecht Van Lommel
83fa353efc Hydra: add option to export through USD file instead of Hydra API
This is currently meant mainly for testing, when "Developer Extras" is
enabled. The goal is to make interactive Hydra export and USD file export
identical. We are not there yet, and having the ability to compare both
in the viewport and automated tests should help us get and stay there.

Ref #110765
2023-08-04 17:01:09 +02:00
Bogdan Nagirniak
04bb5f9995 Render: support USD Hydra render delegates
Hydra is a rendering architecture part of USD, designed to abstract the
host application from the renderer. A renderer implementing a Hydra
render delegate can run in any host application supporting Hydra, which
now includes Blender.

For external renderers this means less code to be written, and improved
performance due to a using a C++ API instead of a Python API.

Add-ons need to subclass bpy.types.HydraRenderEngine. See the example in
the Python API docs for details.

An add-on for Hydra Storm will be included as well. This is USD's
rasterizing renderer, used in other applications like usdview. For users
it can provide a preview of USD file export, and for developers it
serves a reference.

There are still limitations and missing features, especially around
materials. The remaining to do items are tracked in #110765.

This feature was contributed by AMD.

Ref #110765

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl-Pidhirskyi <vpidhirskyi@gmail.com>
Co-authored-by: Brian Savery <brian.savery@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/104712
2023-08-04 17:01:09 +02:00