Commit Graph

63822 Commits

Author SHA1 Message Date
Mai Lavelle
ebfdd7da83 Cycles microdisplacement: perform subdivision dicing in raster space
NOTE: this is only the first of many patches towards completing the subdivison
and displacement system in Cycles. These patches will be reviewed and committed
one by one over the coming weeks.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D1909
2016-04-11 23:12:11 +02:00
Sergey Sharybin
7d033717ad Cycles: Cleanup, make some comments easier to read on split editors 2016-04-11 18:00:42 +02:00
Sergey Sharybin
ac00c17900 Cycles: Remove hair support from volume BVH traversal
There are couple of reasons:

- Volume shader on hair does behave really weird anyway and it's
  not something considered a bug really.

- Volume BVH traversal were only used by camera-in-volume check,
  which doesn't really make sense to take hair into account since
  it'll be rendered wrong anyway.

Such a removal makes both code easier to extend further (as in,
no need to worry about those traversal for hair bvh) and also
reduces stress on GPU compilers.
2016-04-11 17:18:14 +02:00
Sergey Sharybin
e4cdda548a Cycles: Remove unused SAH from BVH pack 2016-04-11 17:18:14 +02:00
Sergey Sharybin
6cd13a221f Cycles: Rename tri_woop to tri_storage
It's no longer a pre-computed data and just a storage of triangle
coordinates which are faster to access to.
2016-04-11 17:18:14 +02:00
Campbell Barton
e5a2790ecb Fix T48084: Solidify uses alternate quad-direction
This prevents twisted quads from self-intersecting.

This change makes the duplicate surface match the first vertex in the face,
so the diagonal indices match in the face copy.
2016-04-11 23:04:11 +10:00
Campbell Barton
90271e7ff1 Fix T48082: Unwrap overwrites face selection
Sync selection option made adding a new UV layer select all edit-mesh faces.
Now just select the UV's, ignoring sync-select option.
2016-04-11 20:27:10 +10:00
Sergey Sharybin
45a089c138 Fix T48103: Wrong renders on AMD OpenCL when Light Falloff node is used 2016-04-11 10:54:41 +02:00
Porteries Tristan
2050ecc307 BGE: Fix T48071: Global logic manager
Previously the logic manager was used as a global variable for SCA_ILogicBrick::m_sCurrentLogicManager,
this request to always update it before run any python script and allow call function like
ConvertPythonTo[GameObject/Mesh]. The bug showed in T48071 is that as exepted the global
m_sCurrentLogicManager is not updated with the proper scene logic manager.
Instead of trying to fix it by updating the logic manager everywhere and wait next bug report to add
a similar line. The following patch propose a different way:
- Every logic brick now contain its logic manager to SCA_ILogicBrick::m_logicManager, this value is
  set and get by SCA_ILogicBrick::[Set/Get]LogicManager, It's initialized from blender conversion and
  scene merging.
- Function ConvertPythonTo[GameObject/mesh] now take as first argument the logic manager to find name
  coresponding object or mesh. Only ConvertPythonToCamera doesn't do that because it uses the
  KX_Scene::FindCamera function.

Reviewers: moguri

Differential Revision: https://developer.blender.org/D1913
2016-04-10 23:57:43 +02:00
Sergey Sharybin
3a80d5e1d0 Cycles: Fix rare dead-locks on TaskScheduler::exit()
When the Moon is full it was possible to have a dead-lock in task
scheduler's  exit() method.

Similar problem was fixed in Blender's task scheduler 3 years ago
in bae2a2c.
2016-04-10 21:18:54 +02:00
Campbell Barton
50f9681e15 Docs: comment on line-sphere intersection 2016-04-10 22:46:12 +10:00
Bastien Montagne
019ce363b0 Cleanup a bit particle distribution code.
Also do proper intial/final checks to avoid adding particle on zero-weight extreme items,
instead of using cheap tricks like 'small offset'...
2016-04-09 22:46:27 +02:00
Bastien Montagne
950acb0ced Fix T47983, Take II: Particles - Emit from Verts emits double on one vert.
Previous fix made another issue even more visible, leading to +1 particle on first vert
and none on last one. This commit should fix both original and new issues.
2016-04-09 18:59:05 +02:00
d09a372acb Fix T48078: incorrect OS X command for retrieving number of CPUs on in Makefile. 2016-04-09 00:25:18 +02:00
Bastien Montagne
c1d1c1dc6b Fix T48088: Reproducible crash: Edges + Array Mod + Hair Particles.
Code did not consider the possibility to have no face at all! :P
2016-04-08 16:26:42 +02:00
Alexander Romanov
a5dcda8ad3 Fix broken by D1880 line stipple deactivation 2016-04-08 12:20:43 +03:00
Alexander Romanov
d969192fbe Wide lines + line stipple deprecated API replacement
The patch contains an implementation of the wide lines and the line stipple that is necessary for OpenGL upgrade.

