Commit Graph

62091 Commits

Author SHA1 Message Date
Thomas Dinges
e796581655 Cycles: Refactor of constant fold.
* Move constant folding from nodes to the shader graph. This way it's part of our (later) 4-step optimization process.
* Instead of only doing a one level constant fold, we can now do a recursive constant fold, allowing us to simplify shaders much further.
Constant folding is implemented for Blackbody, Math and VectorMath nodes.

Example (the highlighted nodes are removed before rendering):
Before: http://archive.dingto.org/2015/blender/code/one_level_constant_fold.jpg
Now: http://archive.dingto.org/2015/blender/code/multi_level_constant_fold.jpg

Thanks to Sergey and Brecht for Review!
Differential Revision: https://developer.blender.org/D1626
2015-11-25 13:57:54 +01:00
Sergey Sharybin
415b5a4369 Fix T46646: Point Cloud Density crashes on real time rendering
The issue was caused by possible use of object->derivedFinal from the render
thread, The patch tries to eliminate (or at least minimize, huh) amount of
access to the derivedFinal of a source object. It's still possible that in
the case of particle source derived mesh will be still unsafely used, but
with the patch applied we can easily change runtime part of the code and
cache derived mesh on the preparation stage.

Some ideas for the future:

- Check whether cache() was called on the point density node when calling
  calc().

- Cache derivedMesh in the runtime part of point density node to avoid
  possible remained thread conflicts.

- NULL the runtime part of the node on .blend load

Reviewers: campbellbarton, plasmasolutions

Reviewed By: plasmasolutions

Differential Revision: https://developer.blender.org/D1614
2015-11-25 17:43:44 +05:00
Sergey Sharybin
328208a6a6 Cycles: Fix shader update bug introduced by recent commits
Seems set_intersection() requires passing explicit comparator if non-default
one is used for the sets. A bit weird, but can't really find another explanation
here about whats' going on here.
2015-11-25 16:05:57 +05:00
Campbell Barton
00afa02528 PyAPI: remove workaround for Py3.4 bug 2015-11-25 21:54:02 +11:00
Bastien Montagne
bdd1ecef03 install_deps.sh: Updated official Python (to 3.5.0) and NumPy (to 1.10.1). 2015-11-25 11:58:00 +01:00
Bastien Montagne
95bc8389a9 MOD_weightvg: switch from OMP to BLI_task's parallelized 'for loop'.
Also gives about 5-6% speedup...
2015-11-25 11:51:05 +01:00
Bastien Montagne
0f609d5d04 BLI_task: BLI_task_parallel_range_ex: add some per-chunk userdata.
This mimics OpenMP's 'firstprivate' feature. It is sometimes handy to have some persistent local data during a whole chunk.

Reviewers: sergey

Reviewed By: sergey

Subscribers: campbellbarton

Differential Revision: https://developer.blender.org/D1635
2015-11-25 11:01:59 +01:00
Sergey Sharybin
8294452b14 Fix T46782: Updating Shaders very slow with complex nodegraph
The issue was caused by not really optimal graph traversal for gathering nodes
dependencies which could have exponential complexity with a long tree branches
connected with multiple connections between them.

Now we optimize the depth traversal and perform early output if the node was
already traversed.

Please note that this adds some limitations to the use of SVM compiler's
find_dependencies() in the cases when skip_node is not NULL and one wants to
perform dependencies find sequentially with the same set. This doesn't happen
in the code, but one should be aware of this.
2015-11-25 13:46:51 +05:00
Sergey Sharybin
443b159f02 Cycles: Ensure order of shader nodes in the dependnecies set
The issue was than nodes dependencies were stored as set<ShaderNode*> which
is actually a so called "strict weak ordered", meaning order of nodes in
the set is strictly defined, but based on the ShaderNode pointer. This means
that between different render invokations order of original nodes could be
different due to different pointers allocated for ShaderNode.

This commit makes it so dependencies and maps used for ShaderNodes are based
on the node->id which has much more predictable order. It's still possible
to trick the system by doing some crazy edits during viewport rendfer and
cause difference between viewport and final render stacks.

Reviewers: brecht

Reviewed By: brecht

Subscribers: LazyDodo

Differential Revision: https://developer.blender.org/D1630
2015-11-25 13:07:32 +05:00
Sergey Sharybin
de35827612 Cycles: Fix wrong volume stack update with SSS object intersecting the volume
There's no need in moving ray at all, stack should always be updated from the
original hit point to the scattered one.
2015-11-25 13:01:22 +05:00
Sergey Sharybin
26f1c51ca6 Cycles: Trace indirect subsurface rays by restarting the integrator loop
This gives much lower stack usage on GPU and reduces kernel memory size to
around 448MB on GTX560Ti (comparing to 652MB with previous commit and 946MB
with official release). There's also a barely measurable speedup of around
5%, but this is to be confirmed still.

