Commit Graph

5822 Commits

Author SHA1 Message Date
Lukas Tönne 5aa19be912 Merge branch 'temp_remove_particles' into blender2.8 2016-05-02 11:00:26 +02:00
Sergey Sharybin c1ca667d4a Fix compilation error on Armel architecture
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_n are not defined on this architecture
for some reason, however those functions are available.

Adding a workaround for newly used __sync_fetch_and_and() function.
2016-05-02 09:55:08 +02:00
Brecht Van Lommel 1422f0dd16 Fix Cycles external OSL shader not working with relative file paths. 2016-05-01 01:44:52 +02:00
Campbell Barton ac163447f8 Cleanup: warnings. spelling 2016-04-30 04:10:34 +10:00
Sergey Sharybin 3e32f8e601 Fix T48298: Cycles World environment Texture node, movie doesn't update frame 2016-04-29 10:54:40 +02:00
Brecht Van Lommel 636195e402 Fix T48301: Cycles incorrect render with CMJ and viewport samples 0.
Max samples 2147483647 was causing integer overflow.
2016-04-28 23:57:20 +02:00
Lukas Tönne 1f723603c8 Merge branch 'master' into temp_remove_particles 2016-04-28 17:33:19 +02:00
Sergey Sharybin f172f2b146 Cycles: Improve logging about motion blur a bit 2016-04-26 16:17:11 +02:00
Sergey Sharybin 6a7378f50f Cycles: Proper pack of leaves which are bigger than single float4 2016-04-25 18:57:37 +02:00
Sergey Sharybin 42fd1b9abe Cycles: Fix issues with stack allocator in MSVC
Couple of issues here:

- Was a bug in heap memory allocation when run out
  of allowed stack memory.

- Debug MSVC was failing because it uses separate
  allocator for some sort of internal proxy thing,
  which seems to be unable to be using stack memory
  because allocator is being created in non-persistent
  stack location.
2016-04-25 13:50:27 +02:00
Sergey Sharybin 34f4c31692 Cycles: Move vector re-allocation out of loops 2016-04-25 12:25:30 +02:00
Sergey Sharybin 975a224f12 Cycles: Don't pass RNA pointers by vlaue 2016-04-25 10:04:06 +02:00
Campbell Barton a3d67456cd GHOST/X11: print description of error event 2016-04-23 18:44:17 +10:00
Brecht Van Lommel 23a9fede69 Fix T48216: Cycles light fallof node gives black emission in baking. 2016-04-23 02:59:40 +02:00
Kévin Dietrich a9729e6d75 Fix T48236: OpenVDB smoke cache glitches out with smokeless flames.
Issue was that before writing to disk grids are clipped against the
density field's tree to optimize for memory/disk space, which in the
case of simulations with no density field results in all grids having
empty trees.

For now avoid clipping against empty grids, but perhaps in the future it
can be interresting to have some UI parameters to let the user choose
the grid used for clipping.
2016-04-22 11:46:02 +02:00
Sergey Sharybin 87dcee0c0c Silence some annoying warnings when doing full build with strict flags
This mainly touches extern libraries and few debug-only places in intern.

Some summary:

- External libraries are not strict at all about missing declarations,
  so we can rather safely remove such warning together with other strict
  flags.

- Bullet has some static functions which are not used.
  Those were commented out.

- Carve now has some unused debug-only functions commented out as well.
  While we're on the way of getting rid of Carve, it makes sense to make
  things a bit cleaner for the time being.

- In LZMA we have some parts disabled which gives some set but unused
  variables which is rather correct.

- Elbeem had quite some variables set and never used because their usage
  is inside of debug-only code which is commented out.

Note about patching upstream libraries: surely one might say that we
have to make local patchset against this, but own experience says it
only gives extra work trying to merge such tweaks to a new upstream
version and usually it's just faster to re-apply such fixes again after
bundling new upstream library.
2016-04-22 10:59:15 +02:00
Sergey Sharybin d2cb0f955b Cycles: Reduce verbosity of logging
Mainly makes logging less verbose when doing progressive sampling in viewport.

Such kind of verbosity is not really possible to be filtered out with `grep`
so let's reshuffle few lines of code.
2016-04-22 10:55:26 +02:00
Sergey Sharybin 31632e7f74 NDof device: Check for socket exists before connecting to spnavd
This allows us to get rid of annoying and misleading error printed to the console
about being unable to connect to something.
2016-04-22 10:14:30 +02:00
Sergey Sharybin 9bd1c8caf7 Cycles: Multi-thread object transform update
Simple idea, use threads when dealing with "Copying Transformations to device"
scene update step. Only do it if there's enough objects in the scene.

Hopefully only brings less synchronization time and doesn't break anything.

