Commit Graph

56192 Commits

Author SHA1 Message Date
Luca Rood
db71df4f3f Fix world not updating when changing node links
When changing node links for the world material, a redraw of the
viewport was not being triggered.
2017-06-29 12:28:25 +02:00
Campbell Barton
fd3589e4c9 DwM: optimize mesh batch conversion
- Replace GWN_vertbuf_attr_set with Gwn_VertBufRaw & GWN_vertbuf_raw_step
  to avoid intermediate copy.
- Avoid extra conversion step with: float[3] -> short[3] -> Gwn_PackedNormal.
  We can skip the short[3].

Gives approx 6% speedup here.
2017-06-29 20:11:16 +10:00
Campbell Barton
2343dcf0d2 Gawain: Use common prefix for packed normal 2017-06-29 18:54:23 +10:00
Bastien Montagne
2113dbb013 Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/space_outliner/outliner_select.c
2017-06-29 10:11:17 +02:00
Bastien Montagne
a57a7975a1 Fix T51926: Selecting pose icon under expanded group in outliner causes crash.
Cannot switch uninstantiated armature to Pose mode...
2017-06-29 10:09:58 +02:00
Campbell Barton
10c887762a DwM: no need to calculate face normal 2017-06-29 15:52:08 +10:00
Campbell Barton
abd9d50faa Cleanup: quiet negative shift warning 2017-06-29 15:34:50 +10:00
Campbell Barton
f6bb3262f1 DwM: add CD_AUTO_FROM_NAME for mesh conversion 2017-06-29 15:23:47 +10:00
Campbell Barton
15079b0b43 Fix crash & performance regression w/ base lookup
Was doing O(n^2) list lookups with blender-render drawing & transform.
Also missing NULL checks would crash.

Use Object.base_flag (already used by new draw manager in places)
to avoid list lookup.

Note, transform still performs inefficient lookups,
but only for selected parents (like 2.7x), not all parents.
2017-06-29 12:19:22 +10:00
Clément Foucault
e14fd19105 Eevee: Add Initial support for Principle BRDF.
Lots of things not working yet but it's comming.
2017-06-29 01:47:59 +02:00
Clément Foucault
8d57f4e3c6 Eevee: Remove ShadingData struct.
That was a bad idea after all.
2017-06-29 01:47:59 +02:00
Campbell Barton
2117334737 Fix assert calculating tangents with no faces 2017-06-29 07:57:23 +10:00
Clément Foucault
a1a40bfe70 GPUTexture : Un-clamp float rect datas.
We do not need it anymore because we do not use glu anymore. And we need full range for HDRI Lighting.
2017-06-28 22:26:44 +02:00
Clément Foucault
beb375cdb2 GPU_codegen: Fix geometry shader. 2017-06-28 21:28:24 +02:00
Clément Foucault
ada6e720f9 GPU_codegen: Add support for passing attributes through the geometry stage.
Should fix some issues with missing attributes in Eevee.
2017-06-28 21:05:43 +02:00
Bastien Montagne
b5696f2799 Fix node UI not using translation context correctly.
Now that some node types may have custom context, we need to handle that
in the (convoluted :| ) UI code of nodes as well.

Reported in T43295 by Gabriel Gazzán (@gab3d), thanks.
2017-06-28 20:50:21 +02:00
Clément Foucault
26b699a105 Eevee: Fix shader linking error. 2017-06-28 18:28:52 +02:00
Clément Foucault
b6a2d255c3 Eevee: Fix Shadow Map bug: fix T51924 2017-06-28 17:21:57 +02:00
Clément Foucault
03b915d711 Eevee: Fix Shader compilation on certain driver. 2017-06-28 16:51:31 +02:00
Clément Foucault
6d0dbd3169 Probe: Irradiance Volume: Fix default clip start. 2017-06-28 16:32:08 +02:00
Clément Foucault
1982e724f4 Eevee: Refactor of shading code to be more modular.
This will enable creating shading models more easily.
2017-06-28 16:32:08 +02:00
Luca Rood
0782c9f8dc Fix T51920: Invalidate draw cache when changing object origin 2017-06-28 14:58:25 +02:00
Bastien Montagne
16eca8f47e Fix own really stupid mistake/typo in previous commit... 2017-06-28 13:21:04 +02:00
Bastien Montagne
2c0ee61f6d Fix T51900: Crash after pressing "F" multiple times.
`BMO_iter_as_array()` may fill less items than requested in given array,
so we have to update number of items to work on from its returned value,
otherwise code might try to use uninitialized memory.
2017-06-28 10:53:52 +02:00
Campbell Barton
4a061a87e6 DwM: mesh data now only creates data thats used
Read from the GPUMaterial to find custom-data layers used for drawing.

This resolves problem where having UV's would always calculate tangents
causing noticeable slow down compared to 2.7x.
2017-06-28 13:44:28 +10:00
Campbell Barton
e78c0840f2 DwM: create eevee materials before the mesh
To know which custom-data layers will be needed in the mesh.

