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
2020-06-03GPUMaterial: Rework/simplify environment texture filteringClément Foucault
This use the latest GPUTexture change to use the sampler state to avoid the pole issues instead of using GLSL hacks.
2020-06-02EEVEE: Refactor of eevee_material.cClément Foucault
These are the modifications: -With DRW modification we reduce the number of passes we need to populate. -Rename passes for consistent naming. -Reduce complexity in code compilation -Cleanup how renderpass accumulation passes are setup, using pass instances. -Make sculpt mode compatible with shadows -Make hair passes compatible with SSS -Error shader and lookdev materials now use standalone materials. -Support default shader (world and material) using a default nodetree internally. -Change BLEND_CLIP to be emulated by gpu nodetree. Making less shader variations. -Use BLI_memblock for cache memory allocation. -Renderpasses are handled by switching a UBO ref bind. One major hack in this patch is the use of modified pointer as ghash keys. This rely on the assumption that the keys will never overlap because the number of options per key will never be bigger than the pointed struct. The use of one single nodetree to support default material is also a bit hacky since it won't support concurent usage of this nodetree. (see EEVEE_shader_default_surface_nodetree) Another change is that objects with shader errors now appear solid magenta instead of shaded magenta. This is only because of code reuse purpose but could be changed if really needed. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7642
2020-05-18UI: Widget: Make emboss offset dependent of line widthClément Foucault
2020-05-18UI: Widgets: Reduce constants count in shaderClément Foucault
2020-05-14UI: Fix Unreported missing background for azone arrowClément Foucault
This was caused by the sRGB viewport changes. The fix is to modify the alpha values manually. The shader was also missing a srgb fix.
2020-04-24GPU: Add Polyline shader (wide line emulation)Clément Foucault
This new shader is able to emulate smooth wide lines drawing using a geometry shader. This shader needs viewportSize and lineWidth uniforms to be set. There is multiple variants to replace the usage of wide lines for most shaders. This patch only fix the gizmo_types files and the navigation gizmo. Other areas could be fixed afterward, I just limited the patch size. Fix T57570. Reviewed By: billreynish Differential Revision: https://developer.blender.org/D7487
2020-04-14GPUShader: Implement workaround for gizmo drawing on sRGB framebufferClément Foucault
This solution involves adding a uniform to each fragment shader that is used by gizmo drawing and use the framebuffer state to set this uniform accordingly. This solution can also be carried to external shaders (addons). A single line of code would then be enough to fix the issue. The only trickery here is the dummy define: `#define srgb_to_framebuffer_space(a)` This is in order to avoid breaking other DRW shaders that use the same fragment shader code but do not need the tranformation. Related to T74139 Reviewed By: brecht, campbellbarton Differential Revision: https://developer.blender.org/D7261
2020-04-09Shading: add Roughness input to Noise and Wave texture nodesBartosz Moniewski
Currently in fractal_noise functions, each subsequent octave doubles the frequency and reduces the amplitude by half. This patch introduces Roughness input to Noise and Wave nodes. This multiplier determines how quickly the amplitudes of the subsequent octaves decrease. Value of 0.5 will be the default, generating identical noise we had before. Values above 0.5 will increase influence of each octave resulting in more "rough" noise, most interesting pattern changes happen there. Values below 0.5 will result in more "smooth" noise. Differential Revision: https://developer.blender.org/D7065
2020-03-27Cleanup: GPUShader: Remove unused shadersClément Foucault
2020-03-19Fix T73931: Stereo Viewport Color ManagementJeroen Bakker
Stereoscopic viewport didn't support Color Manangement due recent changes in the color management pipeline. In order to solve the issue we will migrate the strereo rendering into the GPUViewport. This will share some textures and reduce required GPU memory. Reviewed By: fclem, dfelinto Differential Revision: https://developer.blender.org/D6922
2020-03-18Objects: Eevee and workbench rendering of new Volume, Hair, PointCloudBrecht Van Lommel
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-11Workbench Simplification RefactorClément Foucault
This patch is (almost) a complete rewrite of workbench engine. The features remain unchanged but the code quality is greatly improved. Hair shading is brighter but also more correct. This also introduce the concept of `DRWShaderLibrary` to make a simple include system inside the GLSL files. Differential Revision: https://developer.blender.org/D7060
2020-03-11Eevee: internal support for arbitrary number of volume gridsBrecht Van Lommel
This has no user visible impact yet since smoke volumes only support a fixed set of attributes, but will become important with the new volume object. For GPU shader compilation, volume grids are now handled separately from image textures. They are somewhere between a vertex attribute and an image texture, basically an attribute that is stored as a texture. Differential Revision: https://developer.blender.org/D6952
2020-03-11Smoke: put density/color in separate textures, fixes for workbench shaderBrecht Van Lommel
This is more in line with standard grids and means we don't have to make many special exceptions in the upcoming change for arbitrary number of volume grids support in Eevee. The workbench shader was also changed to fix bugs where squared density was used, and the smoke color would affect the density so that black smoke would be invisible. This can change the look of smoke in workbench significantly. When using the color grid when smoke has a constant color, the color grid will no longer be premultiplied by the density. If the color is constant we want to be able not to store a grid at all. This breaks one test for Cycles and Eevee, but the setup in that test using a color without density does not make sense. It suffers from artifacts since the unpremultiplied color grid by itself will not have smooth boundaries. Differential Revision: https://developer.blender.org/D6951
2020-03-08Fix T74395: Box interpolation does not support repeat extrapolationJacques Lucke
Reviewers: fclem Differential Revision: https://developer.blender.org/D7009
2020-03-02Shading: Add invert option to Vector Rotate NodeCharlie Jolly
Checkbox to invert rotation angle, suggested by @simonthommes Differential Revision: https://developer.blender.org/D6932
2020-02-25Cleanup: clang-formatBrecht Van Lommel
2020-02-25Overlay: Fix overlays being washed out by render colorsClément Foucault
Clamping here might be a bit too much if output is expected to be HDR. But we don't support HDR atm so clamping is fine.
2020-02-24Fix T74169: Vector Rotate Node - Euler modes not working as intendedCharlie Jolly
Remove additional Euler modes for the time being, not working as intended, will add back if there is a need.
2020-02-24BLF: Optimize text rendering and cachingGermano Cavalcante
The current code allocates and transfers a lot of memory to the GPU, but only a small portion of this memory is actually used. In addition, the code calls many costly gl operations during the caching process. This commit significantly reduce the amount of memory by allocating and transferring a flat array without pads to the GPU. It also calls as little as possible the gl operations during the cache. This code also simulate a billinear filter `GL_LINEAR` using a 1D texture. **Average drawing time:** |before:|0.00003184 sec |now:|0.00001943 sec |fac:|1.6385156675048407 **5 worst times:** |before:|[0.001075, 0.001433, 0.002143, 0.002915, 0.003242] |now:|[0.00094, 0.000993, 0.001502, 0.002284, 0.002328] Differential Revision: https://developer.blender.org/D6886
2020-02-21EEVEE: Render PassesJeroen Bakker
This patch adds new render passes to EEVEE. These passes include: * Emission * Diffuse Light * Diffuse Color * Glossy Light * Glossy Color * Environment * Volume Scattering * Volume Transmission * Bloom * Shadow With these passes it will be possible to use EEVEE effectively for compositing. During development we kept a close eye on how to get similar results compared to cycles render passes there are some differences that are related to how EEVEE works. For EEVEE we combined the passes to `Diffuse` and `Specular`. There are no transmittance or sss passes anymore. Cycles will be changed accordingly. Cycles volume transmittance is added to multiple surface col passes. For EEVEE we left the volume transmittance as a separate pass. Known Limitations * All materials that use alpha blending will not be rendered in the render passes. Other transparency modes are supported. * More GPU memory is required to store the render passes. When rendering a HD image with all render passes enabled at max extra 570MB GPU memory is required. Implementation Details An overview of render passes have been described in https://wiki.blender.org/wiki/Source/Render/EEVEE/RenderPasses Future Developments * In this implementation the materials are re-rendered for Diffuse/Glossy and Emission passes. We could use multi target rendering to improve the render speed. * Other passes can be added later * Don't render material based passes when only requesting AO or Shadow. * Add more passes to the system. These could include Cryptomatte, AOV's, Vector, ObjectID, MaterialID, UV. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D6331
2020-02-19EEVEE: Color Ramp Ease OptimisationCharlie Jolly
This patch provides an optimisation for Ease (Smoothstep) setting in the color ramp node. This optimisation exists already for Constant and Linear modes. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6880
2020-02-17Cycles: Vector Rotate Node using Axis and Angle methodCharlie Jolly
This node provides the ability to rotate a vector around a `center` point using either `Axis Angle` , `Single Axis` or `Euler` methods. Reviewed By: #cycles, brecht Differential Revision: https://developer.blender.org/D3789
2020-02-17Shading: add direction modes and phase offset to wave texture nodeBartosz Moniewski
* Direction mode X, Y and Z to align with axes rather than diagonal or spherical as previously. X is the new default, existing files will use diagonal or spherical for compatibility. * Phase offset to offset the wave along its direction, for purposes like animation and distortion. https://developer.blender.org/D6382
2020-02-15Fix Eevee shader node error when using both RGB and vector curve nodesBrecht Van Lommel
2020-02-15Shading: Extend Vector Math Node with Sin, Cos, Tan and Wrap functionsCharlie Jolly
This adds some extra functions recently added to the float Maths Node. Not all functions have been ported over in this patch. Also: + Tidy up menu + Change node color to match other vector nodes, this helps distinguish vector and float nodes in the tree + Move shared OSL functions to new header node_math.h Reviewed By: brecht Differential Revision: https://developer.blender.org/D6713
2020-02-11DRW: Color Management improvementClément Foucault
Reviewed By: brecht sergey jbakker Differential Revision: http://developer.blender.org/D6729
2020-02-06Merge branch 'blender-v2.82-release'mano-wii
2020-02-06Fix T69776: Error with complex Eevee noise texture in some driversPatrick Bender
Apparently the compiled shader bump into some register limit and the compiler instead of giving an error, does something incorrectly. Differential Revision: https://developer.blender.org/D6759
2020-01-29Fix T73469: OSL: Vector Math Node modulo uses wrong functionCharlie Jolly
This also fixes glsl version of fmod when both inputs are negative. Differential Revision: https://developer.blender.org/D6704
2020-01-28Merge branch 'blender-v2.82-release'Campbell Barton
2020-01-27Fix T67552 EEVEE: Vector Curves node clamps maximum input value at 1.0Clément Foucault
2020-01-27Shading: Add color output to White Noise nodeCharlie Jolly
Hash input values to a color. Differential Revision: https://developer.blender.org/D6672
2020-01-16Fix T73133: UDIM texture count in Eevee is limited by OpenGLLukas Stockner
Based on @fclem's suggestion in D6421, this commit implements support for storing all tiles of a UDIM texture in a single 2D array texture on the GPU. Previously, Eevee was binding one OpenGL texture per tile, quickly running into hardware limits with nontrivial UDIM texture sets. Workbench meanwhile had no UDIM support at all, as reusing the per-tile approach would require splitting the mesh by tile as well as texture. With this commit, both Workbench as well as Eevee now support huge numbers of tiles, with the eventual limits being GPU memory and ultimately GL_MAX_ARRAY_TEXTURE_LAYERS, which tends to be in the 1000s on modern GPUs. Initially my plan was to have one array texture per unique size, but managing the different textures and keeping everything consistent ended up being way too complex. Therefore, we now use a simpler version that allocates a texture that is large enough to fit the largest tile and then packs all tiles into as many layers as necessary. As a result, each UDIM texture only binds two textures (one for the actual images, one for metadata) regardless of how many tiles are used. Note that this rolls back per-tile GPUTextures, meaning that we again have per-Image GPUTextures like we did before the original UDIM commit, but now with four instead of two types. Reviewed By: fclem Differential Revision: https://developer.blender.org/D6456
2019-12-19Fix T72236: UV Stretching OverlayJeroen Bakker
The ratio for area stretching was packed into an unsigned int, but could contain negative numbers. This flipped the negative numbers to high positive numbers and rendered the wrong color in the stretching overlay. I can remember during {T63755} I had to flip the sign to get the correct result, but couldn't find out why that was needed. Now I know. Reviewed By: fclem, mano-wii Differential Revision: https://developer.blender.org/D6440
2019-12-12Add support for tiled images and the UDIM naming schemeLukas Stockner
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender. With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser. Therefore, code that is not yet aware of tiles will just access the default tile as usual. The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9. Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator. The following features are supported so far: - Automatic detection and loading of all tiles when opening the first tile (1001) - Saving all tiles - Adding and removing tiles - Filling tiles with generated images - Drawing all tiles in the Image Editor - Viewing a tiled grid even if no image is selected - Rendering tiled images in Eevee - Rendering tiled images in Cycles (in SVM mode) - Automatically skipping loading of unused tiles in Cycles - 2D texture painting (also across tiles) - 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders) - Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID) - Different resolutions between tiles There still are some missing features that will be added later (see T72390): - Workbench engine support - Packing/Unpacking support - Baking support - Cycles OSL support - many other Blender features that rely on images Thanks to Brecht for the review and to all who tested the intermediate versions! Differential Revision: https://developer.blender.org/D3509
2019-12-08Fix T72269: crash with Eevee and normal maps after recent math node changesBrecht Van Lommel
Reusing math node functions for normal map node caused problems.
2019-12-07Shaders: noise and wave distortion now work uniformly instead of diagonallyBartosz Moniewski
Previously Noise and Wave texture nodes would use noise functions within a [0,1] range for distortion effects. We either add or subtract noise from coordinates, never do both at same time. This led to the texture drastically shifting on the diagonal axis of a plane / cube. This behavior makes the Distortion input hard to control or animate. Capabilities of driving it with other texture are also limited, diagonal shifting is very apparent. This was fixed by offsetting the noise function to a signed range and making it zero-centered. This way noise is uniformly added and subtracted from coordinates. Texture pattern sticks to main coordinates which makes it way easier to control. This change is not strictly backwards compatible, there is versioning to ensure the scale of the distortion remains similar, but the particular pattern can be a little different. Differential Revision: https://developer.blender.org/D6177
2019-12-07Shader Nodes: Add Interpolation modes to Map Range nodeCharlie Jolly
Modes: Linear interpolation (default), stepped linear, smoothstep and smootherstep. This also includes an additional option for the **Clamp node** to switch between **Min Max** (default) and **Range** mode. This was needed to allow clamping when **To Max** is less than **To Min**. Reviewed By: JacquesLucke, brecht Differential Revision: https://developer.blender.org/D5827
2019-12-07Maths Node: Additional functionsCharlie Jolly
When creating shaders and using maths functions it is expected that Blender should match functions in other DCC applications, game engines and shading languages such as GLSL and OSL. This patch adds missing functions to the Blender maths node. Ideally, it would be nice to have these functions available to vectors too but that is not part of this patch. This patch adds the following functions trunc, snap, wrap, compare, pingpong, sign, radians, degrees, cosh, sinh, tanh, exp, smoothmin and inversesqrt. Sign function is based on GLSL and OSL functions and returns zero when x == 0. Differential Revision: https://developer.blender.org/D5957
2019-12-02Overlay Engine: Refactor & CleanupClément Foucault
This is the unification of all overlays into one overlay engine as described in T65347. I went over all the code making it more future proof with less hacks and removing old / not relevent parts. Goals / Acheivements: - Remove internal shader usage (only drw shaders) - Remove viewportSize and viewportSizeInv and put them in gloabl ubo - Fixed some drawing issues: Missing probe option and Missing Alt+B clipping of some shader - Remove old (legacy) shaders dependancy (not using view UBO). - Less shader variation (less compilation time at first load and less patching needed for vulkan) - removed some geom shaders when I could - Remove static e_data (except shaders storage where it is OK) - Clear the way to fix some anoying limitations (dithered transparency, background image compositing etc...) - Wireframe drawing now uses the same batching capabilities as workbench & eevee (indirect drawing). - Reduced complexity, removed ~3000 Lines of code in draw (also removed a lot of unused shader in GPU). - Post AA to avoid complexity and cost of MSAA. Remaining issues: - ~~Armature edits, overlay toggles, (... others?) are not refreshing viewport after AA is complete~~ - FXAA is not the best for wires, maybe investigate SMAA - Maybe do something more temporally stable for AA. - ~~Paint overlays are not working with AA.~~ - ~~infront objects are difficult to select.~~ - ~~the infront wires sometimes goes through they solid counterpart (missing clear maybe?) (toggle overlays on-off when using infront+wireframe overlay in solid shading)~~ Note: I made some decision to change slightly the appearance of some objects to simplify their drawing. Namely the empty arrows end (which is now hollow/wire) and distance points of the cameras/spots being done by lines. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6296
2019-11-27Cycles: Add Random Per Island attribute.OmarSquircleArt
The Random Per Island attribute is a random float associated with each connected component (island) of the mesh. It is particularly useful when artists want to add variations to meshes composed of separate units. Like tree leaves created using particle systems, wood planks created using array modifiers, or abstract splines created using AN. Reviewed By: Sergey Sharybin, Jacques Lucke Differential Revision: https://developer.blender.org/D6154
2019-11-24Cleanup: doxygen commentsCampbell Barton
Also correct some outdated symbol references, add missing 'name' commands.
2019-10-15Fix T70605: incorrect darken and lighten rgb mix modeJacques Lucke
Differential Revision: https://developer.blender.org/D6058 Reviewers: brecht, fclem
2019-10-08Fix T70586 EEVEE: principled shader alpha bleeding issuesClément Foucault
Avoid double multiplication by alpha on ssr/sss data.
2019-09-17DRW: Refactor to support draw call batchingClément Foucault
Reviewers: brecht Differential Revision: D4997
2019-09-14Revert "DRW: Refactor to support draw call batching"Clément Foucault
This reverts commit ce34a6b0d727bbde6ae373afa8ec6c42bc8980ce.
2019-09-13DRW: Refactor to support draw call batchingClément Foucault
Reviewers: brecht Differential Revision: D4997
2019-09-12Shading: Add Vertex Color node.OmarSquircleArt
This patch adds a new Vertex Color node. The node also returns the alpha of the vertex color layer as an output. Reviewers: brecht Differential Revision: https://developer.blender.org/D5767
2019-09-12Shading: Add More Features To The Voronoi Node.OmarSquircleArt
This patch allows the Voronoi node to operate in 1D, 2D, and 4D space. It also adds a Randomness input to control the randomness of the texture. Additionally, it adds three new modes of operation: - Smooth F1: A smooth version of F1 Voronoi with no discontinuities. - Distance To Edge: Returns the distance to the edges of the cells. - N-Sphere Radius: Returns the radius of the n-sphere inscribed in the cells. In other words, it is half the distance between the closest feature point and the feature point closest to it. And it removes the following three modes of operation: - F3. - F4. - Cracks. The Distance metric is now called Euclidean, and it computes the actual euclidean distance as opposed to the old method of computing the squared euclidean distance. This breaks backward compatibility in many ways, including the base case. Reviewers: brecht, JacquesLucke Differential Revision: https://developer.blender.org/D5743