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-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-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-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-08-27Workbench: Specular Highlighting for MatCapsJeroen Bakker
With Blender 2.80 we introduced a more flexible matcap system. One change we did was to multiply the matcap with the base color that was shaded. As matcaps contains diffuse and specular lighting in a single texture this lead to rendering artifacts. Artists were complaining that everything looked to metalic. We now support a separate `diffuse` and `specular` pass for matcaps. `shaded_color = diffuse_light * base_color + specular_light` For matcaps to support this feature they need to be multilayer openexr files with 2 renderpasses (named `diffuse` and `specular`). In the future we can change this to first pass/second pass in stead of this naming convention. Reviewed By: fclem, brecht Differential Revision: https://developer.blender.org/D5335
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-05-08Workbench: Use common_view_lib and remove NormalMatrix usageClément Foucault
This is in order to lower the number of matrices to compute.
2019-04-23Workbench: Support Active Vertex ColorJeroen Bakker
Currently it is not possible to view the vertex colors of an object. To optimize the workflow, workbench will need to support Vertex Colors. The Vertex Colors is a new option in `shading->color_type`. When objects do not have vertex color, the objects will be rendered with the `V3D_SHADING_OBJECT_COLOR`. In order to support vertex colors in workbench the current texture/solid shading structure is migrated to a primary shaders and fallback shaders. Fix: T57000 Reviewers: brecht, fclem Differential Revision: https://developer.blender.org/D4694
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-01-29Workbench: Add "Shadow" factor to XrayClément Foucault
This just maintain more parity accross the 2 visuals. Note that this is not "real shadowing" just the facing factor shadowing.
2019-01-11Workbench: Support node texture "closest" interpolation optionClément Foucault
This makes it possible to paint pixel art using the workbench. Cubic interpolation is not supported but could be added if needed.
2018-12-17Workbench: Fix srgb texture not being color managed in texture color modeClément Foucault
2018-12-03Workbench: Reduce VRAM usage depending on modeClément Foucault
We exploit the fact that we are using the metallic workflow for material and pass the metallic parameter instead of the specular color. Pack the front facing bit in the color buffer only for matcap display. Change buffer formats to use less bytes as possible. Also don't request buffers that we won't use. Saved 40MB on 2K screen on StudioLight + Shadows + Specular Lighting. Includes several cleanups.
2018-11-28Workbench: Change Studio lightingClément Foucault
This is in order to have more flexible ligthing presets in the future. The diffuse lighting from hdris was nice but lacked the corresponding specular information. This is an attempt to make it possible to customize the lighting and have a cheap/easy/nice-looking pseudo-PBR workflow. * Add cheap PBR to Workbench with fresnel and better roughness support. This improves the look of the metallic surfaces and is easier to control. * Add ambient light to studio lights settings: just a constant color added to the shading. * Add Smooth option to studio lights settings: This option fakes the effect of making the light bigger making the lighting smoother for this light. Smoother lights gets reflected like a background hdri. * Change default light settings to include the smooth params. * Remove specular highlights from flat shading. (could be added back but how do we make it good looking?) * If specular lighting is disabled, use base color without using metallic. * Include a lot of code simplification/cleanup/confusion fix.
2018-07-31Workbench: Correct ifndef after recent changesSergey Sharybin
Usage of matcap image uniform had different ifdef than definition of that uniform. Assuming the usage was correct, and the definition needed an update. Prevents shader from compilation failure and from aborts in debug builds.
2018-06-29Workbench: Transparent texturesJeroen Bakker
Worknemch now supports transparent textures. As the main engine is a deferred shading only a cutoff is supported (draw or don't draw this pixel)
2018-06-29Workbench: Removed MaterialData UBOJeroen Bakker
Most of the times the materials differ due to the object_id. This was an overhead and resulted in instabilities on Intel graphical cards. This commit will revert the Material Data UBO and replace it with normal uniform.
2018-06-29Merge branch 'master' into blender2.8Campbell Barton
2018-06-21T55570: Moved Texture drawtype as to shading popoverJeroen Bakker
the use of the texture drawtype is limited. so who should we have it this prominent on the screen. By adding it as a shading.color_type option we should save some screenspace.
2018-06-10Workbench: Xray: Make nearest surfaces more clearClément Foucault
By using equation 7 from the paper, we make the surfaces nearest to the viewpoint appear more "opaque". This gives better sense of ordering than the previous weighting function that was really not doing anything.
2018-06-10Workbench: Xray: Optimize and fix implementation.Clément Foucault
There was a method explained in the Weighted Blended Order-Independent Transparency paper to support hardware that does not support per render target blending function. So now only 2 geometry passes are required instead of 3 (one being the outline/depth fill pass). This also fix how the blending is done. There was some premult confusion in the implementation.
2018-06-10Fix T55423: GLSL compilation error Flat + XRayJeroen Bakker
2018-06-09Workbench: Fix material compilation.Clément Foucault
2018-06-09Workbench: Fix xray normal not being normalized.Clément Foucault
2018-06-09Workbench: Matcaps: Fix matcap under perspective.Clément Foucault
This fixes the problem that matcaps have when using a very larg FOV in perspective view. This was because it was stupidly using the normal direction which can not aligned with the view vector under perspective. So to workaround this problem we don't use the normal as is, but compute how much it's facing the camera. This changes how matcaps looks in perspective because they now always use the full range of the matcap (which is expected).
2018-06-09Workbench: Fix incident vector calculation.Clément Foucault
This fixes specular in perspective view.
2018-06-05Workbench: Matcaps T55291Jeroen Bakker
- users can use their own matcaps .config/blender/2.80/datafiles/studiolights/matcap/ folder - upto 100 matcaps can be loaded - color of the matcap is influenced by the color of the material/single color etc. To show the plain matcap use single color at 1.0 - chosing a matcap is at lighting level (flat/studio/matcap) - matcap only possible in solid mode - also works for X-Ray mode As the old matcaps are still in used by the clay engine I didn't remove it yet.
2018-06-03Workbench: Rework hair support.Clément Foucault
Now hairs are shaded properly in workbench and support texturing. I also added a 10% random normal direction per hair to have a bit more variation in the shading. This is hardcoded for now.
2018-06-01X-Ray: Added a slider for the alphaJeroen Bakker
- will not render when set to 0.0 for speed reasons. so when user sets transparency to hide everything the bigger passes will be skipped.
2018-06-01Workbench: Material specific settings for the specularJeroen Bakker
- Uses the roughness setting of the basic eevee material - renamed gloss_mir to roughness - set default of roughness to 0.25 - renamed ray_mirror to metallic - cleaned up material rna (BI mirror struct) - use BLINN phong model - normalize incoming/outgoing specular light - when using camera oriented studiolight, the SolidLight will be used for specular highlights - EXPERIMENT: when in world oriented studiolight only the shadow direction will be used. - change the settings of the internal light to make scenes more readable
2018-05-30Removed Object color from workbench. Added Highlights to FLAT shading.Jeroen Bakker
2018-05-30Workbench: Specular HighlightsJeroen Bakker
Added specular highlights for: - Solid studio shading - Texture studio shading
2018-05-24Workbench: define to enable/disable revealage buffer.Jeroen Bakker
2018-05-24Workbench: Revealage bufferJeroen Bakker
2018-05-23Workbench: See throughJeroen Bakker
Unmultiplied the final color during compositing. Same as the revealage buffer would do Also use the DRW_STATE_ADDITION_FULL as it is aware of premultiplied colors
2018-05-22Workbench: SeeThroughJeroen Bakker
added a fresnel effect TODO: solve memory leak
2018-05-22Workbench: SeeThrough draw optionJeroen Bakker
Option to see through all meshes (transparency) Works for OB_SOLID and OB_TEXTURED. Does not work for V3D_SHADING_SHADOW. TODO: Fresnel effect