Commit Graph

59634 Commits

Author SHA1 Message Date
Clément Foucault
dfd8a52cd2 DRW: Change clip planes API.
The draw manager now just set the number of active clip planes. It's now up to the engine to specify the plane equations as uniform/ubo/constant.
2018-03-10 02:18:25 +01:00
Clément Foucault
1b8ba6b8b9 DRW: Add assert for uniform that needs valid data. 2018-03-10 02:18:25 +01:00
Clément Foucault
8444aaaa69 DRW: Put all view-only dependant uniform in a UBO.
This leads to less lookups to the GWNShaderInterface and less uniform upload.

We still keep a legacy path so that Builtin uniforms can still work. We might restrict this path to Builtin shader only in the future.
2018-03-10 02:18:25 +01:00
Clément Foucault
4540bd226d Eevee: Probes: Fix last planar reflections remaining after deletion. 2018-03-10 02:18:25 +01:00
Clément Foucault
13b99b7bbb Eevee: Probes: Add culling for planar probes.
Planar probes that have no influence on pixels in the view are culled.

This greatly improve performance when theses probes are offscreen.
2018-03-10 02:18:25 +01:00
Clément Foucault
7c31edb385 DRW: Culling: Expose & Add culling functions to engines.
This way engines can do preemptive culling by themselves.
2018-03-10 02:18:25 +01:00
Clément Foucault
4402633e33 BoundBox: Fix wrong max in BKE_boundbox_alloc_unit. 2018-03-10 02:18:25 +01:00
Clément Foucault
c962f7ef77 Eevee: Render: Add cancel support
You can now cancel your renders that are too long. This will still output the current status of the render. For example if you cancel at 50% rendering progress, you will have a render result with only half the render samples.
2018-03-10 02:18:25 +01:00
Clément Foucault
f043365c38 DRW: Culling: Fix precision error.
This was triggering the BLI_assert(fac >= 0.0f);.

