Commit Graph

5712 Commits

Author SHA1 Message Date
Sergey Sharybin
90e827ba66 CMake: De-duplicate checks around unordered maps and shared pointer
Previously several areas were calling TEST_SHARED_PTR_SUPPORT and
TEST_UNORDERED_MAP_SUPPORT which isn't that bad on it's own but
was causing some quite verbose output with same information line
printed multiple times. additionally, what's more worse, define flags
for Ceres were duplicated in main CMakeLists and Ceres's CMakeLists.

Now we've got a single place where checks for those classes are
happening and other areas are simply checking for variables set by
those check macros, keeping CMake output clean and nice.
2016-01-14 12:38:46 +05:00
Sergey Sharybin
2af7637f20 Cycles: Add option to directly link against CUDA libraries
The main purpose of such linking is to make Blender compatible with
NVidia's debuggers and profilers which are doing some LD_PRELOAD
magic to intercept some function calls. Such magic conflicts with
our CUDA wrangler magic and causes segmentation faults.

The option is disabled by default, so there's no affect on any of
artists.

In order to make Blender linked directly against CUDA library use
the WITH_CUDA_DYNLOAD CMake option (it's marked as advanced).
2016-01-14 12:27:22 +05:00
Sergey Sharybin
7142bf6cf3 Cycles: Use proper primitive for the motion subsurface refine 2016-01-12 17:09:29 +05:00
Sergey Sharybin
ac7aefd7c2 Cycles: Use special debug panel to fine-tune debug flags
This panel is only visible when debug_value is set to 256 and has no
affect in other cases. However, if debug value is not set to this
value, environment variables will be used to control which features
are enabled, so there's no visible changes to anyone in fact.

There are some changes needed to prevent devices re-enumeration on
every Cycles session create.

Reviewers: juicyfruit, lukasstockner97, dingto, brecht

Reviewed By: lukasstockner97, dingto

Differential Revision: https://developer.blender.org/D1720
2016-01-12 16:21:30 +05:00
Sergey Sharybin
72e31d6a72 Cycles: Always inline triangle precalc for CUDA devices
Since the SSS changes compiling Experimental sm_52 kernel seems
to work just fine.
2016-01-11 21:41:00 +05:00
Sergey Sharybin
a60c3c6b21 Cycles: Fix for SSS objects being black when combined with motion blur 2016-01-11 21:39:24 +05:00
Thomas Dinges
d23f478863 Cycles: Add utility funcs to UI code, to check GPU usage.
Can be useful sometimes, and we already have this for CPU. Required for
some further work here.
2016-01-10 21:52:39 +01:00
Lukas Stockner
d330162ba6 Cycles: Fix Uninitialized Value compiler warning in the scoped_timer
Although the code made it impossible to use time_start_ uninitialized, at least GCC did
still produce multiple warnings about it.
Since time_dt() is an extremely cheap operation and functionality does not change in any way when
removing the check in the constructor, this commit removes the check and therefore the warning.
2016-01-10 00:50:54 +01:00
Lukas Stockner
64df7a2b38 Cycles: Read Wave texture profile in the XML parser 2016-01-10 00:24:12 +01:00
Lukas Stockner
6995b4d8d9 Cycles: Adding Hilbert Spiral as a tile order for rendering
This patch adds the "Hilbert Spiral", a custom-designed continuous space-filling curve, as a tile order for rendering in Cycles.
It essentially works by dividing the tiles into tile blocks which are processed in a spiral outwards from the center. Inside each
block, the tiles are processed in a regular Hilbert curve pattern. By rotating that pattern according to the spiral direction,
a continuous curve is obtained, which helps with cache coherency and therefore rendering speed.

The curve is a compromise between the faster-rendering Bottom-to-Top etc. orders and the Center order, which is a bit slower,
but starts with the more important areas. The Hilbert Spiral also starts in the center (unless huge tiles are used) and is still
marginally slower than Bottom-to-Top, but noticeably faster than Center.

Reviewers: sergey, #cycles, dingto

Reviewed By: #cycles, dingto

Subscribers: iscream, gregzaal, sergey, mib2berlin

Differential Revision: https://developer.blender.org/D1166
2016-01-10 00:13:53 +01:00
Campbell Barton
0ded953eea Cleanup: warning/spelling 2016-01-09 22:56:43 +11:00
Kévin Dietrich
14de8361f9 Smoke (fire): Move spectrum code from C++ (intern/) to C code (BLI)
This change is for a few reasons:
- it works with color, and (therefore) will need to be color managed, at
some point. This will be much easier to do if the code is closer to the
actual color management code (in Blender's core, so to speak).
- it has nothing to do with the actual fire simulation, as it is just
used to create a lookup table
- it can be reused for other purposes (i.e. in Blender internal
renderer, if people are interrested in a blackbody node à la Cycles)
- cleanup: some functions (`contrain_rgb`, `xyz_to_rgb`) already exist
in BLI

Reviewers: brecht

Reviewed By: brecht

Subscribers: brecht

Differential Revision: https://developer.blender.org/D1719
2016-01-09 04:48:31 +01:00
Bastien Montagne
2835a151c8 CMake: Make OSL's .oso shaders building also dependent on OSL compiler!
Otherwise, you can update OSL and not get .oso files regenerated, which is a quite
funny way to crash Blender...
2016-01-08 19:41:04 +01:00
Sergey Sharybin
0634fd0e97 Remove raskter library
it's no longer used by any of the parts of Blender.
2016-01-08 16:30:30 +05:00
cd6c6ee1a5 Fix T46993: UI lag in fullscreen mode on OS X / Intel graphics.
If anyone finds OS X UI drawing glitches with different graphics cards please
report them and I'll add an exception specifically for Intel, but in theory this
should work fine for all graphics cards.
2016-01-07 23:51:38 +01:00
Bastien Montagne
261ac69f57 Fix RNA_enum_set_identifier(), needs a context to handle correctly dynamic enums. 2016-01-07 21:52:54 +01:00
Sergey Sharybin
5483695698 Cycles: Update some API to be ready for OSL 1.6
While previous code was already compiling with OSL 1.6 it was using some symbols
which were considered deprecated in upstream.

This commit adds some ifdefs, but soon we'll get rid of all them rather soon
with the upcoming OIIO/OSL update.
2016-01-07 14:04:12 +05:00
Sergey Sharybin
772a3dab21 Cycles: Update some types used form OSL
Some types were deprecated back in 2013, better to be prepared earlier for those
types being removed from upstream.
2016-01-07 13:15:30 +05:00
Sergey Sharybin
3d313c9e5c Cycles: Whitespace cleanup, extra space in the argument list
Seems we're really starting to need to have cpplint for Cycles.
2016-01-07 11:52:45 +05:00
Sergey Sharybin
02739bd051 Cycles: Cleanup, use "string_" prefix for functions in util_string
No functional changes, just makes it easier to track where the function
is coming from.
2016-01-07 11:47:58 +05:00
Sergey Sharybin
9f2d33a652 Cycles: Fix wrong transparency flag being set to integrator
Patch from be28706 made it so integrator will use last shader's transparent
shadow flag, which is wrong since last shader might not have transparent
shadow while shaders prior to it might have one.
2016-01-07 11:45:13 +05:00
Thomas Dinges
3da0af1464 Cycles: Add utility function to convert bool to string. 2016-01-07 01:38:25 +01:00
Thomas Dinges
db72639e1f Cleanup: Fix Cycles compile warning on MSVC. 2016-01-07 00:26:26 +01:00
Thomas Dinges
81a253a0d5 Cycles OpenCL: Change environment flags for testing.
CYCLES_OPENCL_TEST was removed, there was an insonsistency between
opencl_kernel_use_split() and opencl_get_usable_devices().

From now on, to test non whitelisted devices please use either
CYCLES_OPENCL_MEGA_KERNEL_TEST or CYCLES_OPENCL_SPLIT_KERNEL_TEST.
2016-01-07 00:14:04 +01:00
Thomas Dinges
83e73a2100 Cycles: Refactor how we pass bounce info to light path node.
This commit changes the way how we pass bounce information to the Light
Path node. Instead of manualy copying the bounces into ShaderData, we now
directly pass PathState. This reduces the arguments that we need to pass
around and also makes it easier to extend the feature.

This commit also exposes the Transmission Bounce Depth to the Light Path
node. It works similar to the Transparent Depth Output: Replace a
Transmission lightpath after X bounces with another shader, e.g a Diffuse
one. This can be used to avoid black surfaces, due to low amount of max
bounces.

Reviewed by Sergey and Brecht, thanks for some hlp with this.

I tested compilation and usage on CPU (SVM and OSL), CUDA, OpenCL Split
and Mega kernel. Hopefully this covers all devices. :)
2016-01-06 23:43:29 +01:00
Sergey Sharybin
ea7a2766f6 Cycles: Fix possible buffer overflow in OIIO cache error message 2016-01-06 23:09:48 +05:00
Sergey Sharybin
03302fd5ed Fix T47120: CPU OSL Cycles crashes blender in latest GIT
The issue was caused by leaking error messages caused by
getting OIIO texture handle for built-in images.
2016-01-06 23:06:54 +05:00
Sergey Sharybin
944b6322e6 Cycles: Log whch optimizations are used for CPU kernels
Not fully thread-safe, but is rather harmless. Just some messages
might be logged several times.
2016-01-06 20:25:19 +05:00
Sergey Sharybin
e2846c999a Cycles: Fix stupid mistake which was assining kernel function in a loop 2016-01-06 20:05:33 +05:00
Sergey Sharybin
5d564da3b6 Cycles: Fix memory leak in shader graph when bump graph is used 2016-01-05 21:18:02 +05:00
Martijn Berger
2d9ed6e7c8 fix compiling cycles after recent gflags / glog shuffle 2016-01-05 14:14:10 +01:00
Sergey Sharybin
4a3e89e9ee Fix wrong linking flags for Libmv tests 2016-01-04 23:32:57 +05:00
Sergey Sharybin
474aa8515d Libmv: Solve some strict compiler warnings 2016-01-04 19:48:15 +05:00
Sergey Sharybin
ba432299cd Move Libmv from extern/ to intern/
Logically it is intern library since being mainly developed by 1.5 blender guys.
2016-01-04 19:39:13 +05:00
Sergey Sharybin
0b856dd97e Move GLog/GFlags to extern/
This is where the libraries belongs to actually, they are not only used by
Libmv now, but also by tests and Cycles.
2016-01-04 19:39:13 +05:00
Sergey Sharybin
2cdd4a5467 Cycles: Fix access uninitialized SVM stack caused by recent optimization 2016-01-04 17:11:52 +05:00
Sergey Sharybin
5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Sergey Sharybin
da49ee30b0 Fix T47100: OpenCL compilation warnings due to missing space in the argument list 2016-01-03 23:13:49 +05:00
Sergey Sharybin
a3df65dea8 Fix T47008: OSL Memory Corruption (Use after free)
The issue was caused by OSL using TLS which is required to be freed before the
Cycles session is freed. This is quite tricky to do in Cycles because different
render session are sharing the same task scheduler, so when one session is being
freed TLS might need to be active still.

In order to solve this, we are now doing JIT optimization ahead of the time
which ensures either TLS of JIT is freed before the render on multi-core system
or freed on OSLRenderSession destroy on single-core system.

This might increase synchronization time due to JIT of unused function, but
that we can solve later with some smart idea,
2016-01-03 18:28:33 +05:00
Lukas Stockner
b1a7fc2c51 Cycles: Force bottom-to-top tile order for viewport rendering
This commit overrides the user's choice of tile order in the case of viewport rendering and always uses bottom-to-top instead.
This was already done until the TileManager redesign, but since it removed the distinction between viewport and regular rendering
in the manager, the viewport was now also using the selected order. Since this requires sorting of the generated tiles,
it slows down rendering a bit. With the forced bottom-to-top order, this sorting step can now be avoided again.

Since the tile order is invisible anyways for viewport rendering, this commit won't have any impact on users (apart from a slight speedup).
2016-01-02 01:15:26 +01:00
Lukas Stockner
5c682a901b Cycles: Add Saw option to the wave texture
This commit adds "Bands Saw" and "Rings Saw" to the options for the Wave texture node in Cycles, behaving similar to the Saw option in BI textures.
Requested by @cekuhnen on BA.

Reviewers: dingto, sergey

Subscribers: cekuhnen

Differential Revision: https://developer.blender.org/D1699
2016-01-01 23:25:37 +01:00
Thomas Dinges
1ed610ed73 Fix OSL compilation, cannot assign vector to color. 2016-01-01 18:05:34 +01:00
Sergey Sharybin
ade35bac93 Cycles: Implement rolling shutter effect
This is an attempt to emulate real CMOS cameras which reads sensor by scanlines
and hence different scanlines are sampled at a different moment in time, which
causes so called rolling shutter effect. This effect will, for example, make
vertical straight lines being curved when doing horizontal camera pan.

This is controlled by the Shutter Type option in the Motion Blur panel.

Additionally, since scanline sampling is not instantaneous it's possible to have
motion blur on top of rolling shutter.

This is controlled by the Rolling Shutter Time slider which controls balance
between pure rolling shutter effect and pure motion blur effect.

Reviewers: brecht, juicyfruit, dingto, keir

Differential Revision: https://developer.blender.org/D1624
2015-12-31 20:44:27 +05:00
Sergey Sharybin
c81e6ffdf9 Fix T46915: Non-intuitive behavior of Vector Curve Mapping node
Vector mapping node was doing some weird mapping of both original and mapped
coordinates. Mapping of original coordinates was caused by the clamping nature
of the LUT generated from the node. Mapping of the mapped value again was quite
totally obscure -- one needed to constantly keep in mind that actual value will
be scaled up and moved down.

This commit makes it so values in the vector curve mapping are always absolute.
In fact, it is now behaving quite the same as RGB curve mapping node and the
code could be de-duplicated. Keeping the code duplicated for a bit so it's more
clear what exact parts of the node changed.

Reviewers: brecht

Subscribers: bassamk

Differential Revision: https://developer.blender.org/D1672
2015-12-31 20:40:22 +05:00
Sergey Sharybin
99da8e1ed8 Cycles: Fix viewport rendering with multiple GPU devices 2015-12-31 17:49:25 +05:00
Sergey Sharybin
0b4abd08b3 Cycles: Experiment with use of runtime tag instead of set for SVM generation
This gives about 2x speedup (3.2sec vs. 11.9sec with 32716 handled nodes) when
updating shader for the shader tree.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

Differential Revision: https://developer.blender.org/D1700
2015-12-31 15:58:18 +05:00
cf2005d942 Fix T47081: laplacian smooth edit mode tool crash. 2015-12-30 17:26:51 +01:00
Sergey Sharybin
f5c978074c Cycles: Code cleanup: use scoped timer to measure parts of SVM compiler 2015-12-30 19:35:21 +05:00
Sergey Sharybin
4d2eb42cfd Cycles: Wrap SVM compiler state variables into a single struct
This way it's easier to pass stuff around and also much easier to add more
state variables.

So far should be no functional changes for artists.
2015-12-30 19:21:19 +05:00
Sergey Sharybin
3918c8b9a5 Cycles: Optionally output luminance from the shader evaluation kernel
This makes it possible to move some parts of evaluation from host to the device
and hopefully reduce memory usage by avoid having full RGBA buffer on the host.

Reviewers: juicyfruit, lukasstockner97, brecht

Reviewed By: lukasstockner97, brecht

Differential Revision: https://developer.blender.org/D1702
2015-12-30 19:04:04 +05:00
Sergey Sharybin
c8a551bf13 Cycles: Don't install CPU-related kernel files 2015-12-30 18:51:35 +05:00
Sergey Sharybin
2b5d60eb2d Cycles: Deduplicte CPU kernel declaration and definition code
Main goal is to make kernel signatures editing easier and less prone to the
errors caused by missing function signature update or so.

This will also make it easier to add new CPU architectures.

Reviewers: juicyfruit, dingto, lukasstockner97, brecht

Reviewed By: dingto, lukasstockner97, brecht

Differential Revision: https://developer.blender.org/D1703
2015-12-30 17:54:02 +05:00
Thomas Szepe
2583cc88de Fix Moto overflow warnings
This fault (level 2, C4056) was introduced by changing Moto from double to float.
2015-12-30 12:45:36 +01:00
Martijn Berger
939dd2e168 Skip some more workarounds when using MSVC 2015 2015-12-30 11:23:10 +01:00
Sergey Sharybin
a6b67ca802 Cycles: Add timing information to the SVM compiler stats 2015-12-29 21:20:10 +05:00
Sergey Sharybin
aff9fd60bc Cycles: Optimize nodes deduplication routines
The idea is to have separate sets per node name in order to speed up the
comparison process. This will use a bit more memory and slow down simple
shaders, but this extra memory is not so much huge and time penalty is
not really measurable (at least from initial tests).

This saves orders of magnitude seconds when de-duplicating 17K nodes and
overall process now takes 0.01sec on my laptop,
2015-12-29 20:27:00 +05:00
Sergey Sharybin
3482cdb136 Cycles: Remove assert which is no longer valid
Was a left-over since 5b33115.
2015-12-29 19:19:53 +05:00
d1a26437ef OS X: remove code for OS X <= 10.5, which is already not supported since 2 years. 2015-12-29 00:27:18 +01:00
Sergey Sharybin
1a246afe03 Cycles: Use different approach for SVM summary report
Use Summary structure to collect all summary related on the shader compilation
process which then could be either simply reported to the log or be passed to
some user interface or so.

This is type of the summary / report which is most flexible and useful and
something we could use for other parts like shader optimization.
2015-12-28 19:42:37 +05:00
Sergey Sharybin
0ae2ade17a Cycles; Fix typo in the comment 2015-12-28 19:01:26 +05:00
Sergey Sharybin
18ccc6f960 Cycles: Log basic statistics of SVM compilation process 2015-12-28 19:01:07 +05:00
Sergey Sharybin
738f6d8127 Cycles: Implement node deduplication routines
The idea of this commit is to merge nodes which has identical settings
and matching inputs into a single node in order to minimize number of
SVM instructions.

This is quite simple bottom-top graph traversal and the trickiest part
is how to compare node settings without too much trouble which seems to
be solved is quite clean way.

Still possibilities for further improvements:

- Support comparison of BSDF nodes
- Support comparison of volume nodes
- Support comparison of curve mapping/ramp nodes

Reviewers: brecht, juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1673
2015-12-28 16:37:48 +05:00
Campbell Barton
225b02fcd6 Fix for building ghost-tests 2015-12-28 21:40:49 +11:00
Kévin Dietrich
7ef10decdb Fix for heap-use-after-free happening in GHOST_EventManager.
Issue was that dispatchEvent might call removeWindowEvents/
removeTypeEvents which will delete the event before we can do so.

To address this, handled events are now put in a separate list.

Reported by psy-fi and reviewed by brecht in IRC.
2015-12-28 00:35:47 +01:00
Kévin Dietrich
c4c3d84d58 Addendum to previous GHOST commit: remove redundant check. 2015-12-27 21:32:19 +01:00
Kévin Dietrich
3e35e32e9d Fix memory leak in GHOST Event Manager.
The events are allocated on the heap, then pushed on a stack. Before
being processed, they are popped from the stack, and deleted after
processing is done. When the manager is destroyed (e.g. application
closing), any remaining event in the stack is detroyed.

Issue is that when the "application closing" event is processed, it is
never freed, because the manager gets destroyed before the call to
`delete` is made and the event is not on the stack anymore.

Now events are left on the stack while they are processed, and only
popped and deleted after processing is done.

As a slight bonus refactor: use void as return type for dispatch events
functions, as no caller is checking the return value, and it is not
clear what it means (suggested by the reviewer).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D1695
2015-12-27 18:08:44 +01:00
Jörg Müller
fcc68a02e9 Fix T47064: Change Audio defaults to 48 kHz
Historically blender had an audio sample rate of 44.1 kHz as default which is mostly popular because it's the sample rate of audio CDs. Audaspace kept using this default from the pre 2.5 era. It was about time to change to 48 kHz, which is a more widespread standard nowadays, especially in video. It is the recommended sampling rate of the Audio Engineering Society.

Further reading: https://en.wikipedia.org/wiki/44,100_Hz#Status
2015-12-27 16:33:54 +01:00
Thomas Dinges
83addc0a1d Cleanup: SubsurfaceScatteringNode is a subclass of BsdfNode, no need to set the value again. 2015-12-25 11:58:52 +01:00
Lukas Stockner
8e07b87866 Cycles: Fix Tile access in the TileManager for viewport rendering
- When rendering in the Viewport, next_tile is sometimes called after a reset has been performed, but before
  new tiles were generated. In that case, the tile list would be invalid, causing Blender to crash randomly.
- When generating new tiles, the TileManager would not clear the tile lists before re-generating them, leading
  to some tiles being skipped during viewport rendering.
- When popping the next tile from a tile list, a reference to the just-deleted object would be returned, now the
  object is copied before deleting it.
2015-12-24 01:42:59 +01:00
Thomas Dinges
059b7a81e2 Cycles: Implement constant fold for the ConvertNode.
This way socket type conversions (such as color to float, or float to vector) do not stop the folding process.
Example: http://www.pasteall.org/pic/show.php?id=96803 (selected nodes are folded).
2015-12-23 21:48:19 +01:00
Lukas Stockner
548eb9eb4b Cycles: Sort tiles in rendering order at construction time
This commit modifies the TileManager to sort render tiles once after tiling the image,
instead of searching the next tile every time a new tile is acquired by a device.

This makes acquiring a tile run in constant time, therefore the render time is linear
w.r.t. the amount of tiles, instead of the quadratic dependency before.

Furthermore, each (logical) device now has its own Tile list, which makes acquiring
a tile for a specific device easier.
Also, some code in the TileManager was deduplicated.

Reviewers: dingto, sergey

Differential Revision: https://developer.blender.org/D1684
2015-12-23 13:14:36 +01:00
Thomas Dinges
887829e3d8 Cleanup: Remove comments, now that we have the dedicated constant fold functions, it's obvious. 2015-12-22 14:02:57 +01:00
Thomas Dinges
377b52be2e Cycles: Constant fold for the Gamma Node. 2015-12-22 13:53:13 +01:00
Campbell Barton
32be51dc66 Cleanup: warnings (msvc)
Part of patch D1670 by @LazyDodo
2015-12-21 13:02:38 +11:00
Sergey Sharybin
82921ce420 OpenSubdiv: Avoid having bad-level call
This is always asking for problems. Additionally, that call was leading
to OpenGL calls happening from threads.
2015-12-18 23:16:52 +05:00
Sergey Sharybin
672f2efbe6 Cycles: Log OSL texture system statistics after finishing the render 2015-12-18 21:50:30 +05:00
Sergey Sharybin
349affe370 Cycles: Implement proper texture derivatives evaluation for OSL
This was an oldie TODO since initial work on newer OSL/OIIO support.
Now we should be ready for the libraries bump.
2015-12-18 21:50:30 +05:00
Jorge Bernal
ee59df521f BGE clean up: use float version of trigonometric functions 2015-12-16 01:53:48 +01:00
Sergey Sharybin
5b33115070 Cycles: Fix wrong assert failure happening after recent de-duplicate
This is actually intended behavior to return NULL when the socket is not
found. It's used in certain BSDF nodes to query whether some inputs exists
or not.

Perhaps we can be more explicit here and have dedicated logic to query
socket existance and keep assert in place.

In any case, even if we lost assert() for the constant fold now it's
still somewhat better than duplicated code. Perhaps.
2015-12-15 21:01:56 +05:00
Sergey Sharybin
baaf10cb26 Cycles: De-duplicate utility functions in ccl::Graph 2015-12-15 20:04:35 +05:00
Ines Almeida
46218dc9f9 Fix: unreported crash with misconfigured nvidia opengl drivers 2015-12-13 10:36:52 +00:00
Jorge Bernal
0dcca69589 Moto Clean-up: double-promotion warnings 2015-12-13 02:56:30 +01:00
Porteries Tristan
6329e20cbb BGE: Use float as default instead of double in Moto library.
Use float in moto instead of double for MT_Scalar.
This switch allow future optimization like SSE.
Additionally, it changes the OpenGL calls to float versions as they are
very bad with doubles.

Reviewers: campbellbarton, moguri, lordloki

Reviewed By: lordloki

Subscribers: brecht, lordloki

Differential Revision: https://developer.blender.org/D1610
2015-12-13 02:09:05 +01:00
37c6a207ce Memutil: remove some unused code. 2015-12-11 01:48:26 +01:00
c7122b5391 IK Solver: remove unused and outdated test code. 2015-12-11 01:42:41 +01:00
8a66d4966a Moto: remove some unused code. 2015-12-11 01:40:56 +01:00
6e4802d712 IK Solver: replace TNT math library with Eigen.
Performance is about the same or slightly better for typical IK chains.
In extreme cases with many bones and multiple targets, of which some are
unreachable, I've seen 2x speedups.
2015-12-11 00:59:00 +01:00
aaa627d5f5 IK solver: replace Moto math library with Eigen. 2015-12-11 00:59:00 +01:00
Campbell Barton
5f0cf67882 Cleanup: quiet warning 2015-12-10 21:18:50 +11:00
f9047c3f8c Eigen: fold remaining OpenNL code into intern/eigen.
Differential Revision: https://developer.blender.org/D1662
2015-12-10 01:58:10 +01:00
858b680a50 Eigen: move C API into intern/eigen. 2015-12-10 01:58:06 +01:00
Sergey Sharybin
19dba67d15 Cycles: Comment out unused arguments 2015-12-09 18:38:02 +05:00
Mike Erwin
d7851b87a7 remove a debug printf 2015-12-08 20:13:45 -05:00
Mike Erwin
6006173f4a OpenGL: use sized texture internal formats
Maybe this is pedantic but I read it’s best to explicitly set the
desired component size.

Also append “_ARB” to float texture formats since those need an
extension in GL 2.1.
2015-12-08 01:19:55 -05:00
Martijn Berger
de0672436b Add support for compiling the cuda kernel on the Nvidia Jetson TX1 2015-12-07 17:51:24 +01:00
Mike Erwin
a048d5f945 OpenSubdiv: refine OpenGL version & extension checks
Use new GPU_legacy_support() function.

Determine GLSL version once instead of per shader.

For Texture Buffers, allow ARB or EXT version of the extension. Either
one will do.
2015-12-06 18:47:58 -05:00
Mike Erwin
1858823d3b OpenGL: request version 2.1 when creating context on Windows
In practice this gives us a context that is *compatible* with GL 2.1. On
my machine it gives a GL 3.3 or 4.3 compatibility profile context,
depending on graphics card installed.

Also fixed enum for core profile (not used yet).

Also added option for GL 3.2 compatibility profile. This will be useful
during Blender 2.8 development, until we are able to use the core
profile. On my machine this gives exactly a GL 3.2 compatibility profile
context, not 3.3 or 4.
2015-12-06 18:02:07 -05:00
Mike Erwin
ffabd037bb OpenSubdiv: disable TF on lower GL versions. Fixes T46794
My previous edit to this check was too lax.

OSD's shader for the Transform Feedback evaluator declares itself
#version 410 so disable the feature if user's GL < 4.1.
2015-12-06 18:02:06 -05:00
Thomas Dinges
a3d774e4c9 Cycles: Fold Value and RGB node as well.
This way, connecting Value or RGB node to e.g. a Math node will still allow folding.

Note: The same should be done for the ConvertNode, but I leave that for another day.
2015-12-06 23:47:38 +01:00
Sergey Sharybin
ed5dbb0a7b Cycles: Implement extrapolation for RGB curves
Previously RGB Curves node will clamp input to 0..1 which is rather useless
when one wants to use HDR image textures and do bit of correction on them.

Now kernel code supports extrapolation of baked LUT based on first/last two
table points and performs linear extrapolation.

The only tricky part is to guess the range to bake the LUT for. Currently
it's using simple approach -- minmax of the input curves. While this behaves
ok for the simple cases it's easy to trick the system up causing incorrect
results.

Not sure we can solve those issues in a general case and since the new code
is giving more expected results it's not that bad actually. In the worst
case artist migh always create explicit point to make sure LUT is created
for the needed HDR range.

Reviewers: brecht, juicyfruit

Subscribers: sebastian_k

Differential Revision: https://developer.blender.org/D1658
2015-12-06 01:21:14 +05:00
Bastien Montagne
76d1201996 Fix OSL shaders building with some versions of that lib.
This must have happened months ago, but as I did not `make clean` any build folder since then,
so only noted that today.

Issue is same as dirty patch we have to apply to ODL sources before building it in install_deps.sh - for
some mysterious reason, it has become impossible to compoile .osl files into .oso ones without
giving explicit output file name (otherwise it just produces `.oso` file - utterly stupid and useless).

We could probably fix that in own OSL source, but think being explicit here does not hurt anyway, so...
Let's go the easy way.
2015-12-05 00:17:04 +01:00
Sergey Sharybin
6552d5bebd Cycles: Avoid recursion when doing constant fold
This reduces stress on the the stack memory which could be really handy
on certain operation systems which applies strict limits on the stack.

Reviewers: brecht, juicyfruit, dingto

Reviewed By: brecht, juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1656
2015-12-02 16:19:39 +05:00
Sergey Sharybin
d0a9ec5efc Cycles: Fix SSS object not properly reflected in glossy object with indirect clamping
This fixes remained issues reported in T46908.
2015-12-02 16:00:01 +05:00
Jörg Müller
3cd36f85b0 Fix T46815: Changing playback setting makes blender crash
Copied the fix from upstream audaspace.
2015-12-02 10:23:07 +01:00
Campbell Barton
fc9505c9c5 Cleanup: warnings & spelling 2015-12-02 13:15:52 +11:00
Sergey Sharybin
a6bbf05ba6 Cycles: Fix wrong SSS intersection refinement when this option is disabled
The code is disabled by default, but we'd better keep it all correct.
2015-12-02 03:14:54 +05:00
Sergey Sharybin
e82876589f Cycles: Fix wrong SSS on scaled instanced objects
Was a mistake on searching refined position form ray and hit distance.

Remember kids: SSS distance is in the object space!
2015-12-02 03:13:19 +05:00
Sergey Sharybin
70502578b1 Cycles: Remove TODO, it is possible there'll be more intersections recorded
It's just only few of them will be stored in the intersection array, nothing
wrong with that what's so ever.
2015-12-02 02:39:57 +05:00
Thomas Dinges
e5e1010919 Cleanup: Remove some more code for BVH cache. I missed that somehow. 2015-12-01 18:17:28 +01:00
Lukas Stockner
8512e284a0 Fix T46906: Cycles syntax error while compiling OpenCL kernels
The safe normalization was using a float as a condition, now the intended non-zero test is explicit.
2015-12-01 13:53:29 +01:00
Sergey Sharybin
607150d058 Fix T46898: OpenCL Fails to compile after recent SSS changes 2015-12-01 13:55:40 +05:00
Campbell Barton
5bfc32bab4 Cleanup: warning w/ unknown define 2015-11-30 11:03:49 +11:00
Sergey Sharybin
2ae7593700 Cycles: Avoid having two consequence getenv() calls 2015-11-28 21:05:12 +05:00
Sergey Sharybin
6147c4037d Cycles: Fix wrong volume stack after SSS bounce
Was introduced by a recent fixes, now it should be all correct and additionally
it solves the TODO mentioned in the code.
2015-11-28 20:07:34 +05:00
Sergey Sharybin
f5d1551b6e Cycles: Fix wrong original ray used for SSS baking
Also de-duplicated some code by moving to an utility function.
2015-11-28 20:07:34 +05:00
Sergey Sharybin
1e43f0d742 Cycles: Set of fixes for delayed SSS ray tracing
There were multiple issues which are solved now:

- It was possible that ray wouldn't be bounced off the BSSRDF, for example
  when PDF or shader eval is zero. In this case PathState might have been
  left in pre-bounced state which would have been gave incorrect shading
  results.

  This is solved by having separate PathState for each of the hits.

- Path radiance summing wasn't happening correct as well, indirect rays
  were using wrong path radiance in the case when there were more than
  one hit recorded.

  This is now using a bit trickier state machine which calculates path
  radiance for just SSS (both direct and indirect) and then sums it back
  to the final radiance.

- Previous commit wasn't totally correct either and was an induced bug
  due to wrong path state left from the "un-happened" ray bounce.

  There should be no special case happening here, BSSRDFs will be replaced
  with diffuse ones due to PATH_RAY_DIFFUSE_ANCESTOR flag.

- Merged back codebases for "delayed" and "immediate" indirect SSS ray
  tracing, hopefully making it easier to maintain the codebase.

Sure this changes brings memory usage back by about 4-5%, but overall
it's still about 2x memory reduction for the experimental kernel here.

Thanks Brecht for the review!
2015-11-28 20:07:34 +05:00
Sergey Sharybin
8919ed3a62 Cycles: Fallback to diffuse BSDF for the indirect SSS rays when BSSRDF is hit
This is actually how it was intended to work, just didn't notice it wasn't
really happening in the main ray loop.

Solves some memory issues reported in T46880.
2015-11-28 20:07:34 +05:00
Sergey Sharybin
299fae1838 Cycles: Fix missing indirect subsurface initialization in the bake code 2015-11-28 20:07:34 +05:00
Sergey Sharybin
20fc9c00fd Cycles: Fully roll-back to non-delayed SSS indirect rays for CPU
There are some issues to be solved with the recent optimization we did for
the indirect rays for the SSS. Those issues will take a bit of a time to
be fully solved still and we need to unlock Caminandes team now, so let's
revert some changes back.

CUDA will still use delayed indirect rays since it's an experimental
feature.

For the details about what's to be done still please refer to T46880.
2015-11-27 17:15:02 +05:00
Sergey Sharybin
175f00c89a Revert "Cycles: Fix wrong SSS with regular path tracing and clamping enabled"
This wasn't really a complete fix and only worked if there was a single scatter
event recorded only. Proper fix requires some more thoughts to make it correct
without memory use increase.

This reverts commit bf9e88bfbebaf5c6228363560970fa526e779c8b.
2015-11-27 17:15:02 +05:00
Sergey Sharybin
bf9e88bfbe Cycles: Fix wrong SSS with regular path tracing and clamping enabled
Radiance sum and reset was happening in different order after 26f1c51.

This is a quick fix to unlock Caminandes team, perhaps we can avoid having
separate variable to detect when radiance is to be sum.
2015-11-26 16:11:41 +05:00
Stefan Werner
c8a041f489 Fix T46760: Branched Path Tracing converges to different result than plain Path Tracing
Multiple importance sampling for branched path tracing light samples needs to be
calculated separately per BSDF, not with Veach's one sample model.
2015-11-26 14:59:58 +05:00
b2a4aab9e4 Fix T46848: more OpenNL crashes due to uninitialized variables. 2015-11-25 20:31:52 +01:00
Sergey Sharybin
bbd33b3a8e Cycles: Create proper sockets for OSL script nodes
Previously render nodes will be always created with just a VECTOR socket
type and then those sockets will try to be set as all point, vector and
normal to work around lack of such a subtype distinguishing in blender.

This change makes it so subtype is being queried from OSL itself and
proper subtupe is being used for socket.

It's still not in use for the official builds because it requires changes
applied recently on the 1.7 branch of OSL:

  https://github.com/imageworks/OpenShadingLanguage/commit/f70e58f

This solves artists confusion reported in T46117.

Reviewers: #cycles, juicyfruit

Reviewed By: #cycles, juicyfruit

Subscribers: juicyfruit

Differential Revision: https://developer.blender.org/D1627
2015-11-25 20:23:52 +05:00
Sergey Sharybin
2700ab1de1 Cycles: Whitespace cleanup from the recent changes 2015-11-25 20:15:35 +05:00
Sergey Sharybin
1bec2aa54e Cycles: Fix crash in constant folding introduced by recent commit
Graph::disconnect() actually modifies links, needs to create a copy to iterate
if disconnect happens form inside the loop.

Question tho whether we can control this somehow..

Reported by BzztPloink in IRC, thanks!
2015-11-25 20:14:01 +05:00
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
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
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
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
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
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
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
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
d28431a648 OpenNL: make the API thread safe by always passing context.
Previously two laplacian smooth or deform modifiers executing
simultaneously could crash.
2015-11-22 22:49:43 +01:00
47ce2d7bef OpenNL: significantly simplify code using Eigen / STL. 2015-11-22 22:49:03 +01:00
e6c58df74e OpenNL: replace SuperLU by Eigen SparseLU solver.
Performance is roughly the same because it's using the same COLAMD ordering
and supernodal LU factorization algorithms. Solve results also appear to be
identical.
2015-11-22 22:49:03 +01:00
5e52433371 OpenNL: convert source file to C++, remove some unused functions. 2015-11-22 22:49:03 +01:00
Antony Riakiotakis
db1f0e3616 Error out on Windows if driver does not support OpenGL 2.1 with an error
messagebox.
2015-11-22 20:53:57 +01:00
Antony Riakiotakis
8623d75b46 Add check for OpenGL version 2.1 on linux.
Unfortunately there's no easy way to show a messagebox here, so just
print a warning on fstderr and exit. If we don't call exit() here we get
crashes on other blender systems (python, opensubdiv) and it can get
tricky to track the initialization state here, so just using exit()
should do the trick for now.
2015-11-22 18:14:46 +01:00
Sergey Sharybin
56ead9d34b Cycles: Make branched path tracer covered with requested features
This gives few percent extra memory saving for the CUDA kernel when
using regular path tracing.

Still more like an experiment, but will be handy in the future.
2015-11-22 13:54:51 +05:00
Lukas Stockner
5c5df9dc18 Cycles: Save one transform inversion in the camera sync
Summary: By calculating the Camera-to-Screen-Matrix first, one inversion can be saved in the Camera sync.
It won't really improve speed and/or precision, it's mainly a small cleanup.

Reviewers: sergey, dingto

Subscribers:
2015-11-22 00:58:40 +01:00
Sergey Sharybin
f547bf2f10 Cycles: Make requested features struct aware of subsurface BSDF
This way we'll be able to disable SSS for the scene-adaptive kernel.
2015-11-21 23:00:29 +05:00
Sergey Sharybin
c08727ebab Cycles: Quick experiment with using feature-adaptive kernels for CUDA
Gives few percent of memory improvement for regular feature set kernel
and could give significant memory improvement for Experimental kernel.
It could also give some degree of performance improvement, but this I
didn't really measure reliably yet.

Code is ifdef-ed for now, since it's only working on Linux and requires
CUDA toolkit to be installed (other platform only use precompiled
kernels).

This is just an experiment for now and a base for the proper feature
support in the future (with runtime compilation using CUDA 7?).
2015-11-21 22:16:01 +05:00
Sergey Sharybin
f8ab3fd30f Cycles: add utility function to calculate MD5 hash of a given string 2015-11-21 22:07:59 +05:00
Sergey Sharybin
52d7bc624a Cycles: Make CUDA device internally operate with requested features
This just replaces internal argument `experimental` with `requested_features`
making it possible to access particular requested settings when building
kernels.
2015-11-21 21:49:00 +05:00
Sergey Sharybin
a106da7f1d Cycles: Move build options constructions to DeviceRequestedFeatures
This way it's easier to re-use requested features logic across multiple
device implementations.
2015-11-21 21:42:31 +05:00
Sergey Sharybin
9aafec1ce1 Cycles: Avoid multiple spaces in OpenCL build options
This should solve some compilation errors with compilation on OSX.
2015-11-21 21:33:08 +05:00
Sergey Sharybin
7e71be261b Cycles: Fix filter glossy being broken after recent changes
Basically we can not use sharp closure as a substitude when filter glossy is
used. This is because we can not blur sharp reflection/refraction.

This is quite quick and not really clean implementation. Not really happy
with manual handling of original settings, but this is as good as we can do
in the quick patch. It's a good acknowledgment and we now can re-consider
some aspects of graph simplification to make such cases more natively
supported.

P.S. This failure would have been shown by our regression tests, so please,
bother a bit to run Cycles's test sweep before doing such optimizations.
2015-11-20 18:18:27 +05:00
Campbell Barton
ae8e4d3718 Cleanup: redundant 'break', minor edits 2015-11-19 22:52:13 +11:00
Thomas Dinges
eeed28fefc Fix T46818, crash with Glossy node on Windows. 2015-11-19 08:43:43 +01:00
Lukas Stockner
8dea06565f Cycles: Add Blackman-Harris filter, fix Gaussian filter
This commit adds the Blackman-Harris windows function as a pixel filter to Cycles. On some cases, such as wireframes or high-frequency textures,
Blackman-Harris can give subtle but noticable improvements over the Gaussian window.
Also, the gaussian window was truncated too early, which degraded quality a bit, therefore the evaluation region is now three times as wide.
To avoid artifacts caused by the wider curve, the filter table size is increased to 1024.

Reviewers: #cycles

Differential Revision: https://developer.blender.org/D1453
2015-11-18 20:50:06 +01:00
Thomas Dinges
0639ba8ea5 Cycles / Shader graph: Fallback to Sharp closures for very small roughness.
We fallback to Sharp closures for Glossy, Glass and Refraction nodes now, in case the Roughness input is disconnected and 0 (< 1e-4f to be exact).
This way we gain a few percentages of performance, in case the user did not manually set the closure type to "Sharp" in the UI.

Sharp will probably be removed from the UI as a followup, not needed anymore with this internal optimization.

Original idea by Lukas Stockner(Differential Revision: https://developer.blender.org/D1439), code implementation by myself.
2015-11-18 18:47:56 +01:00
Thomas Dinges
836c69c92f Cleanup: Add some notes in code for upcoming graph simplification process. 2015-11-18 17:20:39 +01:00
Thomas Dinges
38bbc920a6 Cycles: Add utility functions to get a ShaderInput / ShaderOutput by name. 2015-11-18 17:12:26 +01:00
Campbell Barton
dc14629b26 GHOST: rename suffix X11 to Unix for non X11 files
We may use these for Wayland or SDL back-ends.
2015-11-16 21:57:05 +11:00
Mike Erwin
21195a9ea4 check compute shader support for OpenSubdiv
Built into OpenGL 4.3, or 4.2 plus ARB_compute_shader extension.
2015-11-15 23:15:00 -05:00
Mike Erwin
f9e8de0b26 minor cleanup: spelling/wording 2015-11-14 13:48:15 -05:00
Mike Erwin
f34cb5ab5a tweak GL extension check for OpenSubdiv drawing
Once we adopt GL 3.2 across Blender, the check will be:

return GLEW_VERSION_4_0 || GLEW_ARB_gpu_shader5;
2015-11-14 13:43:39 -05:00
Mike Erwin
46478ad2bc enable OpenSubdiv Transform Feedback on Intel
Fixed extension check.

This feature requires ARB_texture_buffer_object which was subsumed into
OpenGL 3.0. Intel driver on Windows doesn't claim to support this
extension, but GL version is > 3 so it actually does work.
2015-11-14 13:34:41 -05:00
Mike Erwin
175f8e49e7 enable OpenSubdiv on Intel graphics
Tested working on Haswell i5-4670 running Windows 10.
2015-11-14 13:27:09 -05:00
Sergey Sharybin
b3184640fe OpenSubdiv: Enable GLSL Compute for AMD devices
There was a bug in OpenSubdiv library which is now fixed by updating library in
the build environments.

Still requires testing, but now being at the beginning of release cycle is
should be safe to simply enable option and let everyone to test :)
2015-11-10 12:16:18 +05:00
Campbell Barton
cfbbf72d89 Revert "Increase CMake minimum version to 3.0"
This reverts commit ff3cf93405e63fa367f64412bcfe96b382b24b38.

Turns out distros only a year old still use CMake 2.8x
2015-11-10 02:53:10 +11:00
Campbell Barton
ff3cf93405 Increase CMake minimum version to 3.0
This allows us to use newer features of CMake, and less hassles having to test & support older versions.
2015-11-09 23:37:53 +11:00
Jörg Müller
8c25c1c484 Fix T46683: High pitch sound artifact on import of 48k audio
The bug header is wrong, the file contains the high pitched sound, but the bug that existed was that animation rendering did not use the high quality resampler, while audio mixdown does.
Blender uses the low quality resampler to be as little CPU consuming as possible.
2015-11-03 19:34:33 +01:00
Sergey Sharybin
537bd0eb51 Fix T46671: Cycles assert with CMJ sample function
With current formulation of cmj_fast_div_pow2() it should always return 0
in the case of first argument is zero and no assert really needed anymore.
2015-11-03 18:49:27 +05:00
Sergey Sharybin
9bce104c8c Cycles: Partially revert previous commit
Apparently removing kernel arguments broke NVidia OpenCL.

Needs more investigation, for the time being revering changes which caused problem.
2015-11-01 21:01:12 +05:00
Sergey Sharybin
dc9e0b819b Cycles: Remove unused argument from the split kernel functions
Should be no functional changes, just simplifies operation with kernels.
2015-11-01 17:22:42 +05:00
Sergey Sharybin
84e8b05e97 Cycles: Minor code style cleanup 2015-11-01 15:40:17 +05:00
Sergey Sharybin
a43e087fb8 Cycles: Add split kernel headers to project generation 2015-10-31 04:08:19 +05:00
Sergey Sharybin
cb1cb63d40 Cycles: Fixes for few typos in OpenCL kernel 2015-10-30 23:31:24 +05:00
Sergey Sharybin
537f41250f Cycles: Fix typo in split kernel
Shadow blocked kernel was using wrong array for storing intersection.
2015-10-29 21:52:56 +05:00
Sergey Sharybin
3300b1f232 Cycles: Add option to force mega kernel to be used
This way it's possible to test mega kernel on various hardware.

That being said mega kernel seems to work on Fiji card here in the studio.
2015-10-29 21:52:56 +05:00
Sergey Sharybin
4ca688a963 Cycles: OpenCL split kernel cleanup, move casts from .h files to .cl files
Ideally we shouldn't use char* at all, but for now we have to, so at least
let's assume common .h files are free from pointer magic.
2015-10-29 21:52:56 +05:00
Sergey Sharybin
0e76c52033 Cycles: Fix compilation error with MSVC 2015-10-28 17:33:31 +05:00
Sergey Sharybin
b909dfdae1 Cycles: Expose user-defined shutter curve to the interface
Shutter curve now can be controlled using curve mapping widget in the motion
blur panel in Render buttons. Only mapping from 0..1 by x axis are allowed,
Y values will be normalized to fill in 0..1 space as well automatically.

Y values of 0 means fully closed shutter, Y values of 1 means fully opened
shutter.

Default mapping is set to old behavior when shutter opens and closes instantly.

This shutter mapping curve could easily be used by any other render engine by
accessing scene.render.motion_blur_shutter_curve.

Reviewers: #cycles, brecht, juicyfruit, campbellbarton

Differential Revision: https://developer.blender.org/D1585
2015-10-28 02:43:06 +05:00
Sergey Sharybin
6a529e14f4 Cycles: Support user-defined shutter curve
Previously shutter was instantly opening, staying opened for the shutter time
period of time and then instantly closing. This isn't quite how real cameras
are working, where shutter is opening with some curve. Now it is possible to
define user curve for how much shutter is opened across the sampling period
of time.

This could be used for example to make motion blur trails softer.
2015-10-28 02:43:06 +05:00
Sergey Sharybin
c07c066685 Cycles: Use new CDF evaluation utility for the pixel filter
Filter table should stay exactly the same, no changes in the render
results are expected at all.
2015-10-28 02:43:06 +05:00
Sergey Sharybin
548ef2d88b Cycles: Add utility functions to evaluate CDF of a given functor 2015-10-28 02:43:06 +05:00
Thomas Dinges
85876923bf Cleanup: Remove ToDo comment.
I don't see how this could conflict, madd() in util_ssef.h has a different function signature.
2015-10-26 11:52:24 +01:00
Thomas Dinges
aa49c16bd9 Cleanup: Avoid some warnings on OS X with clang and update comment. 2015-10-26 11:52:24 +01:00
Thomas Dinges
72592cfbe0 Cleanup: Move pixel aspect to blender_camera_init(). 2015-10-26 11:52:24 +01:00
Mike Erwin
c3cec828e8 ndof: rework Mac driver glue
Load driver dynamically at runtime instead of weak-linking the
3Dconnexion framework. Driver no longer needed at build time!

Works with really old drivers (as in PowerMac old), more recent
versions, and the latest which allows us to process events on a
separate thread.
2015-10-25 21:19:26 +01:00
Campbell Barton
d04ad07f98 Quiet audaspace unused macro warnings 2015-10-23 18:40:42 +11:00
Sergey Sharybin
47b1279762 Cycles: Watertight fix for SSS intersection
Same as previous commit, just was missing in there.
2015-10-22 22:10:40 +05:00
Sergey Sharybin
f84cbae43e Cycles: Fix for watertight intersection
It was possible to miss some intersection caused by wrong barycentric
coordinates sign.

Cases when one of the coordinate is zero and other are negative was not
handled correct.
2015-10-22 22:07:28 +05:00
Bastien Montagne
6bc0076102 Usual i18n tweaks & fixes... 2015-10-20 20:08:37 +02:00
Sergey Sharybin
2746bbe30e Fix T46493: Wrong camera zoom blur with non-unit pixel aspect 2015-10-15 19:33:02 +05:00
Sergey Sharybin
5d3e07862c Cycles: Add support for motion blur position
This adds an option to control at what time relative to the current frame
the shutter is fully opened. Supported options are:

- Shutter is starting to open at the current frame
- Shutter is fully opened at the current frame
- Shutter is fully closed  at the current frame

Custom shutter time offset is possible, same as custom curve for shutter
openness but those are considered nice things to have rather than something
crucial.

Reviewers: juicyfruit, dingto

Subscribers: venomgfx, hjalti

Differential Revision: https://developer.blender.org/D1380
2015-10-13 21:05:27 +05:00