Commit Graph

3222 Commits

Author SHA1 Message Date
Clément Foucault
6bb7eb1706 Eevee: Fix Auto Tangent not working if active UV layer is greater than 3 2019-05-14 12:39:18 +02:00
Antonioya
254b1a4294 Fix T64441: GPencil textures weird rotation
New option to disable the follow drawing path. Before it had only a switch property, now there is a list of options.

Modes:

Path: Follows drawing stroke and rotate with object.
Object: Only follows object rotation.
None: Don't rotate.
2019-05-14 11:59:19 +02:00
Clément Foucault
20421ef952 Cleanup: DRW: Move ModelMatrix declaration to common_view_lib 2019-05-14 10:57:04 +02:00
Clément Foucault
016fc7f0c2 GPUVertexFormat: Reduce size of structs
With this patch, the size of GPUVertFormat goes from 1240 to 388.
2019-05-14 10:57:04 +02:00
Clément Foucault
72a5e3f61a Cleanup: DRW: Add and use DRW_shgroup_uniform_vec2_copy 2019-05-14 10:57:04 +02:00
Clément Foucault
92b4e96afe Cleanup: DRW: Remove unused Uniform types 2019-05-14 10:57:04 +02:00
Clément Foucault
be5192bbb9 Cleanup: DRW: Remove uneeded _add suffix from DRW_shgroup_call_add 2019-05-14 10:57:03 +02:00
Clément Foucault
8bc8a62c57 DRW: Refactor: Use DRWCall to accumulate per instance attributes
This is a big change that cleanup a lot of confusing code.
- The instancing/batching data buffer distribution in draw_instance_data.c.
- The selection & drawing code in draw_manager_exec.c
- Prety much every non-meshes object drawing (object_mode.c).

Most of the changes are just renaming but there still a chance a typo might
have sneek through.

The Batching/Instancing Shading groups are replace by DRWCallBuffers. This
is cleaner and conceptually more in line with what a DRWShadingGroup should
be.

There is still some little confusion in draw_common.c where some function
takes shgroup as input and some don't.
2019-05-14 10:57:03 +02:00
Clément Foucault
e5349f14eb BLI_memblock: Add more options
- Use int instead of uint for safety and less conversions.
- Add free callback
- Add cleared alloc option
2019-05-14 10:57:03 +02:00
Clément Foucault
0e5da91f0a Cleanup: Remove DRWCallType
This simplify the rendering logic.
2019-05-14 10:57:03 +02:00
Clément Foucault
ed3f05aca9 DRW: Fix threading hazard when rendering and using auto depth 2019-05-14 10:57:03 +02:00
Clément Foucault
e0420097e3 Cleanup: DRW: Remove unused functions 2019-05-14 10:57:03 +02:00
Clément Foucault
754ecd61aa DRW: Change Procedural function to use a GPUBatch
This is in order to have VAO handled by thoses batches instead of using a
common VAO. Even if the VAO has no importance in these case using a batch
will help when transitioning to Vulkan.
2019-05-14 10:57:03 +02:00
Clément Foucault
8406fabc87 Eevee: Replace DRW_shgroup_empty_tri_batch_create by procedural calls 2019-05-14 10:57:03 +02:00
Clément Foucault
201ebc78e8 Mesh Batch Cache: Fix use of uninitialized variable 2019-05-14 10:57:03 +02:00
Clément Foucault
b27492d078 DRW: Make Instance count not a pointer
Goal is still to simplify the draw manager.
2019-05-14 10:57:03 +02:00
Clément Foucault
cf8109d2aa Cleanup: Eevee: Make planar downsampling not use instance drawing 2019-05-14 10:57:03 +02:00
Clément Foucault
ad0e95688d Cleanup: DRW: Remove pointers to materials 2019-05-14 10:57:03 +02:00
Clément Foucault
2d28df783a GPU: Move Material index to nodetree evaluation
This removes the need to pass the Material* all over the place in the draw
manager. Cleanup comming right after.
2019-05-14 10:57:03 +02:00
Clément Foucault
642c8010b2 DRW: Remove ModelViewMatrix and ModelViewMatrixInverse 2019-05-14 10:57:03 +02:00
Brecht Van Lommel
21854575a4 Cycles/Eevee: unify light strength and color
Cycles lights now use strength and color properties of the light outside
of the shading nodes, just like Eevee. The shading nodes then act as a
multiplier on this, and become optional unless textures, fallof or other
effects are desired.

Backwards compatibility is not exact, as we can't be sure which renderer
the .blend was designed for or even if it was designed for a single one.

If the render engine in the active scene is set to Cycles, lights are
converted to ensure overall light strength remains the same, and removing
unnecessary shader node setups that only included a single emission node.

If the engine is set to Eevee, we increase strength to remove the automatic
100x multiplier that was there to match Cycles.