From tests on my desktop this brings down transform update time from 58sec to
11sec on victor_cpu.blend scene from out benchmark.
2016-04-20 18:17:24 +02:00
Lukas Tönne 3632c4997f Merge branch 'master' into temp_remove_particles 2016-04-20 16:25:16 +02:00
Sergey Sharybin 02213b867e Cycles: Stop rendering when bad_alloc happens
This is an attempt to gracefully handle out-of-memory events
and stop rendering with an error message instead of a crash.

It uses bad_alloc exception, and usually i'm not really fond
of exceptions, but for such limited use for errors from which
we can't recover it should be fine.

Ideally we'll need to stop full Cycles Session, so viewport
render and persistent images frees all the memory, but that
we can support later, since it'll mainly related on telling
Blender what to do.

General rules are:

- Use as less exception handles as possible, try to find a
  most geenric pace where to handle those.

  For example, ccl::Session.

- Threads needs own handling, exception trap from one thread
  will not catch exceptions from other threads.

  That's why BVH build needs own thing.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

Differential Revision: https://developer.blender.org/D1898
2016-04-20 16:19:49 +02:00
Sergey Sharybin e3544c9e28 Cycles: Throw bad_alloc exception when custom allocators failed to allocate memory
This mimics behavior of default allocators in STL and allows all the routines
to catch out-of-memory exceptions and hopefully recover from that situation/
2016-04-20 15:49:52 +02:00
Sergey Sharybin d7e4f920fd Cycles: Use threads to sort reference arrays when searching for split
This commits implements threaded sorting of references when looking for
object spatial split. It mainly useful when doing initial binning, which
happens from main thread.

Gives nice speedup of BVH build for Bunny.blend: 36sec vs. 55sec for
the Rabbit mesh BVH build.

On more complex scenes the speedup is probably minimal, but still nice
to have more instant rendering for simplier scenes.

Some further tests with production scenes would be interesting.

Reviewers: juicyfruit, dingto, lukasstockner97, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1928
2016-04-20 15:21:44 +02:00
Sergey Sharybin 96dc96f0a5 Cycles: Avoid reference copy 2016-04-20 15:03:39 +02:00
Sergey Sharybin e50d229273 Fix T47794: Point density sometime seems stretched when rendered on GPU 2016-04-20 14:42:19 +02:00
Sergey Sharybin b9d9d93ff9 Fix T48162: GPU render gives wrong results in certain volume setups
ideally this part of code should be de-duplicated across __VOLUME_INTERSECT_ALL
and regular code.
2016-04-20 13:49:54 +02:00
Sergey Sharybin 4cdd6b9bdd Fix T47812: GPU renders have warmer colors than CPU renders
Seems was a mistake in f2c54df, volume attributes are not supposed to
have repeated texture type.
2016-04-20 12:29:08 +02:00
Lukas Tönne 773efb506a Removed particle sync code from Cycles.
Note that this only removes the actual dependencies of Cycles on the
particle code in Blender, but not the internal "particle" definition
or the curve type handling inside Cycles. These structures may be in need
of some improvement themselves, but that is out of scope here.
2016-04-20 11:59:02 +02:00
Sergey Sharybin 9b48f2b27c Cycles: Improvements and fixes for the resumable render
- Fix wrong current sample reported in the log
- Also includes fix for progressive refine log
- Explicitly print to the stdout that resumable render is enabled
- Print error message and abort when passing wrong values for the
  resumable render. Never waste someone's compute power for wrong
  render!

Fixes T48185: Cycles resumable num chunks breaks sample counter
2016-04-19 12:56:33 +02:00
Mai Lavelle 3068ea34e4 Cycles microdisplacement: add max subdivision setting
This is to prevent situations such as when the camera gets very close to a mesh
and causes it to be tessellated into an excessive amount of micropolygons. In
REYES this is known as the eye-splits problem.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1922
2016-04-18 22:47:24 +02:00
Mai Lavelle 71588300d2 Cycles microdisplacement: fix handling of triangles in DiagSplit
Theres still more room for improvement but this makes things useable.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1921
2016-04-18 22:31:12 +02:00
Mai Lavelle 9f39619dda Cycles microdisplacement: scene level render and preview dicing rates
This makes it easier to control overall dicing rate without having to tweak
every object. The preview rate makes viewport editing more interactive. The
default preview rate of 8 is roughly 64 times faster for some operations.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1919
2016-04-17 20:38:50 +02:00
Brecht Van Lommel 1dfbcd88d5 Fix a few compiler warnings with OS X / clang. 2016-04-17 01:05:50 +02:00
Thomas Dinges 557544f2c4 Cycles: Refactor Image Texture limits.
Instead of treating Fermi GPU limits as default,
and overriding them for other devices,
we now nicely set them for each platform.

* Due to setting values for all platforms,
we don't have to offset the slot id for OpenCL anymore,
as the image manager wont add float images for OpenCL now.

