Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-01Refactor: Rename Object->obmat to Object->object_to_worldSergey Sharybin
Motivation is to disambiguate on the naming level what the matrix actually means. It is very easy to understand the meaning backwards, especially since in Python the name goes the opposite way (it is called `world_matrix` in the Python API). It is important to disambiguate the naming without making developers to look into the comment in the header file (which is also not super clear either). Additionally, more clear naming facilitates the unit verification (or, in this case, space validation) when reading an expression. This patch calls the matrix `object_to_world` which makes it clear from the local code what is it exactly going on. This is only done on DNA level, and a lot of local variables still follow the old naming. A DNA rename is setup in a way that there is no change on the file level, so there should be no regressions at all. The possibility is to add `_matrix` or `_mat` suffix to the name to make it explicit that it is a matrix. Although, not sure if it really helps the readability, or is it something redundant. Differential Revision: https://developer.blender.org/D16328
2022-10-24GPencil: Fix regression (part3) with edit mode introduced in rB0ee9282b5c51Clément Foucault
Vertex indexing has not been updated and stroke_start usage was wrong. Update all `stroke_start` usage.
2022-10-24GPencil: Use indexed rendering instead of instancesClément Foucault
This allows using instancing in other ways, like resources indexing.
2022-10-12Cleanup: EEVEE-Next: Add precision to commentClément Foucault
2022-10-10EEVEE-Next: Fix surface deferred shader compilation in debug modeClément Foucault
2022-10-09Cleanup: Remove data duplication from large array in eevee_camera.hhJesse Yurkovich
Use `inline constexpr` instead of `static const` to prevent these variables from being duplicated in each translation unit that includes the eevee_camera.hh header (was included into 17 different object files with MSVC). Differential Revision: https://developer.blender.org/D16200
2022-10-08Attribute Node: support accessing attributes of View Layer and Scene.Alexander Gavrilov
The attribute node already allows accessing attributes associated with objects and meshes, which allows changing the behavior of the same material between different objects or instances. The same idea can be extended to an even more global level of layers and scenes. Currently view layers provide an option to replace all materials with a different one. However, since the same material will be applied to all objects in the layer, varying the behavior between layers while preserving distinct materials requires duplicating objects. Providing access to properties of layers and scenes via the attribute node enables making materials with built-in switches or settings that can be controlled globally at the view layer level. This is probably most useful for complex NPR shading and compositing. Like with objects, the node can also access built-in scene properties, like render resolution or FOV of the active camera. Lookup is also attempted in World, similar to how the Object mode checks the Mesh datablock. In Cycles this mode is implemented by replacing the attribute node with the attribute value during sync, allowing constant folding to take the values into account. This means however that materials that use this feature have to be re-synced upon any changes to scene, world or camera. The Eevee version uses a new uniform buffer containing a sorted array mapping name hashes to values, with binary search lookup. The array is limited to 512 entries, which is effectively limitless even considering it is shared by all materials in the scene; it is also just 16KB of memory so no point trying to optimize further. The buffer has to be rebuilt when new attributes are detected in a material, so the draw engine keeps a table of recently seen attribute names to minimize the chance of extra rebuilds mid-draw. Differential Revision: https://developer.blender.org/D15941
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-10-07EEVEE-Next: Use global viewport size instead of DRWView oneClément Foucault
This is part of the effor to simplify the View struct in order to implement multiview rendering.
2022-10-07DRW: Move CameraTexCoFactors to engine specific storageClément Foucault
This is part of the effor to simplify the View struct in order to implement multiview rendering. The CameraTexCoFactors being only valid for a single view, and being only used in very few places, it make sense to move it to the engine side.
2022-10-07DRW: Split ViewCullingData out of ViewInfosClément Foucault
This is in order to reduce the size of ViewInfos and support multi view rendering.
2022-10-06Cleanup: spelling in code commentsCampbell Barton
2022-10-05Cleanup: Clang tidyHans Goudey
Also remove unnecessary struct keywords in C++ files.
2022-10-05DRW: Split ViewProjectionMatrix in order to increase precisionClément Foucault
This also removes the need to compute the persmat and saves some memory from the `ViewInfos` struct. This is needed to allow multiview support. Initial testing found no major performance regression during vertex heavy workload. Test file: {F13610017} Results: | Platform | Master | Split Matrix| | Linux + Mesa + AMD W6600 | 48 fps | 47 fps | | Macbook Pro M1 | 50 fps | 51 fps | | Linux + NVidia 1080Ti | 51 fps | 52 fps | | Linux + Radeon Vega 64 | 25.6 fps | 26.7 fps | Increased precision when far from origin: {F13610024} {F13610025} Reviewed By: jbakker Differential Revision: https://developer.blender.org/D16125
2022-10-04Always initialize MaterialPass (Fixes a crash in mscv)Miguel Pozo
Differential Revision: https://developer.blender.org/D16134
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-10-03Cleanup: fix source comment/documentation typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D16071
2022-09-27GPU: Revert part of D16017 that was accidentally commitedClément Foucault
This code slipped through the final review step surely caused by a faulty merge. Fixes T101372 Regression: World shader setup crashes Blender in rendered view Regression introduced by rB697b447c2069bbbbaa9929aab0ea1f66ef8bf4d0
2022-09-26Cleanup: format, ensure trailing newlinesCampbell Barton
2022-09-26Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
Use function style casts in C++ headers & source.
2022-09-25Cleanup: remove redundant parenthesis (especially with macros)Campbell Barton
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: remove redundant double parenthesisCampbell Barton
2022-09-22Metal: MTLContext implementation and immediate mode rendering support.Thomas Dinges
MTLContext provides functionality for command encoding, binding management and graphics device management. MTLImmediate provides simple draw enablement with dynamically encoded data. These draws utilise temporary scratch buffer memory to provide minimal bandwidth overhead during workload submission. This patch also contains empty placeholders for MTLBatch and MTLDrawList to enable testing of first pixels on-screen without failure. The Metal API also requires access to the GHOST_Context to ensure the same pre-initialized Metal GPU device is used by the viewport. Given the explicit nature of Metal, explicit control is also needed over presentation, to ensure correct work scheduling and rendering pipeline state. Authored by Apple: Michael Parkin-White Ref T96261 (The diff is based on 043f59cb3b5835ba1a0bbf6f1cbad080b527f7f6) Reviewed By: fclem Differential Revision: https://developer.blender.org/D15953
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-15Cleanup: spelling in comments, comment blocksCampbell Barton
2022-09-14Added missing license headers.Jeroen Bakker
2022-09-13EEVEE-Next: Cryptomatte render passes.Jeroen Bakker
This change adds cryptomatte render passes to EEVEE-Next. Due to the upcoming viewport compositor we also improved cryptomatte so it will be real-time. This also allows viewing the cryptomatte passes in the viewport directly. {F13482749} A surface shader would store any active cryptomatte layer to a texture. Object hash is stored as R, Asset hash as G and Material hash as B. Hashes are only calculated when the cryptomatte layer is active to reduce any unneeded work. During film accumulation the hashes are separated and stored in a texture array that matches the cryptomatte standard. For the real-time use case sorting is skipped. For final rendering the samples are sorted and normalized. NOTE: Eventually we should also do sample normalization in the viewport in order to extract the correct mask when using the viewport compositor. Reviewed By: fclem Maniphest Tasks: T99390 Differential Revision: https://developer.blender.org/D15753
2022-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-09-05IDMAnagement: Add owner ID pointer to embedded ones.Bastien Montagne
Add a dedicated `owner_id` pointer to ID types that can be embedded (Collections and NodeTrees), and modify slightly come code to make handling those more safe and consistent. This implements first part of T69169. Reviewed By: brecht Differential Revision: https://developer.blender.org/D15838
2022-09-05Merge branch 'blender-v3.3-release'Clément Foucault
2022-09-05Fix T100788 Regression: EEVEE wrong normal map on backfacesClément Foucault
This was caused by rB07cf3ce92fa2. It was missing a sign flip.
2022-09-02EEVEE-Next: Port to new Draw ManagerClément Foucault
2022-09-02DRW-Next: Add uniform attributes (object attributes) supportClément Foucault
This replaces the direct shader uniform layout declaration by a linear search through a global buffer. Each instance has an attribute offset inside the global buffer and an attribute count. This removes any padding and tighly pack all uniform attributes inside a single buffer. This would also remove the limit of 8 attribute but it is kept because of compatibility with the old system that is still used by the old draw manager.
2022-09-02Cleanup: EEVEE-Next: Use reference as suggested by MSVCClément Foucault
2022-09-02Merge branch 'blender-v3.3-release'Clément Foucault
# Conflicts: # release/scripts/addons
2022-09-02Fix T100377: EEVEE: Regression 3.2 normalmap node brokenClément Foucault
This was caused by un-wanted normalization. This is a requirement of the MikkTspace. The issue is that g_data.N is expected to be normalized by many other functions and overriden by bump displacement. Adding a new global variable containing the interpolated normal fixes the issue AND make it match cycles behavior better (mix between bump and interpolated normal).
2022-09-02EEVEE-Next: Move weight layer indexes to shader shared.Jeroen Bakker
Upcoming cryptomatte patch would need access to these defines. So moving them from film_lib to shader shared. We cannot include the film_lib as it requires images/textures to be bound that we don't need. At the same time fixes incorrect casing (`lAYER` => `LAYER`).
2022-08-30EEVEE-Next: Register render passes for compositor.Jeroen Bakker
EEVEE-Next passes were rendered to the render result, but didn't appear in the compositor. Reasoning is that when a render engine has the update render passes callback registered it would not register any default render passes. This callback is used to update the Render Layer node. This patch implements the callback for EEVEE-Next with the render passes that are already available. In the future the callback should be extended. Note that AO/SHADOW render passes have been disabled for now as they need to be converted to color buffers.
2022-08-22EEVEE-Next: Fix shader compilation error.Jeroen Bakker
This fixes a compilation error in eevee_light_culling_debug shader. Some compilers complained when accessing the same data twice. Unclear why. We should investigate that this change doesn't harm the performance of the shader. Although the light is a local variable it might clutter available registers. If so it will harm developers during debugging.
2022-08-18Cleanup: spelling, formatCampbell Barton
2022-08-17Cleanup: Remove redundant use of evaluated non-mesh objectsHans Goudey
Metaball, curve, text, and surface objects use the geometry component system to add evaluated mesh object instances to the dependency graph "for render engine" iterator. Therefore it is unnecessary to process those object types in these loops-- it would either be redundant work or a no-op.
2022-08-17Metaball: Evaluate metaball objects as mesh componentsHans Goudey
With the ultimate goal of simplifying drawing and evaluation, this patch makes the following changes and removes code: - Use `Mesh` instead of `DispList` for evaluated basis metaballs. - Remove all `DispList` drawing code, which is now unused. - Simplify code that converts evaluated metaballs to meshes. - Store the evaluated mesh in the evaluated geometry set. This has the following indirect benefits: - Evaluated meshes from metaball objects can be used in geometry nodes. - Renderers can ignore evaluated metaball objects completely - Cycles rendering no longer has to convert to mesh from `DispList`. - We get closer to removing `DispList` completely. - Optimizations to mesh rendering will also apply to metaball objects. The vertex normals on the evaluated mesh are technically invalid; the regular calculation wouldn't reproduce them. Metaball objects don't support modifiers though, so it shouldn't be a problem. Eventually we can support per-vertex custom normals (T93551). Differential Revision: https://developer.blender.org/D14593
2022-08-17Cleanup: strip blank lines around comment blocksCampbell Barton
2022-08-17Cleanup: compiler warnings, clang-tidyCampbell Barton
2022-08-16EEVEE-Next: Reduce image bindings.Jeroen Bakker
This change combines the diffuse/specular light passes into a single texture array, freeing up an image binding for cryptomatte. When diffuse/specular light pass and/or requested a texture array will be allocated. Only when specular light is requested 2 images will always be allocated. This increases the memory overhead when viewing the specular light renderpass in the viewport. For final rendering it is a common scenario that none or both are requested. Reviewed By: fclem Differential Revision: https://developer.blender.org/D15701
2022-08-16Cleanup: spelling in commentsCampbell Barton
2022-08-16Cleanup: formatCampbell Barton
2022-08-15EEVEE-Next: HiZ Buffer: New implementationClément Foucault
This new implementation does all downsampling in a single compute shader dispatch, removing a lot of complexity from the previous recursive downsampling. This is heavilly inspired by the Single-Pass-Downsampler from GPUOpen: https://github.com/GPUOpen-Effects/FidelityFX-SPD However I do not implement all the optimization bits as they require vulkan (GL_KHR_shader_subgroup) and is not as versatile (it is only for HiZ). Timers inside renderdoc report ~0.4ms of saving on a 2048*1024 render for the whole downsampling. Note that the previous implementation only processed 6 mips where the new one processes 8 mips. ``` EEVEE ~1.0ms EEVEE-Next ~0.6ms ``` Padding has been bumped to be of 128px for processing 8 mips. A new debug option has been added (debug value 2) to validate the HiZ.
2022-08-15Cleanup: fix typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D15680