Differential Revision: https://developer.blender.org/D4588
2019-05-13 15:56:10 +02:00
Brecht Van Lommel
7ad802cf3a Cycles/Eevee: unified and improved texture image color space handling
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-13 15:56:10 +02:00
Clément Foucault
f28b4c304c DRW: Fix previous commit
PS: I hate my life
2019-05-11 13:16:57 +02:00
Clément Foucault
3cac530ba6 Fix T64464 App crashes when navigating between UV Editor and Viewport 2019-05-11 13:10:43 +02:00
Antonioya
46f5005c0d GPencil: Apply FBO changes to AA macros
Apply same change done to fix the task T64373
2019-05-11 08:35:03 +02:00
Clément Foucault
de9d846353 Fix T64137 Empty Images flickering graphics when "Auto Depth" is enabled
Also fix T64373 Grid intensity increases in Ortographic when use Circle
Select in GPencil Edit mode
2019-05-11 00:21:35 +02:00
Clément Foucault
7a3833ed23 Fix T64399 Crash when trying to enter edit mode on instanced objects 2019-05-10 16:51:19 +02:00
Clément Foucault
1456b41306 Fix T64420 Weight Paint colours not visible 2019-05-10 15:03:18 +02:00
Clément Foucault
632e0725d2 Overlays: Use common_view_lib.glsl
This removes ModelViewProjectionMatrix usage
2019-05-10 12:25:16 +02:00
Clément Foucault
6006f86e07 Workbench: Use common_view_lib.glsl
This removes ModelViewProjectionMatrix usage
2019-05-10 12:25:12 +02:00
Clément Foucault
7f87e6e18f GPencil: Use common_view_lib.glsl 2019-05-10 12:14:41 +02:00
Clément Foucault
0d8ab0eac6 DRW: Remove ModelViewMatrix Usage 2019-05-10 12:14:41 +02:00
Clément Foucault
a298dde5d7 Eevee: Update matrices operations to not use combined matrices 2019-05-10 12:14:41 +02:00
Clément Foucault
fdddea676d Cleanup: DRW: Renaming of glsl utility macros 2019-05-10 12:14:41 +02:00
Antonioya
930ae8e3c4 GPencil: Lock rotation of textures
By default the texture is locked and only the box is aligned when Follow Drawing Path is enabled.

Before, when the Follow was disabled, the texture was always aligned to top and it was not affected by object rotation. Now, the texture always is rotated with object rotation.
2019-05-09 19:53:25 +02:00
Jeroen Bakker
6ef48b1318 DrawManager/GreasePencil: Select Correct ViewLayer
The DrawManager assumed that the first render layer was the render layer
where GP needed to render on. In viewport this is always the case as we
only have a single view layer. When rendering this can be multiple when
multiple layers are rendered and composited in the compositor.

In stead of the assumption that the first render layer is the render
layer we need to draw on, we search for the render layer with the same
name as the viewlayer.

Reviewed By: fclem, brecht, antoniov

Maniphest Tasks: T63099

Differential Revision: https://developer.blender.org/D4818
2019-05-09 15:13:11 +02:00
Jeroen Bakker
0764cfe3de Workbench: Viewport AA Preferences
In recent changes the viewport_quality setting was not working what
users expected. This change will separate the anti-aliasing method that
is being used.

We now have three settings:

* scene.display.render_aa: Will be used during `Render Image`.
* scene.display.viewport_aa: Will be used during `Viewport Render Image`.
* userpref.viewport_aa: Will be used in the 3d view.

The viewport_quality setting has been replaced by the viewport_aa
setting as it was the only thing in currently controlled.

Reviewed By: brecht

Maniphest Tasks: T64132

Differential Revision: https://developer.blender.org/D4828
2019-05-09 14:45:45 +02:00
Clément Foucault
54ec0559c8 Fix T64384 : Crash when switching to wireframe on tree_creature blend
Was missing NULL pointer check
2019-05-09 14:37:01 +02:00
Campbell Barton
3f37787c80 UI: rename Look Dev 'Ball' to 'Sphere'
D4813 by @Gvgeo
2019-05-09 21:37:20 +10:00
Jeroen Bakker
8342a124c4 DepsGraph: Multi ViewLayer Selection
When using multiple viewlayers and switching between them the selection
gets buggy. The reason for this is that the select_id is updated based
on the index in the viewlayer. This makes the select_id not unique as
objects might be shared or not shared at all.

This fix will update the select_id on all objects in main. This will be triggered in all the selection operators.

Reviewed By: sergey, brecht

Maniphest Tasks: T55617

Differential Revision: https://developer.blender.org/D4824
2019-05-09 13:27:23 +02:00
Clément Foucault
209c01a6ba Fix T64329 Crash when switching to Texture Paint 2019-05-09 12:22:12 +02:00
Clément Foucault
d2520511d2 3D Grid: Use View UBO & small cleanup 2019-05-09 12:22:12 +02:00
Clément Foucault
895c41ec5d Fix Crash with armature using custom shapes 2019-05-09 11:35:52 +02:00
Clément Foucault
c74e9273a9 Fix T64366 DRW: Crash opening Mr Elephant scene since recent commit 2019-05-09 11:16:54 +02:00
Clément Foucault
a951aa5f62 Fix T64296 Z-axis overlay vanishes at scene origin in 3D Viewport
Grid shader was still using deprecated eye vector.
2019-05-09 10:59:25 +02:00
Clément Foucault
60aede44ba Cleanup: DRW: Remove DRW_pass_free 2019-05-09 01:08:17 +02:00
Clément Foucault
e2d04229c3 DRW: Remove support for NormalMatrix 2019-05-09 00:27:11 +02:00
Clément Foucault
1a99b6fc7e Fix T64158 Eevee: Mixed SSS shader becomes brighter and brighter
This change the logic a bit, when 2 bsdfs using SSS are mixed, we use the
one with the biggest radius (on a per pixel basis).

This change from previous behavior which was to select input 1 if radius
was greater than 0.
2019-05-09 00:10:29 +02:00
Clément Foucault
c9537ee5c3 Overlay: Remove use of NormalMatrix 2019-05-08 23:28:06 +02:00
Clément Foucault
733811330c Workbench: Use common_view_lib and remove NormalMatrix usage
This is in order to lower the number of matrices to compute.
2019-05-08 22:08:20 +02:00