Commit Graph

2066 Commits

Author SHA1 Message Date
Clément Foucault
48e661e05d GPUMaterial: Fix assert when shader failed to compile. 2018-08-01 22:08:36 +02:00
Clément Foucault
e8dd5e5cc6 GPUMaterial: Make Mapping node use UBO storage
This means tweaking parameter is now interactive and does not need to
recompile the shaders.
2018-08-01 22:08:36 +02:00
Clément Foucault
ad64cb6344 GPUMaterial: Make Localize tree live longer
This is in order to reference the localized node->storage when populating
the UBO data.
2018-08-01 22:08:36 +02:00
Clément Foucault
4510f30026 GPUMaterial: Fix nearest sampling
texelFetch return vec4(0.0) if the target pixel is outside the texture
rect. So we mimic the default repeate mode that we have for linear
interpolation.

Fix T56156 Mapping-Node doesn't work
2018-08-01 22:08:36 +02:00
Clément Foucault
c6f55fb0db GPUUniformBuffer: Fix bad memcpy error catched by asan
We need to copy the size of the gputype not the padded type.
2018-08-01 22:08:36 +02:00
Clément Foucault
7e0eb0d071 GPUFrameBuffer: Put active framebuffer in GPUContext
instead of being ThreadLocal and leading to incorrect usage.

We still enforce no framebuffer when changing context. We can lift this
restriction later.
2018-07-31 18:21:23 +02:00
Clément Foucault
3ecba657bb GPU: Replace malloc/calloc/realloc/free with MEM_* counterpart 2018-07-31 18:21:23 +02:00
Campbell Barton
ad5b611953 Cleanup: style 2018-07-31 19:21:04 +10:00
Antonioya
66da2f537a New Grease Pencil object for 2D animation
This commit merge the full development done in greasepencil-object branch and include mainly the following features.

- New grease pencil object.
- New drawing engine.
- New grease pencil modes Draw/Sculpt/Edit and Weight Paint.
- New brushes for grease pencil.
- New modifiers for grease pencil.
- New shaders FX.
- New material system (replace old palettes and colors).
- Split of annotations (old grease pencil) and new grease pencil object.
- UI adapted to blender 2.8.

You can get more info here:

https://code.blender.org/2017/12/drawing-2d-animation-in-blender-2-8/
https://code.blender.org/2018/07/grease-pencil-status-update/

This is the result of nearly two years of development and I want thanks firstly the other members of the grease pencil team: Daniel M. Lara, Matias Mendiola and Joshua Leung for their support, ideas and to keep working in the project all the time, without them this project had been impossible.

Also, I want thanks other Blender developers for their help, advices and to be there always to help me, and specially to Clément Foucault, Dalai Felinto, Pablo Vázquez and Campbell Barton.
2018-07-31 10:50:43 +02:00
Clément Foucault
0f97718c10 DRW: Add option to only resolve framebuffer colors without depth test 2018-07-30 14:18:55 +02:00
Clément Foucault
4875958083 Cleanup: Remove occurances of GPULamp 2018-07-27 18:12:02 +02:00
Clément Foucault
bdbc6fafc0 GPUTexture: Fix wrong texture size check 2018-07-27 17:51:26 +02:00
Brecht Van Lommel
0d20207771 Fix GPU build error after recent commit. 2018-07-27 14:17:37 +02:00
Clément Foucault
141e94f87f Fix T55888: Eevee: crash when shadow cube size is > 512px
Note that this was only reported to happen on AMD GPU + windows.
2018-07-27 13:56:07 +02:00
Clément Foucault
f07140940c Eevee: Principled: Fix Subsurface input behaviour
Match Cycles behaviour of scalling the SSS radius and don't interpolate
between diffuse and SSS result.
2018-07-21 18:15:31 +02:00
Clément Foucault
4609205a3f GPUMaterial: Cleanup unused headers 2018-07-20 20:06:39 +02:00
Clément Foucault
28fa79219d GPUMaterial: Texture Node: Add support for Cubic filtering
Like in cycles it's a bit more slower than linear but it's smoother.

Works for all projection type.
2018-07-20 19:17:15 +02:00
Clément Foucault
26b6b5871e GPUMaterial: Texture Node: support for nearest (closest) filtering method
Add placeholder for cubic and smart filtering for now.
2018-07-20 19:16:48 +02:00
Clément Foucault
e7d8908f14 GPUMaterial: Optimize and fix blending in box mapping
Blending was done in srgb space and was not matching cycles.

Optimized by using less branches and more vector operations.
2018-07-20 19:16:48 +02:00
Brecht Van Lommel
4a79b46b9c Fix build error with release + debug info build. 2018-07-20 13:35:08 +02:00
Clément Foucault
5037dd8abd GPU: Add GC to FBOs and UBOs and centralize all GCs
GPUFrameBuffers were being free when no context was attached or in the
wrong gl context. This make sure this does not happen again.