Clamp fac to ensure correct value for release builds.
2018-03-10 02:18:25 +01:00
Clément Foucault
9cd09fee6a Eevee: Planar: Add transparent objects.
The ordering is left broken for the viewport as this can be quite heavy.
Only do it if doing a render.
2018-03-10 02:18:25 +01:00
Clément Foucault
e697c1da42 Eevee: Planar Probe: Add supersampling jitter.
This also fix a bug with the probe debug display when there was more than 2 probes. ped->probe_id was equal to 0 for all planar probes until the next frame. Resulting in all planar data debug to show probe 0.
2018-03-10 02:18:25 +01:00
Antonio Vazquez
c3d7be150b Cleanup: iterator macros
This line was missing in previous commit
2018-03-09 11:00:54 +01:00
Campbell Barton
d3e14c2e2f Manipulator: disable UV widget, following prefs 2018-03-09 20:44:41 +11:00
Campbell Barton
f47a41a3d9 Cleanup: iterator macros
- put render iterator in own scope
  (would shadow it's own variable if used multiple times).
- enforce semicolon at end of iterator macros.
- no need to typedef one-off macro structs.
2018-03-09 11:52:11 +11:00
Campbell Barton
9342f55d12 Merge branch 'master' into blender2.8 2018-03-08 17:54:52 +11:00
Campbell Barton
222a941a2b Merge branch 'master' into blender2.8 2018-03-08 17:47:02 +11:00
Campbell Barton
ecab7bef69 Cleanup: Rename view3d context set function
Use common prefix so adding related functions share the prefix.
2018-03-08 17:30:24 +11:00
Campbell Barton
28f86bf117 Cleanup: use edit/active objects from view context
Needed to implement multiple edit-objects.
2018-03-08 17:27:36 +11:00
Campbell Barton
cb8311fecf Cleanup: set the view-context once 2018-03-08 17:27:36 +11:00
Joshua Leung
5331581ea4 Cleanup: Use BKE_ prefix for all public functions exposed by the NLA module 2018-03-08 17:15:34 +13:00
Joshua Leung
7e2100e499 T54233: NLA "Push Down" discards Blend Mode, Extrapolation, and Influence
Each AnimData block has a set of Blend/Extrapolation/Influence settings
that can be used to control how the active action is blended with the
NLA stack. However, these settings were not getting copied over to the
newly created strips (as the push-down code existed long before these
settings were added).

This commit solves this in several ways:
* Active Action Blend/Extrapolation/Influence settings now get copied
  to the new strips when adding them to the NLA stack via Push Down.

  Note: This doesn't happen when there are no existing NLA tracks,
        as these settings don't get used in that case.

* Strip Influence will be copied across when inf < 1.0 (i.e. when a
  non-default value is used), to maintain the effect. To make this work,
  the influence value will get added as a keyframe to the strip's
  "Influence" Control FCurve.

  - See code comments for an alternative approach and why that was not chosen
  - Strip Time still doesn't get keyframes added automatically yet.

* To ensure the "extrapolation mode" settings don't get always overwritten,
  I've put in place a compromise: the extrapolation will only get changed
  if the chosen setting will cause problmes (i.e. hold forward & back -> hold forward
  if there are other tracks before it already).

Not safe for backporting to 2.79[x] stable releases.
2018-03-08 17:15:33 +13:00
Joshua Leung
fb70f9bf99 Fix crash if NLA strip with "Use Animated Influence" setting is enabled without the Influence Strip F-Curve existing 2018-03-08 17:15:33 +13:00
Joshua Leung
a5d63624de Cleanup: Fix invalid name prefix 2018-03-08 17:15:32 +13:00
Clément Foucault
872df463f6 Eevee: Render: Add progress. 2018-03-08 00:09:04 +01:00
Clément Foucault
70fa15d1b8 Eevee: Save and reset matrixstate for probe rendering. 2018-03-08 00:09:04 +01:00
Clément Foucault
45ec962f68 DRW: Fix culling with inverted view (planar reflections)
Just invert the frustum planes in this case.
2018-03-08 00:09:04 +01:00
Germano
8d8f7e52c1 Make sure that the WM_opengl_context_create is always called on the main thread
Avoid the error 170 ("The requested resource is in use").
2018-03-07 20:05:51 -03:00
Germano
fef1b01553 Fix wglShareLists being called with rendering contexts in use
`wglShareLists` was failing with error code 170 ("The requested resource is in use").
2018-03-07 19:40:08 -03:00
Brecht Van Lommel
596f33f801 Fix T54206: bevel and inset operations repeat did not remember offset.
Now repeating the operator will use the previously chosen offset, either with
the modal operator or typed in. The modal operator will still start at zero.
2018-03-07 22:53:22 +01:00
Julian Eisel
8851460174 Proper fix for User Preferences window crash
Reverts rBb9ae517794765d6a1660 and fixes the issue properly. Old fix could cause
NULL to be passed to functions that expect all arguments to be non-NULL.
2018-03-07 21:18:16 +01:00
Julian Eisel
c00b42b710 Fix Blenderplayer not compiling 2018-03-07 20:41:49 +01:00
Campbell Barton
d59627d361 Merge branch 'master' into blender2.8 2018-03-08 02:03:36 +11:00
Campbell Barton
118fb9f1f7 EditMesh: pass object data to notifiers
Both were being passed in different parts of the code,
use object data for consistency.
2018-03-08 01:49:30 +11:00
Campbell Barton
f02af0407f Cleanup: use _BEGIN suffix for group iterators 2018-03-07 20:46:27 +11:00
Campbell Barton
b9ae517794 Add missing NULL check
Caused loading user-prefs to crash.
2018-03-07 16:40:02 +11:00
Campbell Barton
49baf15a35 Merge branch 'master' into blender2.8 2018-03-07 14:31:53 +11:00
Campbell Barton
737a5efff4 Cleanup: edit-mode undo API
Move function descriptions into the struct,
minor improvements to variable naming,
use convention of 'g_' prefix for static vars.
2018-03-07 14:00:02 +11:00
Clément Foucault
4f23e13001 DRW: Fix memory leak.
This prevents the creation of a new job if no job is running.
2018-03-07 01:40:40 +01:00
Clément Foucault
cfba75a21a Eevee: Fix volume rendering glitches.
The bug was due to the Halton function returning uninitialized value for 0 iteration.
2018-03-07 01:40:40 +01:00
Clément Foucault
aa07660201 Eevee: Fix garbage on the first frames when enabling volumetrics.
Was cause by newly added shader deferred compilation.
2018-03-07 01:40:40 +01:00
Germano
267e816b9a Draw Manager: Simplify the algorithm that extract the BoundingSphere of a Frustum
The idea is to separate the most common case from symmetrical frustum. And to make a simple but efficient calculation.

The new radius is usually 98% the size of the radius size of the asymmetric solution.

Thanks to @fclem for reviewing the patch on IRC
2018-03-06 19:27:43 -03:00
Clément Foucault
faf70e1e64 Eevee: Fix crash with volumetrics + default mat + alpha blend 2018-03-06 16:52:06 +01:00
Clément Foucault
d5ecadd643 Eevee: Fix Cascaded shadowmap setup.
It was getting the wrong matrice because of the point light override.
2018-03-06 16:45:23 +01:00
Clément Foucault
6b5b61eb8c DRW: Fix DRW_viewport_matrix_override_set_all function. 2018-03-06 16:45:23 +01:00
Clément Foucault
4e7d9b7a98 Eevee: Fix probes not working after a world update. 2018-03-06 16:45:23 +01:00
Clément Foucault
f8b63b564d Eevee: Update to support shader deferred compilation.
World probe is tagged to refresh when it it's shader is updated.
Probes are recomputed only after all meshes shaders have been compiled.
2018-03-06 16:45:23 +01:00
Clément Foucault
2faa809ea6 GPU: Fix typo. 2018-03-06 16:45:23 +01:00
Clément Foucault
b55077a506 DRW: Fix broken grid in ortho view. 2018-03-06 16:45:23 +01:00
Clément Foucault
aa02c099f9 Eevee: fix wrong sizeof.
Like really? wtf dude? *self face slapping*
2018-03-06 16:45:23 +01:00
Clément Foucault
94fadd00d8 DRW: Shader Deferred compilation: Use a wmJob for threading.
Also get rid of the static var and initialization.
This enables the user to see the progress on the info header.
Closing blender or reading a file also kill the job which is good.

Unfortunatly, this job cannot be interrupt by users directly. We could make it interruptible but we need a way to resume the compilation.
2018-03-06 16:45:22 +01:00