Commit Graph

114443 Commits

Author SHA1 Message Date
Clément Foucault 2a7a01b339 GPUShader: Port polyline shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 23:54:41 +02:00
Clément Foucault aa34706aac Fix T97545 DRW: Crash cause by invalid `"` char in glsl source
Some old compiler do not like this character even if inside an `#error`
directive.
2022-05-01 22:42:07 +02:00
Clément Foucault 3f0c09f6dd GPUShaderCreateInfo: Add validation for overlapping vertex attribute
Those are usually not supported but some driver silently fix them and most
just silently fail (rendering error).
2022-05-01 22:28:38 +02:00
Clément Foucault fc872d738e GPUShader: Port 2D widget shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 21:12:59 +02:00
Clément Foucault a330b9b0ea GL: Add attribute-less shader workaround for MacOS to the backend
This workaround and the issue was described in D4490. This makes sure
any shader using `shaderCreateInfo` will benefit from the same workaround.
2022-05-01 20:54:33 +02:00
Clément Foucault 631506d9c3 External Engine: Reuse depth only shader from Basic engine
This removes the usage of `GPU_shader_create_from_info_name()`.
2022-05-01 19:35:37 +02:00
Clément Foucault eba06fee49 Basic Engine: Port depth shader (object selection) to shaderCreateInfo
This should have no functional changes.
2022-05-01 19:35:37 +02:00
Aras Pranckevicius c87f6242b9 Fix T97644: new 3.2 obj importer does not set blend mode for eevee
The old python importer had a "if do_transparency, set blend_method to
BLEND" type of logic. This bit was missing in the new importer; it was
only setting the eevee blend method when a transparency texture was
present, but not in other cases of transparency (as driven by MTL
"illum" mode).

Reviewd By: Howard Trickey
Differential Revision: https://developer.blender.org/D14783
2022-05-01 20:10:21 +03:00
Aras Pranckevicius 33518f9da1 Fix T97417: OBJ: support tab and other whitespace characters after obj/mtl keywords
Even if available OBJ/MTL format documentations don't explicitly specify
which characters can possibly separate keywords & arguments, turns out
some files out there in the wild use TAB character after the line
keywords. Which is something the new 3.2 importer was not quite
expecting (T97417).

Fix this by factoring out a utility function that checks if line starts
with a keyword followed by any whitespace, and using that across the
importer. Also fix some other "possible whitespace around name-like
parts" of obj/mtl parser as pointed out by the repro files in T97417.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14782
2022-05-01 20:07:03 +03:00
Clément Foucault 30d1d4579e Cleanup: Overlay: Remove unused extern datatoc and shader library
These are not needed anymore.
2022-05-01 18:47:51 +02:00
Clément Foucault 6cad9c7964 Overlay: Port particle display shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 18:40:48 +02:00
Clément Foucault d02d1129f7 Overlay: Port particle edit shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 18:17:37 +02:00
Clément Foucault 6861ef62a6 Overlay: Port sculpt mask shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 18:07:16 +02:00
Clément Foucault cc268238ea Overlay: Port wireframe shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 17:39:32 +02:00
Clément Foucault ba22aa8797 Overlay: Port facing shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 17:14:30 +02:00
Clément Foucault e59cc3a814 Overlay: Port gpencil canvas shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 17:07:20 +02:00
Clément Foucault d33801e2bf Overlay: Port image empty shader to use shaderCreateInfo
This should have no functional changes.
2022-05-01 16:30:51 +02:00
Clément Foucault 1c992cc647 Overlay: Fix non functional outline on wireframe
This was caused by rB6e5877c189df5d6c2dfcaa44ba4c3c9a8b387998.
2022-05-01 15:37:37 +02:00
Clément Foucault 0dfb6eddc0 Overlay: Port motion path shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 15:37:37 +02:00
Clément Foucault 0c44b03b09 Overlay: Port 2D image overlay shaders to use shaderCreateInfo
This should have no functional changes.
2022-05-01 15:37:37 +02:00
Lukas Tönne df0616bcd0 Nodes: Fix T90233
- Fix default_value initialization of custom node tree interface:

  This was crashing when adding a custom interface socket to a tree.
  The node_socket_set_typeinfo function was called too early, creating a
  default float socket, which then doesn't match the socket type after
  changing to the custom type.

  The node_socket_set_typeinfo only allocates and initializes
  default_value when it isn't already set. That is because the function is
  used either when creating new sockets or to initialize typeinfo after
  loading files. So default_value has to be either null or has to be
  matching the current type already.