You can now safely free any gl resource from any thread (well as long as
it's not used anymore!).
2018-07-19 16:13:15 +02:00
Campbell Barton
9df1e54079 Cleanup: style 2018-07-19 16:06:37 +10:00
Campbell Barton
428743a9b0 Cleanup: style for GPU module 2018-07-18 23:10:31 +10:00
Clément Foucault
f882df9e0f GPU: Fix build error on Mac and Windows. 2018-07-18 14:58:56 +02:00
Clément Foucault
8cd7828792 GWN: Port to GPU module: Replace GWN prefix by GPU 2018-07-18 11:49:15 +02:00
Clément Foucault
247ad2034d GWN: Port to GPU module: Move files to GPU
This does not include all the struct and type renaming. Only files were
renamed.

gwn_batch.c/h was fusioned with GPU_batch.c/h
gwn_immediate.c/h was fusioned with GPU_immediate.c/h
gwn_imm_util.c/h was fusioned with GPU_immediate_util.c/h
2018-07-18 00:17:57 +02:00
Clément Foucault
7a693626d6 Smoke: Port display to Workbench + object mode
This does not fix the smokesim. It only port the drawing method.

The Object mode engine is in charge of rendering the velocity debugging.

Things left to do:
- Flame rendering.
- Color Ramp coloring of volume data.
- View facing slicing (for now it's only doing sampling starting from the
  volume bounds which gives a squarish look)
- Add option to enable dithering (currently on by default.
2018-07-16 20:08:09 +02:00
Campbell Barton
57ab7daa2a GPU_matrix: use Blender's naming conventions
Thanks to @sergey for review
2018-07-15 15:34:13 +02:00
Campbell Barton
09431033e9 Cleanup: split GPU_batch
Split out presets and utilities for creating batches.
These functions are quite specialized and not related to typical usage.
2018-07-15 10:51:49 +02:00
Brecht Van Lommel
680994643c Merge branch 'master' into blender2.8 2018-07-15 00:54:12 +02:00
charlie
83a4e1aaf9 Cycles: add voronoi features and distance settings from Blender.
Features to get the 2nd, 3rd, 4th closest point instead of the closest, and
various distance metrics. No viewport/Eevee support yet.

Patch by Michel Anders, Charlie Jolly and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D3503
2018-07-15 00:45:42 +02:00
Campbell Barton
5a716701e8 GPU_batch: fix error w/ interior line removal
Caused glitch w/ navigation icons showing inner lines.
2018-07-14 15:59:47 +02:00
Campbell Barton
c7c7bfae75 Merge branch 'master' into blender2.8 2018-07-13 12:22:21 +02:00
Charlie Jolly
30bffb5a3a Nodes: add sqrt, ceil, floor and fract to math nodes.
This works for Cycles, Eevee, texture nodes and compositing. It helps to
reduce the number of math nodes required in various node setups.

Differential Revision: https://developer.blender.org/D3537
2018-07-13 11:00:10 +02:00
Brecht Van Lommel
dd7a727910 Fix accidentally removed particle function in GLSL, still not supported though. 2018-07-10 16:30:17 +02:00
Clément Foucault
dfd192ce41 GPUTexture: Refactor of texture creation & new feature
- Texture creation now requires explicit data type.
- GPU_texture_add_mipmap enable explicit mipmap upload.
- GPU_texture_get_mipmap_size can be used to get the size of a mipmap level
  of an existing GPUTexture
- GPU_texture_read let you read back data from a gpu texture.
2018-07-10 15:31:34 +02:00
Campbell Barton
9fb9125184 Cleanup: rename 'ct' to 'len' for gpu 2018-07-08 13:14:49 +02:00
Campbell Barton
804205babe Cleanup: rename 'ct' to 'len' for gawain 2018-07-08 13:05:41 +02:00
Campbell Barton
6d72d3c862 Cleanup: abbreviate unsigned types (editors, wm) 2018-07-08 12:49:36 +02:00
Brecht Van Lommel
d8223468fe GPU: avoid unnecessary multiple nodetree localize and output finding. 2018-07-05 17:51:58 +02:00
Campbell Barton
9f80429ab6 Cleanup: use _f, _i suffix for GPU state API 2018-07-02 18:27:05 +02:00
Clément Foucault
ad5a20efce Commit D3494 : Compiled shader lookup fix
Authored by Pavel Rudko (PavelRudko) on Thu, Jun 21, 10:41 AM.

Original description:

I've encounterd into a problem with blender 2.8.
See the example screenshot (scene, shader setup). For some materials it's not enough to calculate hash based on fragment code and defines. In some cases attribute names may change. And if we change uv set name, for example, vertex shader is not recompiled, and another attribute name inside it is used.
2018-07-02 11:05:48 +02:00
Campbell Barton
b4998548ab Cleanup: use '_len' suffix for line stipple 2018-07-01 08:42:16 +02:00
Campbell Barton
9bd0c63382 Merge branch 'master' into blender2.8 2018-06-29 08:05:38 +02:00
Campbell Barton
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
Brecht Van Lommel
9b050b736b Fix assert to due missing GPU blend mode. 2018-06-28 13:46:30 +02:00
Campbell Barton
8777b33699 Fix missing blend mode in recent OpenGL refactor 2018-06-28 08:49:30 +02:00
Campbell Barton
31f0c9182e Cleanup: style 2018-06-27 22:29:59 +02:00
Ray Molenkamp
6f2c9ea3e1 bf_gpu: Add GPU_state module.
This has wrappers for the most common gl* functions in the codebase, and is in preparation for D3502

Reviewers: brecht, fclem

Differential Revision: https://developer.blender.org/D3501
2018-06-26 15:17:31 -06:00
Bastien Montagne
c795505a2c Cleanup: dyntopo sculpt draw update: use same BM_face_as_array_vert_tri for indexbuf generation.
It's cleaner, and actually assert that BMFace is a triangle. Same code
as when generating vertexbuf for flat shading!
2018-06-26 11:43:17 +02:00