Commit Graph

2412 Commits

Author SHA1 Message Date
Clément Foucault
f877022956 Fix T64363 Eevee: Texture coordinates node turns material color to pink
Sorry for that :(
2019-05-09 12:46:29 +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
c995eb1f9f Cleanup: GPUShader: Remove unused edge fancy shader 2019-05-08 23:28:07 +02:00
Clément Foucault
9489fea07b GPU: Refactor some shader for a bit more efficiency
Remove matrices multiplication and use more correct codestyle for variables
2019-05-08 23:28:07 +02:00
Clément Foucault
7ec7888ff3 Eevee: Fix Tangent vectors using NormalMatrix and make them world space
Making them world space by default remove a lot of legacy conversion from
viewspace.
2019-05-08 23:28:06 +02:00
Clément Foucault
f2f62b184c DRW: Remove WorldNormalMatrix 2019-05-08 20:13:32 +02:00
Clément Foucault
7e380fd46a GPU: Remove GPU_INVERSE_NORMAL_MATRIX
The end goal for this is to lower the number of needed matrices.

This also cleanup some uneeded transformation.
2019-05-08 20:13:32 +02:00
Clément Foucault
3d759e2b09 Cleanup: DRW/GPU: Remove eye vector uniform 2019-05-08 17:52:49 +02:00
Clément Foucault
cca941f614 Cleanup: GPUShader: Use switch instead of ifs 2019-05-08 17:52:48 +02:00
Clément Foucault
1ae2385106 GPUViewport: Fix possible hash colision with enabled engines
Also fix engine data validation that was not previously not working.
2019-05-08 17:49:28 +02:00
Clément Foucault
820a64b9e5 DRW: Replace BLI_mempool by BLI_memblock
This remove a avoid the big overhead present in BLI_mempool when it is
cleared.
2019-05-08 17:49:28 +02:00
Clément Foucault
bd340a0e1f Cleanup: GPUMaterial remove unused struct members 2019-05-06 22:33:05 +02:00
Campbell Barton
ab9731ccea Cleanup: fallthrough attribute warning
Fall-through without label or default after it.
2019-05-05 12:34:24 +10:00
mano-wii
d32a103d53 Fix T63789: Precision issues in glsl noise texture
There is a significant precision loss when converting large float values to int.
2019-05-04 16:46:02 -03:00
Clément Foucault
e474549da5 Cleanup: GPU_buffers: Remove obsolete debug drawing 2019-05-04 14:11:04 +02:00
Clément Foucault
1d8ed6dcd7 GPUBuffers: Save / expose material index per buffers 2019-05-04 14:11:04 +02:00
Clément Foucault
7f366c048a Fix T63435 Incorrect fresnel and normals for hair strands on EEVEE 2019-05-02 14:32:41 +02:00
Campbell Barton
909665a0d4 ClangFormat: run with ReflowComments on source/
Prepare for enabling ReflowComments.
2019-05-01 11:13:14 +10:00
Clément Foucault
2445d5abc2 Fix T63393 Eevee: Specular Shader's Clear Coat does not function 2019-04-30 14:07:22 +02:00
Campbell Barton
14897fb653 Cleanup: spelling 2019-04-29 14:14:14 +10:00
Clément Foucault
d2f1705b15 Fix T63936 GPUSelect: Read depth in the end
fix T63936 introduced  in 86914e7133.

Reviewers: fclem

Reviewed By: fclem

Tags: #bf_blender

Maniphest Tasks: T63936

Differential Revision: https://developer.blender.org/D4750
2019-04-27 20:37:29 +02:00
Clément Foucault
1fa7d51f34 Eevee: Noise Texture: try to fix floating point accuracy issue
Cycles check for infinity and return 0.0 otherwise.
2019-04-26 18:37:24 +02:00
Clément Foucault
86914e7133 GPUSelect: Don't read depth on every draw
If the draw uses the same id as the previous draw, there is no need to read the depth
buffer at this point, avoiding a CPU-GPU sync bubble.

Fixes T62511 Selection is significantly slower in production scenes.
With this patch glReadPixels is not the bottleneck. Regular drawing Is still very
slow so I would suggest fixing the regular drawing first before trying to
improve the selection algorithm.
2019-04-26 15:33:49 +02:00
Brecht Van Lommel
7e18aa4250 Fix T63524: crash selecting an object in texture coordinate node
Using mat4 in a uniform buffer object was not properly supported.
2019-04-25 12:13:26 +02:00
Campbell Barton
2753959ed7 Cleanup: sort CMake include paths 2019-04-24 14:41:12 +10:00
Clément Foucault
148c0aa0fa Fix T63178 Eevee animation render crash
If image buffer is not loaded and blender attempts to reload it (during
`BKE_image_acquire_ibuf`) over and over for each frame rendered.
When attempting this reload, image_load_image_file is calling
`BKE_image_free_buffers` and tag the Image to the (GPU) image_free_queue
(because this run on the rendering thread).

If the main thread decide to redraw the UI and go through `GPU_free_unused_buffers` they all get deleted and if that happens before the rendering thread use them ... segfault.

If I replace the environment textures with correct ones (the file does not seems to contain them), there is no crash when rendering.

I used a list of GPUTexture from blender Image to increase and decrease the
reference counter correctly.

This add very little memory and computation overhead.
2019-04-23 20:35:02 +02:00
Clément Foucault
d10205c1a7 GPUBuffers: Fix wrong assert
For good this time...

forgot to commit it in the previous commit rBedde48f57844.
2019-04-23 20:35:02 +02:00
Jeroen Bakker
ee701baff8 Workbench: Support Active Vertex Color
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-23 12:05:33 +02:00
Campbell Barton
14a49950ff Cleanup: style, use braces for gpu 2019-04-22 19:48:17 +10:00
Campbell Barton
c5862e0a06 Cleanup: comments (long lines) in gpu 2019-04-22 06:30:08 +10:00
Campbell Barton
bbc5c1e36f Cleanup: quiet extra-semicolon warning 2019-04-20 11:30:19 +02:00
Campbell Barton
333cdbb410 Cleanup: comment blocks 2019-04-18 07:59:28 +02:00
Clément Foucault
edde48f578 GPUBuffers: Remove wrong assert
The assert was not true if the pbvh node had no triangle.

Also update the comment to reflect that.
2019-04-17 14:32:18 +02:00
Campbell Barton
600f12002b ClangFormat: adjust '#if 0' to fix gpu_buffers.c indent 2019-04-17 08:58:35 +02:00
Campbell Barton
a54bdd76cb ClangFormat: format '#if 0' code
Previous cleanups didn't account for space after '#'.
2019-04-17 08:52:59 +02:00
Campbell Barton
41d4a19865 ClangFormat: format '#if 0' code in source/ 2019-04-17 08:24:14 +02:00
Campbell Barton
e12c08e8d1 ClangFormat: apply to source, most of intern
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-04-17 06:21:24 +02:00
Campbell Barton
dbc058301b Cleanup: trailing commas 2019-04-16 16:40:47 +02:00
Bastien Montagne
b53728b1d2 Fix broken build when using system Glew on linux. 2019-04-16 14:44:14 +02:00
Campbell Barton
5498e7f193 CMake: add library deps to CMakeLists.txt
Tested to work on Linux and macOS.

This will be enabled once all platforms are verified.

See D4684
2019-04-16 06:20:52 +02:00
Campbell Barton
47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Campbell Barton
eff8cc9ccc Cleanup: doxy comments
Use doxy references to function and enums,
also correct some names which became out of sync.
2019-04-14 10:48:42 +02:00
Campbell Barton
a358f6bb69 Cleanup: use STR_ELEM macro 2019-04-10 09:36:06 +02:00
Campbell Barton
b9eac0bb44 Cleanup: spelling 2019-04-10 08:40:49 +02:00
Brecht Van Lommel
cc73d59ad5 Fix T59014: black/corrupted viewport with Intel HD on Windows 7/8.
Work around bug in the Intel driver:
https://software.intel.com/en-us/forums/graphics-driver-bug-reporting/topic/550740
2019-04-06 14:26:23 +02:00
Clément Foucault
542725d3e9 GPU: Fix typo 2019-04-05 21:15:25 +02:00
Clément Foucault
e559074c4e Fix T61035 Draw manager crash opening file with curves
Move free callback call to GPU_batch_discard to prevent the crash.

The issue was that clearing can happen after referencing to an instance
buffer and that's perfectly legal.
2019-04-05 17:48:56 +02:00
Jeroen Bakker
df99c54b5b EEVEE: Fix compilation
Introduced by f0d6879f5c
2019-04-05 15:03:43 +02:00
Jeroen Bakker
6de0da70de GPU not able to allocate texture
In the case of the report a GL_PROXY_TEXTURE_2D_ARRAY of 2509x2509x1 failed to be allocated.
This is a work around as the GL_PROXY_TEXTURE_* is not reliable.

Reviewed By: brecht, fclem

Maniphest Tasks: T63223

Differential Revision: https://developer.blender.org/D4651
2019-04-05 14:40:54 +02:00