- Fix RNA flag for string return value of the valid_socket_type callback:

  String return values of registerable RNA functions need a
  PROP_THICK_WRAP flag since they don't have a fixed buffer to write into.
2022-05-01 09:27:22 +01:00
Clément Foucault 171851a6c8 Material: Hide material output socket Thickness as it is not used for now
This is a EEVEE-Next feature that is not yet implemented. Ideally the
socket should only be displayed when EEVEE is in the selected target
engine.
2022-05-01 10:09:23 +02:00
Nate Rupsis 5ff931149b Updating Graph editor channels pin tool tip
Reviewed By: Blendify

Maniphest Tasks: T97631

Differential Revision: https://developer.blender.org/D14766
2022-04-30 23:12:44 -04:00
Clément Foucault 12217714c7 Overlay: Port depth only & uniform_color shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 23:56:31 +02:00
Clément Foucault 86b37748a7 Overlay: Port background shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 23:54:52 +02:00
Clément Foucault 6e5877c189 Overlay: Port outline shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 23:13:27 +02:00
Clément Foucault 69a43069e8 Overlay: Port edit gpencil shaders to use shaderCreateInfo
This should have (mostly) no functional changes.

Support for clipping was added to the shaders but it is not enabled for now
as we wait for the Gpencil engine to support clipping.
2022-04-30 21:11:55 +02:00
Germano Cavalcante 57b4efc250 Overlay: port paint shaders to use 'GPUShaderCreateInfo'
Simple port.

Also a description of how each shader is used has been added.

NOTE: The shader created using `OVERLAY_shader_paint_vertcol` cannot be tested.
Apparently it is created but not used.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14812
2022-04-30 14:50:57 -03:00
Clément Foucault fc40356ed8 Overlay: Port edit lattice shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 19:35:51 +02:00
Clément Foucault a8e6ee17cc Overlay: Port edit curves shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 19:20:37 +02:00
Clément Foucault 669349bfe4 Overlay: Port edit uv shaders to use shaderCreateInfo
This should have no functional changes.

Removed `antialiasing_vert.glsl` becaus it was actually a duplicate of
`common_fullscreen_vert.glsl`.
2022-04-30 18:25:05 +02:00
Clément Foucault b95601fa1a Overlay: Port edit uv shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 17:37:19 +02:00
Clément Foucault 237857cc26 Overlay: Port volume shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-30 16:30:09 +02:00
Lukas Stockner ac88123e29 Fix T96576: Light leaking when using normal maps with Multiscatter GGX
The Multiscatter GGX code was missing the same-side checks for incoming and
outgoing directions w.r.t. to shading and geometry normal.

Should not be needed for the Glass variant since it intentionally has both
reflection and transmission.
2022-04-30 13:49:45 +02:00
Peter Kim 5c92c04518 XR: Add object extras, object types visibility session options
This allows object extras such as image-empties to be shown in the VR
viewport/headset display. Being able to see reference images in VR can
be useful for architectural walkthroughs and 3D modeling applications.

Since users may not want to see all object extras (lights, cameras,
etc.), per-object-type visibility settings are also added as session
options.

By slightly refactoring the definition of the 3D View object types
visibility panel (note: no functional changes), the VR Scene Inspection
add-on can show a similar panel without duplicating code. When VR
selection is possible in the future, the object type select options can
also be enabled.

Reviewed By: Severin

Differential Revision: https://developer.blender.org/D14220
2022-04-30 16:23:43 +09:00
Ramil Roosileht 2fc6563a59 D14808: Use saturation as multiplier for saturation filter
A change proposed in T97697, using existing saturation as a multiplier for the filter operation
{F13038602}

Review By: Joseph Eagar, Julian Kaspar
Differential Revision: https://developer.blender.org/D14808
Ref D14808
2022-04-29 20:12:45 -07:00
Clément Foucault eaa63c7d68 Overlay: Port extra shaders to use shaderCreateInfo
This should have no functional changes.
2022-04-29 20:38:42 +02:00
Patrick Mours fc2c22e90c Cycles: Hydra fixes for stageMetersPerUnit and OpenGL context on Windows
Add "stageMetersPerUnit" render setting for USD files that have that set to
something other than the default (e.g. exported by Blender).

And fix a crash when an application creates a Hydra render pass on a thread
that does not have an OpenGL context current.
2022-04-29 19:19:39 +02:00
Brecht Van Lommel 9b92ce9dc0 Cycles: add USD as a file format for Cycles standalone rendering
Long term, this should replace the XML format. This reuses the Hydra render
delegate implementation, and so supports the same features. The same command
line options and GUI work for both XML and USD also.