For the implementation I have chosen the geometry shader because it required minimum changes for the wrapper calls and such implementation is the best for the "basic shader" architecture.

There are few shortcomings that can be corrected in future. They all are related to the fact that the lines in one strip are not connected with each other. So the stipple pattern is not continuous on the common vertex of two lines. There is also no continuity of form (each line is an independent rectangular).
But the advantage is that even outdated glBegin, glVertex work! Though with the above restrictions.
Continuity of form and stipple can be implemented with additional attributes, and it will require more changes in calls.

At the moment, the patch replaces calls for some "gestures". It works satisfactorily for "cross" or "rectangular" and not so good for "lasso" and "circle" due to the above-mentioned shortcomings.

Don't forget to set USE_GLSL to true for testing.

Alexander Romanov (Blend4Web Team)

Reviewers: merwin, brecht

Reviewed By: merwin, brecht

Subscribers: aligorith, Evgeny_Rodygin, AlexKowel, yurikovelenov

Differential Revision: https://developer.blender.org/D1880
2016-04-08 10:58:40 +03:00
Sergey Sharybin
a51e9ece53 Cycles: Fix misleading remaining time report when using infinite number of samples in viewport 2016-04-06 16:30:52 +02:00
Sergey Sharybin
d6ae94b988 Cycles: Fix compilation error of Hair BSDF GLSL shader 2016-04-06 15:40:55 +02:00
Sergey Sharybin
42824f4403 Fix missing viewport update when tree output is in a node
There was already an attempt to do it, but it worked incorrect because
of wrong recursion check.
2016-04-06 15:23:26 +02:00
Sergey Sharybin
e10ec6ee9a Cycles: Avoid possibly uninitialized variable 2016-04-06 10:51:04 +02:00
Campbell Barton
5ddf6ca87a Quiet warning for release build 2016-04-06 18:26:39 +10:00
Campbell Barton
9e3b0350f5 Fix leak w/ missing external mesh customdata 2016-04-06 16:14:30 +10:00
Campbell Barton
78d39cad8b Tweak fill-region method to produce fewer 'gaps' 2016-04-06 15:07:37 +10:00
Campbell Barton
16597b691a Fix camera view-border line width 2016-04-06 14:27:37 +10:00
Campbell Barton
28dad2ec12 Correct error checking for wrong frame range 2016-04-06 09:41:30 +10:00
Campbell Barton
f5fb4361d2 Cleanup: indentation 2016-04-06 09:30:20 +10:00
Campbell Barton
cc970dc08a Cleanup: arg docstrings 2016-04-06 09:28:22 +10:00
Campbell Barton
16f919ea58 Render frame arg parsing, list and range support
Support a comma separated list of frames, as well as frame ranges using the '..' separator.

eg: `blender my.blend --render-frame 1,2,10..40,100..200`
2016-04-06 09:23:15 +10:00
Reinier de Blois
c084520b03 Expose new Recast partitioning methods for navmesh generation
This patch depends on D1747, which upgrades the Recast version.  It exposes the new Recast partitioning methods in the navmesh generation.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1748
2016-04-05 21:39:04 +02:00
Reinier de Blois
176538f613 Update Recast version to 1.5.0
The version of Recast that Blender ships with is from 2009.  This patch updates the Recast version to the latest version, 1.5.0.  The Detour version remains untouched.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1747
2016-04-05 21:38:52 +02:00
Campbell Barton
214e384fc4 Fix UV-Editor crashes w/ over SHRT_MAX UV's 2016-04-05 22:16:09 +10:00
Thomas Dinges
b8ca4819b2 Revert "Cycles: Remove the Preetham Sky model."
This reverts commit d91316dc672dc1ee69fbd24d2f00124a24b75c6b.
2016-04-05 12:25:54 +02:00
Bastien Montagne
46aaa53998 Fix T48054: Blender 2.77 doesn't import blenders fbx, due to recent changes in anim RNA API.
Please do not break API when not absolutely needed, here it was a mere parameter order issue...
2016-04-05 11:51:54 +02:00
Tamito Kajiyama
db28ff54d6 Fix T47705: Freestyle line glitch.
The addressed issue is a regression from Blender 2.75, after the internal
switch from double to single precision floating-point numbers in the
Freestyle code base.  Face normal calculations require the higher
precision during the computations, even though the results can be stored
as single precision numbers.
2016-04-05 16:15:09 +09:00
Thomas Dinges
9c952bbe85 Cleanup: Typo fixes after BVH commits. 2016-04-05 01:20:45 +02:00
Campbell Barton
82b0a9e369 PyDriver support for all RNA property types
Support for driver variables that don't resolve to numbers, eg:
objects, bones, curves... etc.