At this stage we're using only ~3% for the experimental kernel and SSS
rendering seems to be faster by 40% and after some further testing we might
consider making SSS and CMJ official features and remove experimental
precompiled kernels.
2015-11-25 13:01:22 +05:00
Sergey Sharybin
2a5c1fc9cc Cycles: Delay shooting SSS indirect rays
The idea is to delay shooting indirect rays for the SSS sampling and
trace them after the main integration loop was finished.

This reduces GPU stack usage even further and brings it down to around
652MB (comparing to 722MB before the change and 946MB with previous
stable release).

This also solves the speed regression happened in the previous commit
and now simple SSS scene (SSS suzanne on the floor) renders in 0:50
(comparing to 1:16 with previous commit and 1:03 with official release).
2015-11-25 13:01:22 +05:00
Sergey Sharybin
8bca34fe32 Cysles: Avoid having ShaderData on the stack
This commit introduces a SSS-oriented intersection structure which is replacing
old logic of having separate arrays for just intersections and shader data and
encapsulates all the data needed for SSS evaluation.

This giver a huge stack memory saving on GPU. In own experiments it gave 25%
memory usage reduction on GTX560Ti (722MB vs. 946MB).

Unfortunately, this gave some performance loss of 20% which only happens on GPU.
This is perhaps due to different memory access pattern. Will be solved in the
future, hopefully.

Famous saying: won in memory - lost in time (which is also valid in other way
around).
2015-11-25 13:01:22 +05:00
Mike Erwin
e6fff424db OpenGL: set geometry shader input length implicitly
Input array length is implicitly set at link time, based on the geometry
shader's layout. Specifying the wrong value here is an error; specifying
no value is the same as getting it right. (inspired by a recent codegen
change)
2015-11-25 01:49:07 -05:00
Campbell Barton
22ec7b17d2 BMesh: raise exception face-split w/ adjacent loops
Was raising "internal error".
2015-11-25 12:08:50 +11:00
Campbell Barton
b6084d56c9 BMesh: remove double faces when triangulating 2015-11-25 11:55:46 +11:00
Campbell Barton
69cdddd4cf Fix error in recent check for duplicate tris 2015-11-25 11:28:25 +11:00
Martijn Berger
e8b3a14dfb OSX bump python to 3.5 2015-11-24 23:18:31 +01:00
Antony Riakiotakis
697acebeb7 Sculpting optimization: Avoid iterating the PBVH for intersection during
the paint cursor drawing when a stroke is underway; this information is
already available from the stroke itself.

Should improve performance when "show brush" is enabled (which is
always, for sane people). Finding an intersection is not always cheap,
especially on heavy meshes.

Cudos to the dyntopo test thread for the report and the sculpt love :)
2015-11-24 21:40:52 +01:00
Bastien Montagne
fe3aaac118 Fix T46855: Limit Location Max value limited to 1000 units.
Those should be UI limits, not hard absolute limits...
2015-11-24 20:29:33 +01:00
Bastien Montagne
14221521fb Fix previous own fix - second message was actually OK, first one had bad comma placement...
Thanks to psy-fi for the head-up.
2015-11-24 15:36:49 +01:00
Bastien Montagne
0b422900c8 Fix broken windows 'MessageBox' calls (UI messages).
Reported by Bzzt_Ploink on IRC.
2015-11-24 15:14:22 +01:00
Sergey Sharybin
edb2e96cd5 Fix T46851: Crash on multires more than million
yet another bug introduced by recent shadowing changes -- q and r CCG arrays
were overwritten by the temporary evaluation because the code was changed to
use global pointers instead of the local ones.

Naming of the variables could be changed to be a bit more accurate.
2015-11-24 15:25:19 +05:00
Sergey Sharybin
678fe87c85 Buildbot: Switch Linux builds to Python 3.5 2015-11-24 14:45:55 +05:00
Sergey Sharybin
9ea4202816 Fix T46839: New dependency graph missed time update on motrack constraints 2015-11-24 14:44:38 +05:00
Sergey Sharybin
f7c987b0ab Fix outliner crash after recent no-functional-changes cleanup commits 2015-11-24 14:25:09 +05:00
Bastien Montagne
ebf3979cab install_deps.sh: update official numpy version. 2015-11-24 10:13:16 +01:00
Sergey Sharybin
fa6bdfd622 Cycles: Support per-render layer world AO settings
This is sort of extension of existing Use Environment option which now allows to
disable AO on the render layer basis.

Useful in cases like disabling AO for the background because it might make it
too flat and so.

Reviewers: juicyfruit, dingto, brecht

Reviewed By: brecht

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1633
2015-11-24 13:21:40 +05:00
Sybren A. Stüvel
31cc60e76b BGE: Save screenshots in a different thread
This patch allows the game engine to keep running while performing things like PNG compression and disk I/O.

