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-09-19Cleanup: consistent TODO/FIXME formatting for namesCampbell Barton
Following the most widely used convention for including todo's in the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-07-30Cleanup: GPU: Remove GPU_draw.h and move fluid gpu function to DRWClément Foucault
2020-07-29GPU: Refactor gpu_texture_image to not use GL callsClément Foucault
This is also a bit of code cleanup, reorganisation. Tried to be DRYed but avoid too much code change to (hopefully) minimize breakage. - GPU: remove TEXTARGET_CUBE_MAP, this is no longer used in the codebase. - GPUTexture: Move compressed texture upload to gpu_texture.cc - GPUTexture: Add per texture Anisotropic filtering switch
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-03GPUMaterial: Add support for different sampler state per image samplerClément Foucault
This bridge between the new sampler state support from GPUTexture and draw material handling. The Sampler State is just the one from the texture for now. No change in logic.
2020-03-06Nodes: Support storing socket link limits in bNodeSocketTypeJacques Lucke
Currently the link limit of sockets is stored in bNodeSocket->limit. This allows for a lot of flexibility, but is also very redundant. In every case I've had to deal with so far, it would have "more correct" to set the link limit per socket type and not per socket. I did not enforce this constraint yet, because the link limit is exposed in the Python API, which I did not want to break here. In the future it might even make sense to only support only three kinds of link limits: a) no links, b) at most one link, c) an arbitrary number links links. The other link limits usually don't work well with tools (e.g. which link should be removed when a new one is connected?) and is not used in practice. However, that is for another day. Eventually, I would like to get rid of bNodeSocket->limit completely and replace it either with fixed link limits or a callback in bNodeSocketType. This patch consists of three parts: **1. Support defining link limit in socket type** This introduces a new `nodeSocketLinkLimit` function that serves as an indirection to hide where the link limit of a socket is defined. **2. Define link limits for builtin sockets on socket type** Data sockets: one input, many outputs Virtual sockets: one input, one output Undefined sockets: many inputs, many outputs (to avoid that links are removed when the type of the socket is not known) **3. Remove `bNodeSocketTemplate->limit`** This wasn't used anymore after the second commit. Removing it simplifies socket definitions in hundreds of places and removes a lot of redundancy. Differential Revision: https://developer.blender.org/D7038 Reviewers: brecht
2020-02-27Cleanup: more refactoring of GPU material attributes and texturesBrecht Van Lommel
This further separates requested attributes and textures from the actual node graph, that can be retained after the graph has been compiled and freed. It makes it easier to add volume grids as a native concept, which sits somewhere between an attribute and a texture. It also adds explicit link types for UDIM tile mapping, rather than relying on fairly hidden logic.
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-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-09-06Eevee: Use manual derivatives for better quality bump.Clément Foucault
We basically duplicate the height map branch plugged into the bump node, and tag each node in each branch as dx/dy/ref using `branch_tag`. Then we add a one pixel offset on the texture coordinates if the node is tagged as dx or dy. The dx/dy branches are plugged into (new) hidden sockets on the bump node. This match cycles bump better but have a performance impact. Also, complex nodetrees can now become instruction limited and not compile anymore. Reviewers: brecht Differential Revision: https://developer.blender.org/D5531
2019-08-30GPU: Split gpu_shader_material into multiple files.OmarSquircleArt
This patch continue the efforts to split the `gpu_shader_material` file started in D5569. Dependency resolution is now recursive. Each shading node gets its own file. Additionally, some utility files are added to be shared between files, like `math_util`, `color_util`, and `hash`. Some files are always included because they may be used in the execution function, like `world_normals`. Some glsl functions appeared to be unused, so they were removed, like `output_node`, `bits_to_01`, and `exp_blender`. Other functions have been renamed to be more general and get used as utils, like `texco_norm` which became `vector_normalize`. A lot of the opengl tests fails, but those same tests also fail in master, so this is probably unrelated to this patch. Reviewers: brecht Differential Revision: https://developer.blender.org/D5616
2019-06-07Fix T64625: Eevee image textures with alpha have dark edgesBrecht Van Lommel
Now texture storage of images is defined by the alpha mode of the image. The downside of this is that there can be artifacts near alpha edges where pixels with zero alpha bleed in. It also adds more code complexity since image textures are no longer all stored the same way. This changes allows us to keep using sRGB texture formats, which have edge darkening when stored with premultiplied alpha. Game engines seems to generally do the same thing, and we want to be compatible with them.
2019-05-13Cycles/Eevee: unified and improved texture image color space handlingBrecht Van Lommel
Cycles now uses the color space on the image datablock, and uses OpenColorIO to convert to scene linear as needed. Byte images do not take extra memory, they are compressed in scene linear + sRGB transfer function which in common cases is a no-op. Eevee and workbench were changed to work similar. Float images are stored as scene linear. Byte images are compressed as scene linear + sRGB and stored in a GL_SRGB8_ALPHA8 texture. From the GLSL shader side this means they are read as scene linear, simplifying the code and taking advantage of hardware support. Further, OpenGL image textures are now all stored with premultiplied alpha. Eevee texture sampling looks a little different now because interpolation happens premultiplied and in scene linear space. Overlays and grease pencil work in sRGB space so those now have an extra conversion to sRGB after reading from image textures. This is not particularly elegant but as long as engines use different conventions, one or the other needs to do conversion. This change breaks compatibility for cases where multiple image texture nodes were using the same image with different color space node settings. However it gives more predictable behavior for baking and texture painting if save, load and image editing operations have a single color space to handle. Differential Revision: https://developer.blender.org/D4807
2019-04-22Cleanup: style, use braces for nodesCampbell Barton
2019-04-18Cleanup: deduplicate image user initialization, make consistent.Brecht Van Lommel
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18Fix T57457: animated image sequences not working in Eevee.Brecht Van Lommel
The dependency graph now handles updating image users to point to the current frame, and tags images to be refreshed on the GPU. The image editor user is still updated outside of the dependency graph. We still do not support multiple image users using a different current frame in the same image, same as 2.7. This may require adding a GPU image texture cache to keep memory usage under control. Things like rendering an animation while the viewport stays fixed at the current frame works though.
2019-02-03Cleanup: trailing commasCampbell Barton
Needed for clan-format not to wrap onto one line.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2018-11-08Eevee: Add support for interpolation options for Environment Texture nodesClément Foucault
2018-07-10Image: remove fields option for image sequencesCampbell Barton
Remove support for loading interlaced image sequences because its less common now to record interlaced video, the option to de-interlace video on load remains.
2018-07-06Cleanup: remove unused shader node compatibility flag.Brecht Van Lommel
No longer needed after Blender Internal removal and Eevee replacing the Cycles GLSL shading nodes.
2018-07-03Nodes: add new image button to image nodes.Brecht Van Lommel
2018-06-08Merge branch 'master' into blender2.8Campbell Barton
2018-06-08Cleanup: trailing spaceCampbell Barton
Remove from blender/nodes, collada, blenfont & render.
2018-06-01Merge branch 'master' into blender2.8Campbell Barton
2018-06-01Cleanup: trailing whitespace (comment blocks)Campbell Barton
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-02-13Merge branch 'master' into blender2.8Campbell Barton
2018-02-13(Nodes) Display image name if any in the Cycles Image and Environment ↵Ines Almeida
Texture node title
2017-07-14Implement Uniformbuffer objects for nodetree parametersDalai Felinto
For users that means you can tweak shaders in the nodetree and things are way faster. This is a huge improvement, particularly in systems that have no shader cache. From the code perspective it means we are no longer re-compiling the shader every time a value is tweaked in the UI. We are using uniforms for those values. It would be slow to add that many uniforms for all the shaders. So instead we are using UBO (Uniform Buffer Objects). This fixes the main issue of T51467. However GWN_shaderinterface_create() still needs to be improvedi. When opening a .blend all shaders are compiled once, so optimizing it will bring a measurable impact. ======================================================================== NOTE: This breaks update of Cycles material upon nodetree nodes tweaking. It will be fixed separately by depsgraph, once tackling T51925 (Animated Eevee values slowdown). The idea is to make Depsgraph update more granular. The XXX TODO in rna_nodetree.c will be tackled at that time as well. ======================================================================== Reviewers: sergey, brecht, fclem Differential Revision: https://developer.blender.org/D2739
2017-06-29Eevee: Fix broken default coordinate (reported via IRC by Dalai Felinto).Clément Foucault
2017-05-01Eevee: World nodetree gpumaterial compatibility.Clément Foucault
- Unify GPUMaterial creation (world/mesh). - Support for multiple shader variations (not used for now). - Convert GPUInputs to DRWUniforms to be used with the draw manager. - Nodetree Update is not supported. The only way to refresh the shaders is to change render engine. - Cleanup in GPUPass. - Add new temporary Node Compatibility type. Compatibility types should be removed in the future.
2016-05-05Cleanup: styleCampbell Barton
2016-04-27Code cleanup: minor cleanups for GPU_link return values, normal map node.Brecht Van Lommel
2015-03-28Cleanup: use BKE_texture_ prefixCampbell Barton
2014-11-29Cleanup: unused headersCampbell Barton
2014-11-26World background working on cycle nodes.Antony Riakiotakis
This is added in the spirit of the general cycles GLSL system which is pretty much WIP still. This will only work on cycles at the moment but generating for blender internal is possible too of course though it will be done in a separate commit. This hasn't been tested with all and every node in cycles, but environment and regular textures with texture coordinates work. There is some difference between the way cycles treats some coordinates, which is in world space and the way GLSL treats them, which is in view space. We might want to explore and improve this further in the future. ...also </drumroll>
2014-11-20Fix T42622, environment texture GLSL result different from rendering.Antony Riakiotakis
Also included mirror ball shader, which was missing.
2014-03-02Fix T37334: Better "internal links" function for muting and node disconnect.Lukas Tönne
Implements a more flexible internal connect function for standard nodes (compositor, shader, texture). Allow feasible datatype connections by priority. The priorities for common datatypes in compositor, shader and texture nodes are encoded in a simple function. Certain impossible connections (e.g. color -> cycles shader) are excluded by giving them -1 priority. Priority overrides link status: If a higher priority input can be found, this will be used regardless of link status. Link status only comes into play for inputs with same priority. Reviewers: brecht CC: sebastian_k Differential Revision: https://developer.blender.org/D356
2013-10-02Fixes for cycles Mapping and Vector Transform node:Brecht Van Lommel
* Keep the Mapping node default type as Point for now, instead of Texture. The latter is a better default, but this is breaking API compatibility and it's too close to release to expect addons to be fixed in time. * Vector Transform and Mapping nodes had properties with name "type" to set the type of vector, but this conflicts with the node type property, so renamed to vector_type now.
2013-09-26Fix cycles issue with mapping node rotation and scale order. When using bothBrecht Van Lommel
scale and rotation in mapping node, there would be shearing, and the only way to avoid that was to add 2 mapping nodes. This is because to transform the texture, the inverse transform needs to be done on the texture coordinate Now the mapping node has Texture/Point/Vector/Normal types to transform the vector for a particular purpose. Point is the existing behavior, Texture is the new default that behaves more like you might expect.
2013-05-29Cleanup: Removed all NODE_OPTIONS flags from C node type definitions, these ↵Lukas Toenne
are no longer required and have no effect. Whether or not a node supports additional options buttons is now determined by the existence of a draw callback (uifunc and/or uifuncbut).
2013-05-27style cleanup: nodesCampbell Barton
2013-05-22Shader Nodes:Thomas Dinges
* Use unified node sizes, as already was done with compositor nodes. Only Mapping node uses a custom size. This way we don't have too small nodes on creation anymore. * Don't show Script Category for Blender Internal nodes.
2013-03-18code cleanupCampbell Barton
2013-03-18Merge of the PyNodes branch (aka "custom nodes") into trunk.Lukas Toenne
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements. === Dynamic node type registration === Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes. Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2]. === Node group improvements === Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3]. The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there. [1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes [2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender [3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2012-11-15Image thread safe improvementsSergey Sharybin
This commit makes BKE_image_acquire_ibuf referencing result, which means once some area requested for image buffer, it'll be guaranteed this buffer wouldn't be freed by image signal. To de-reference buffer BKE_image_release_ibuf should now always be used. To make referencing working correct we can not rely on result of image_get_ibuf_threadsafe called outside from thread lock. This is so because we need to guarantee getting image buffer from list of loaded buffers and it's referencing happens atomic. Without lock here it is possible that between call of image_get_ibuf_threadsafe and referencing the buffer IMA_SIGNAL_FREE would be called. Image signal handling too is blocking now to prevent such a situation. Threads are locking by spinlock, which are faster than mutexes. There were some slowdown reports in the past about render slowdown when using OSX on Xeon CPU. It shouldn't happen with spin locks, but more tests on different hardware would be really welcome. So far can not see speed regressions on own computers. This commit also removes BKE_image_get_ibuf, because it was not so intuitive when get_ibuf and acquire_ibuf should be used. Thanks to Ton and Brecht for discussion/review :)
2012-10-29style cleanupCampbell Barton
2012-10-25Fix issue after commit 50282: float texture painting non-color data textures didBrecht Van Lommel
not do correct partial updates, now it remembers if the opengl texture is a non-color data texture or not and takes that into account for the update. Also includes some renaming ncd => is_data for consistency with color space terminology used elsewhere.
2012-10-23Correction to recent fix for shader nodes -- image could be not loaded yetSergey Sharybin
when tree is being executed. This could lead to nor initialized color space for the image. Solved by insuring image buffer is loaded before checking for whether color conversion is needed.