Without this, Python expressions to access this data needed to use an absolute path from `bpy.data`,
however this is inconvenient, breaks easily (based on naming) and wouldn't set the dependencies correctly.
2016-04-05 07:38:57 +10:00
Sergey Sharybin
65f279b770 Cycles: Fix wrong camera in volume check when domain is only visible to camera rays 2016-04-04 19:30:38 +02:00
Sergey Sharybin
ac8f4ba530 Cycles: Fix regression caused by recent camera-in-volume commit
Stupid me forgot that we don't have stop-element in the stack yet.
2016-04-04 18:24:40 +02:00
Sergey Sharybin
a3d6552514 Cycles: Fix regular BVH not having proper visibility flags
This was caused by recent threading commit. Now because of all children
are set when they're ready need to explicitly update all parent's visibility.
2016-04-04 18:11:34 +02:00
Bastien Montagne
d82d9e14e8 Fix T48045: Freestyle ID user decrement error.
This fixes reported issue, but there could be more of those hidden in Freestyle code,
it did not handle user refcount at all (and the fact it by-passes BKE in some places
for efficiency does not help here).

Note that this should be relatively harmless, since freestyle uses own Main during
render, so everything is cleaned up in the end in any case... But better try to
handle IDs correctly here too. :)
2016-04-04 15:49:30 +02:00
Sergey Sharybin
f76dec9238 Update hash for an OBJ unit test 2016-04-04 15:22:31 +02:00
Sergey Sharybin
bf55afbf26 Cycles: Make spatial split BVH multi-threaded
The title actually covers it all, This commit exploits all the work
being done in previous changes to make it possible to build spatial
splits in threads.

Works quite nicely, but has a downside of some extra memory usage.
In practice it doesn't seem to be a huge problem and that we can
always look into later if it becomes a real showstopper.

In practice it shows some nice speedup:

- BMW27 scene takes 3 now (used to be 4)
- Agent shot takes 5 sec (used to be 80)

Such non-linear speedup is most likely coming from much less amount
of heap re-allocations. A a downside, there's a bit of extra memory
used by BVH arrays. From the tests amount of extra memory is below
0.001% so far, so it's not that bad at all.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

Differential Revision: https://developer.blender.org/D1820
2016-04-04 14:43:21 +02:00
Sergey Sharybin
be2186ad62 Cycles: Solve possible issues with running out of stack memory allocator
Policy here is a bit more complicated, if tree becomes too deep we're
forced to create a leaf node and size of that leaf wouldn't be so well
predicted, which means it's quite tricky to use single stack array for
that.

Made it more official feature that StackAllocator will fall-back to
heap when running out of stack memory.

It's still much better than always using heap allocator.
2016-04-04 14:13:19 +02:00
Sergey Sharybin
5ab3a97dbb Cycles: Log overall time spent on building object's BVH
We had per-tree statistics already, but it's a bit tricky to see overall
time because trees could be building in parallel.

In fact, we can now print statistics for any TaskPool.
2016-04-04 13:43:19 +02:00
Sergey Sharybin
ba7c2b7b73 Cycles: Log allocation slop factor for BVH arrays
Currently they're staying at 1 (actual size over capacity), but we
will be changing it quite soon in order to avoid having too much
memory re-allocation happening at a BVH build time and will be
playing with different policies for that.
2016-04-04 12:56:56 +02:00
Bastien Montagne
5d25579602 Fix missing ID_SO sound type in outliner's ID types.
Note that we may want to review that some day, we have quite a bit of ID types here that are
'blend file' view only, might be worth splitting the check based on this.
2016-04-04 12:35:59 +02:00
Sergey Sharybin
61a8d12ccd Cycles: Tweak to stack allocator used by BVH builder
In some files stack memory was overruning the pre-allocated stack.

Perhaps we should fall-back to a hep-allocated stack so release builds
don't crash in works case but just becoming slower.
2016-04-04 12:23:23 +02:00
Sergey Sharybin
8cc7460495 Smoke: Don't use min as an uniform name
This is an attempt to fix report T47991.
2016-04-04 11:58:27 +02:00
Sergey Sharybin
673ddd48da Cycles: Make curves modified by a taper object with modifier considered a deform modified
That might consider a bit more objects to be considered deform modified,
but it covers common case of using taper object without require of doing
recursive checks.

In worst case it'll be just some extra synchronization time, no render
time difference will happen for false-positive because of extra checks
happening in Cycles.
2016-04-04 11:39:04 +02:00