As an example, my crowd simulation rasterizer saves a screenshot for every frame. This now takes up 13 msec per frame, which was 31 msec before this patch. Effectively, it allows the simulation to save every frame and still run at 60 FPS.

Reviewers: lordloki, moguri, panzergame

Reviewed By: moguri, panzergame

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1507
2015-11-24 09:15:15 +01:00
Julian Eisel
c026aa6d54 Cleanup: Unsued variables
Unused since rB291afea8ccdea5.
2015-11-24 09:01:52 +01:00
Mike Erwin
ef5fff4adc OpenGL: when checking GL version, assume >= 2.1
Mostly glBlendFunc related.
2015-11-24 02:34:54 -05:00
Mike Erwin
291afea8cc OpenGL: clean up use of old extensions 2015-11-24 02:21:07 -05:00
Campbell Barton
4ebede5d1f fix error in last commit 2015-11-24 17:57:47 +11:00
Campbell Barton
6ba9d1094a Fix T46805: Scale along axis fails w/ Python
't->value' no longer has constraint matrix applied for translate,
fix for T46003 is no longer needed.
2015-11-24 16:50:21 +11:00
Campbell Barton
c3e7dfa82d Fix T46816: Vert/Edge snap fails at edge of bounds 2015-11-24 12:16:14 +11:00
Campbell Barton
68922e4660 View3D: move snapping functions out of ruler 2015-11-24 11:48:34 +11:00
Campbell Barton
df5532b502 UV Smart Project: restore 'Stretch to UV Bounds'
This option wasn't exposed since 2.4x.

D1622 by @candreacchio
2015-11-24 07:28:42 +11:00
Bastien Montagne
39957b85d9 install_deps.sh: Fix dependencies between (built) libs.
Who in hell did make OSD dependant on llvm???
2015-11-23 21:05:54 +01:00
Bastien Montagne
029a92ded6 install_deps.sh: Cleanup: Use correct boolean checks.
Yeah... that is correct bash boolean check syntax. Pretty sure even BASIC or Perl do better.

See http://stackoverflow.com/questions/2953646/how-to-declare-and-use-boolean-variables-in-shell-script
2015-11-23 21:05:54 +01:00
Bastien Montagne
f31e82d448 install_deps.sh: add option to force building libs instead of using packages, and limited fallback for unsuported distro.
This commit adds '--build-foo' options to force the script to build relevant libraries
instead of trying to use packages from the distribution.

In addition, it also now offers (with those '--build-foo' options) the possibility
to build libraries on distributions that are not fully supported.

This is limited, but should still help people once they have installed themselves
the basics of dependencies - boost, llvm, osl/osd etc. are not libraries that are
really easy to build.

DISCLAIMER: I did not take the 20 (or more) hours needed to test all combinations
over all distributions, and given the size of the changes, bad sneaky typos are quite
probable, so please report if you get some errors!
2015-11-23 21:05:54 +01:00
Bastien Montagne
1d7ed584db install_deps.sh: refactor message about needed dependencies, and add option to show it and exit (--show-deps).
More info about 'official' source and versions of main libraries handled by the script have also been added to that info option.
2015-11-23 21:05:54 +01:00
d27da6f79c Git ignore BUILD_NOTES.txt from install_deps.sh. 2015-11-23 20:17:02 +01:00
Brecht Van Lommel
e556287a3b CMake: enable -std=gnu99 for clang and icc. 2015-11-23 18:22:53 +01:00
Brecht Van Lommel
880258a0db Fix T46848: OpenNL crash on Windows due to uninintialized variables. 2015-11-23 18:20:32 +01:00
Sergey Sharybin
f021d97e8f Fix T46842: Removing World is missing AO update in viewport render 2015-11-23 17:44:52 +05:00
Campbell Barton
940f7a6d53 Cleanup: shadowing (unwrap) 2015-11-23 22:12:29 +11:00
Campbell Barton
47dd7d7133 Fix T46841: Thick lines w/ graph visible 2015-11-23 21:55:35 +11:00
Mike Erwin
f997449f84 OpenSubdiv: support OpenGL 3.x
GLSL 130, 140, 150 with extensions as needed.

Similar logic to my recent gpu_extensions changes.

Partially fixes T46706. Matcaps now work with OpenSubdiv, as do basic
materials. Anything with UV coordinates is still broken.
2015-11-23 03:35:16 -05:00
Thomas Dinges
8d47dbccbe OpenGL: Replace some more ARB suffix from glBindBufferARB. 2015-11-23 09:09:26 +01:00
Campbell Barton
4fe413a419 CMake: use -Wshadow warning for C source
C source now builds without shadowing, enable with GCC by default.
2015-11-23 17:43:55 +11:00