* Bugfix: TEX_NUM_FLOAT_IMAGES was always 5, even for CPU,
so the code in svm_image.h clamped float textures with alpha on CPU after the 5th slot.

Reviewers: #cycles, brecht

Reviewed By: #cycles, brecht

Subscribers: brecht

Differential Revision: https://developer.blender.org/D1925
2016-04-16 20:49:59 +02:00
Thomas Beck 64c7306cdb Cycles: Insert util_texture.h in CMakeLists to make Cycles compile again after recent refactory. 2016-04-16 11:58:38 +02:00
Thomas Dinges 9c916b0172 Cleanup: Move texture definitions to util, to avoid bad level include. 2016-04-15 23:02:44 +02:00
Lukas Tönne fbed29a246 Merge branch 'master' into temp_remove_particles 2016-04-15 17:59:54 +02:00
Sergey Sharybin 3165e8740b Fix T48139: Checker texture strange behavior in cycles
Seems particular CUDA implementations has some precision issues,
which made integer coordinate (which was expected to always be
positive) to go negative.
2016-04-15 15:30:30 +02:00
Sergey Sharybin 3130f4167d Cycles: Optimization to spatial BVH build
Simple fix: release lock earlier.

Reduces spatial split build time from 96 to 53sec on the Bunny.blend
(using studio Intel for benchmark).

NOTE: Timing difference is not that spectacular when comparing numbers
with builds before memory optimization, but even then it's about 20%
faster build.
2016-04-15 14:35:42 +02:00
Sergey Sharybin f951cc36e2 Cycles: Support heat volume attribute
Similar to velocity, it was kind of supported by the mesh manager but
was missing a code in BlenderSession to get actual values.

In Cycles Heat is an attribute which goes from -1 to 1, where -1 is
the coldest ever temperature, 1 is the hottest ever one.
2016-04-15 12:02:31 +02:00
Sergey Sharybin a52b4378b2 Cycles: Improve error print a bit 2016-04-15 11:24:59 +02:00
Sergey Sharybin b8892cac19 Cycles: Yet another fix for camera in volume
Was an embarrassing glitch in original optimization policy,
the for-loops can't be de-duplicated here.
2016-04-14 17:20:17 +02:00
Sergey Sharybin bbcb9c68c9 Cycles: Resolve ridiculous amount of memory used by spatial split builder
This was only visible on systems with lots of threads and root of the issue
was that we've been pre-allocating too much memory for all the threads.

Now we only pre-allocate data for the main thread and rest of the threads
does allocation on-demand.

This brings down memory usage from 36Gig to 6.9Gig when building spatial
split for the Bunny.blend file on our Intel beast.

Originally regression was happened by the threaded spacial split builder
commit.
2016-04-13 14:25:21 +02:00
Sergey Sharybin 9604db7650 Fix T47813: Cycles Standalone not respecting integrator sample_clamp_direct 2016-04-13 10:39:21 +02:00
Thomas Dinges c8e2cc21ab Cleanup string includes after versioning commits 2016-04-13 09:45:32 +02:00
Thomas Dinges 3156055e27 Show version number in UI as well 2016-04-13 09:45:30 +02:00
Sergey Sharybin bd7e4d2a3d Tweaks to the version string formation
Couple of things:

- No need to use string streams to format the version string,
  we can do it at compile time and don't bother with anything
  at runtime.

- Function declaration was wring and would have caused linking
  conflicts in cases when util_version.h was included from
  multiple places.

We should have an utility function to get Cycles version so
applications which are linked to Cycles dynamically can query
the version, but that can't be done as an inlined function in
header and would need to be a function properly exported to a
global symbol table (aka, be implemented in a .cpp file).
2016-04-13 09:45:26 +02:00
Thomas Dinges ed050753ce Add a version number to Cycles standalone
Now Cycles has its own versioning, that is mainly interesting for external projects, which integrate the engine.

We start with version 1.7.0. Reasons for that:

* The engine is too mature for a 1.0 release.
* We assume that Cycles inside of Blender 2.61 was version 0.1. We count upwards in 0.1 steps, therefore Cycles inside of Blender 2.77 would be 1.7.

We use a common versioning scheme here, with 3 decimals for the major, minor and patch level.

At the moment cycles --version can be used to display the version, easy to parse for external projects. The info will be added to the UI later aswell.
2016-04-13 09:45:23 +02:00
Sergey Sharybin 84c68dcb3f Cycles: Minor cleanup, whitespace around keyword and preprocessor indent 2016-04-13 08:58:52 +02:00
Mai Lavelle c1a27a76cf Cycles microdisplacement: preserve smooth normals for linear subdivison
This way we prevent cracks in the model due to discontinuous normals, by using
smooth normals for displacement instead of always getting flat normals after
linear subdivision.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1916
2016-04-13 01:37:33 +02:00