No functional change yet.
2017-06-28 13:36:55 +10:00
Campbell Barton
fc3d0da2fd DWM: Fix own error checking wrong layer type
Would calculate all tangents for every UV layer.
2017-06-28 11:39:05 +10:00
Campbell Barton
87dd9c31a0 GPU: split GPU_material_from_nodetree in two
Add GPU_material_from_nodetree_find to avoid having to construct other
arguments which won't be used in the case the material is exists.
2017-06-28 10:59:25 +10:00
Campbell Barton
037876659f Fix own error removing texface
Setting the name crashed with NULL poly layer.
2017-06-28 10:23:27 +10:00
Campbell Barton
87a95558a0 Fix own error removing texface
Using pointer offsets from different arrays
2017-06-28 10:11:49 +10:00
Campbell Barton
df70e3de63 DWM: separate tangents from UV conversion
Prepare for different number of UV/Tangent layers.
2017-06-28 09:55:40 +10:00
Campbell Barton
dbaa6c2aa2 GPU: GPU_generate_pass_new now takes vertex-attrs
Needed so we can tell which custom-data layers to use from the mesh.
2017-06-28 09:37:44 +10:00
Luca Rood
2ed82d2e6b Fix missing globalsBlock in edit mode latice drawing
This was causing lattice vertices not to be drawn.
2017-06-27 18:40:39 +02:00
Dalai Felinto
f11bcbed9d Fix T51913: Context tab for textures issue
The original code was doing a sanity check to see if existing index was
out of range. However the comparison was wrong.

So if the previous ct->user (active index of texture node) was larger
than then number of available texture nodes + 1 in the other material,
we would never re-set the index to 0.

Bug introduced on c31f74de6b.

There was an early attempt of fixing this (2b2ac5d3cc) but it was just working
by pure, luck. And failing in cases like the one from this bug report.
2017-06-27 16:56:43 +02:00
Luca Rood
d04f30c5d8 Implement weight colors for lattices in draw manager 2017-06-27 15:59:13 +02:00
Clément Foucault
6e83ace809 LightProbes: Change 3d view display shape.
Introduce specific shape for each probe type to easily identify them.
2017-06-27 15:00:14 +02:00
Luca Rood
cbfdd02f2c Fix typo in Eevee hair UV handling 2017-06-27 11:59:22 +02:00
Campbell Barton
bb0e8f1c55 Cleanup: remove unused function 2017-06-27 18:05:44 +10:00
Clément Foucault
c218d4b008 Eevee: Bloom: fix black bloom artifacts. 2017-06-27 05:18:00 +02:00
Campbell Barton
62b1d11613 RNA: update_gpu_tag() to force Batch re-generation 2017-06-27 11:09:30 +10:00
Campbell Barton
e6be5b8a2c Merge branch 'master' into blender2.8 2017-06-27 09:59:36 +10:00
Campbell Barton
03b46f7941 Cleanup: quiet warning
Passing NULL arg when nonnull attr is used.
2017-06-27 07:39:44 +10:00
Campbell Barton
8cc8aad4f9 Scene object iterator: minor optimization
Avoid an extra hash when adding to gset
2017-06-27 07:30:21 +10:00
Clément Foucault
0394c04a7f Eevee: Add Planar reflection blurring.
This method is very cheap and inaccurate. This will fill the gap untill better model is supported.
2017-06-26 21:04:53 +02:00
Antonio Vazquez
daf02baaea Add new DRW_draw_pass_subset function
This function allows to draw only a selected range of shading groups.

This is required for some special situations as grease pencil strokes.
2017-06-26 20:42:58 +02:00
Bastien Montagne
5a1bdf2c3a Add warning that 'purge all' action in Outliner does save to current .blend file.
This is a very important, potentially deadly side-effect of this
operator. If something goes wrong, it can save a broken .blend file.

Ideally we could get rid of that operation anyway, once ID management if
fully renewed, but for now would rather keep it around.

Related to T51902.
2017-06-26 19:00:45 +02:00
Bastien Montagne
d4ca2ec9d5 Fix T51902: Severe problem with relocating linked libraries when using proxies.
Fix is a bit ugly, but cannot think of another solution for now, at
least this **should** not break anything else.

And now I go find myself a very remote, high and lonely mountain, climb
to its top, roar "I hate proxies!" a few times, and relax hearing the echos...
2017-06-26 18:55:30 +02:00
Dalai Felinto
1758330220 Fix viewport rendering with anti-aliasing - workaround
This commit makes the fullsample option for viewport renderings always
on: Render > OpenGL Render Options > Full Sample.

(The UI still allows users to set this, so we will need to revisit this
before 2.8 releases).

Even in computers that can handle MSAA we had issues.
The way Blender gpu_* implementation is handling anti-aliasing is buggy.
For example, in Blender 2.7x if you have depth of field in a viewport
with multi-sampling, the DoF gives us jagged edges.

Since Eevee uses framebuffers for a lot of things, this issue was
leading to very visible buggy render in some computers, and more subtle
inconsistent buggy renders in others (easy to test with the depth of
field in Eevee).
2017-06-26 18:30:21 +02:00
Luca Rood
a48bd0db71 Remove disabled code for freeing shaders on scene update
Some code for freeing shaders on scene updates (because of previous
dependency shaders had on lamps) had been disabled, as it is no longer
required. This removes that code altogether.
2017-06-26 18:16:05 +02:00
Luca Rood
b50839038d Stop object shaders from being updated when changing lamp properties
Object shaders no longer depend on lamp data at compile time, thus they
don't need to be invalidated when lamps change. Disabling shader
recompilation allows fast viewport updates when changing lamp settings.

Note that even though shaders for lamps are currently not being used,
`lamp_changed` is still freeing the lamp shaders, as at some point we
might want to use shaders for lamps...
2017-06-26 17:53:47 +02:00