The implementation of this is still disabled, waiting for some refactoring of
USD library linking. However we want the Cycles code to be in sync between
repositories for the 3.2 release.

Ref T96731
2022-04-29 19:19:19 +02:00
Brecht Van Lommel 060a50a5f7 Cycles: refactor Hydra render delegate building
* Leave code for building the render delegate against other applications and
  their USD libraries to the Cycles repository, since this is not a great fit.
  In the Blender repository, always use Blender's USD libraries now that they
  include Hydra support.
* Hide non-USD symbols from the hdCycles shared library, to avoid library
  version conflicts.
* Share Apple framework linking between the standalone app and plugin.
* Add cycles_hydra module, to be shared between the standalone app and plugin.
* Bring external libs code in sync with standalone repo, adding various missing
  libraries.
* Move some cmake include directories to the top level cycles source folder
  because we need to control their global order, to ensure we link against the
  correct headers with mixed Blender libraries and external USD libraries.
2022-04-29 19:03:06 +02:00
Sebastian Parborg 074a8558b7 Fix rendering of wire curves when used as custom bone objects
In the current code we do not render any curves if they have not been
converted to meshes. This change makes the custom bone drawing try to
render mesh objects first and then falls back to curve objects if there
is no mesh data available.

Reviewed By: Clement

Differential Revision: http://developer.blender.org/D14804
2022-04-29 18:22:32 +02:00
Ray Molenkamp 3eb9b4dfbc Windows: make.bat change python detection order
Given we are officially on 3.10 now, look
for that version first, followed by any future
version before falling back to 3.9
2022-04-29 10:13:01 -06:00
Brecht Van Lommel a6f951b464 Cycles: make Hydra display driver optional, for USD without OpenGL
OpenGL support was removed from Blender's USD precompiled libraries. This
is currently only useful when building against other applications anyway.
2022-04-29 18:08:41 +02:00
Brecht Van Lommel e0315a5ef0 Cycles: add profiling command line argument to standalone
Like --cycles-print-stats for Blender.
2022-04-29 18:08:41 +02:00
Bastien Montagne 1a8a69d318 Cleanup: Fix harmless runtime error about null pointer in Outliner tree code.
While the reference would never be used in case of NULL pointer, this
bit of code was not really clear and nice, so make it less ambiguous
now. Also add early return in case a NULL idv pointeris actually passed.
2022-04-29 17:57:46 +02:00
Bastien Montagne 3c7a6718dd Fix T95480: Crash when relocating libraries in some cases.
While code deleting old (relocated to new ones) IDs would work fine in
typical cases, it would fail badly in others, when e.g. drivers would
create 'reversed' dependency from the obdata ID to the object ID.

This commit uses a less efficient, but much safer method. It also
ensures no relocated old IDs is left over in the file (previous version
could easily leave some old IDs from the old library until a full
save/reload cycle happened).
2022-04-29 17:57:46 +02:00
Bastien Montagne 4d464a946a Fix (unreported) library relocating code making indirectly linked IDs direct.
While relatively minor issue, it could become fairly annoying in a big
project, since once an ID is tagged as directly linked it tend to remain
as such.

Now also force indirect tagging when loading new IDs as part of a lib
relocation process, since the ones actually directly linked will be
tagged as such later on.
2022-04-29 17:57:46 +02:00
Bastien Montagne d779b15485 Fix (unreported) bad handling of ID usercount increment in remapping code.
While this only had minor potential effect, both code incrementing
usercount of newly remapped IDs were wrong.

Original one would by-pass any 'ensured user' handling, newer one would
systematically make the ID directly linked...

`id_us_plus_no_lib` is to be used here.
2022-04-29 17:57:46 +02:00
Bastien Montagne f44a34fc55 BKE_lib_remap: add comment note about some remapping options.
Fact that those options are only used in a specific case, and that the
same behavior is ensured in a different part of the code in other cases,
is fairly confusing and unfortunate... At least document it.
2022-04-29 17:57:46 +02:00
Clément Foucault 3b7bce45d2 Fix T97686 DRW: Freeze when switching to material preview or render view
This was caused by the compilation job being created suspended (to avoid
UI slowdown because of the material Preview Icons). The suspended job
wasn't passing the `WM_jobs_test` in `DRW_deferred_shader_remove` and
the material would still be in the compile queue with its status equal to
`GPU_MAT_QUEUED`. This would block the main thread in the waiting loop.
But since the job manager timer needs to execute in the main thread, the
compilation job was never being pushed out of its suspended state.
This lead to a complete lock situation.

The solution is to use `WM_jobs_customdata_from_type` which does exactly
what we need.

Also fixed a nullptr free.
2022-04-29 17:57:38 +02:00