Commit Graph

3788 Commits

Author SHA1 Message Date
3f39af9cc2 Fix cycles volume render crash when trying to access primitive attributes
like generated texture coordinates or tangents.
2013-12-28 23:39:15 +01:00
fe222643b4 Cycles Volume Render: add volume emission support.
This is done using the existing Emission node and closure (we may add a volume
emission node, not clear yet if it will be needed).

Volume emission only supports indirect light sampling which means it's not very
efficient to make small or far away bright light sources. Using direct light
sampling and MIS would be tricky and probably won't be added anytime soon. Other
renderers don't support this either as far as I know, lamps and ray visibility
tricks may be used instead.
2013-12-28 23:20:53 +01:00
Sv. Lockal
077fe03eaf Use ccl_device_inline for SSE perlin noise
msvc ignores inline hint here and generates a bunch of push/lea
2013-12-28 23:26:42 +04:00
2b39214c4d Cycles Volume Render: add support for overlapping volume objects.
This works pretty much as you would expect, overlapping volume objects gives
a more dense volume. What did change is that world volume shaders are now
active everywhere, they are no longer excluded inside objects.

This may not be desirable and we need to think of better control over this.
In some cases you clearly want it to happen, for example if you are rendering
a fire in a foggy environment. In other cases like the inside of a house you
may not want any fog, but it doesn't seem possible in general for the renderer
to automatically determine what is inside or outside of the house.

This is implemented using a simple fixed size array of shader/object ID pairs,
limited to max 15 overlapping objects. The closures from all shaders are put
into a single closure array, exactly the same as if an add shader was used to
combine them.
2013-12-28 20:12:11 +01:00
e369a5c485 Cycles Volume Render: support for rendering of homogeneous volume with absorption.
This is the simplest possible volume rendering case, constant density inside
the volume and no scattering or emission. My plan is to tweak, verify and commit
more volume rendering effects one by one, doing it all at once makes it
difficult to verify correctness and track down bugs.

Documentation is here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Materials/Volume

Currently this hooks into path tracing in 3 ways, which should get us pretty
far until we add more advanced light sampling. These 3 hooks are repeated in
the path tracing, branched path tracing and transparent shadow code:

* Determine active volume shader at start of the path
* Change active volume shader on transmission through a surface
* Light attenuation over line segments between camera, surfaces and background

This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
2013-12-28 16:57:10 +01:00
133f770ab3 Code cleanup: move shadow_blocked function into separate file. 2013-12-28 16:57:10 +01:00
37c4d6a50a Cycles Volume Render: add flags to quickly detect when objects have a volume shader. 2013-12-28 16:57:10 +01:00
a35db17cee Cycles Volume Render: work on nodes and closures.
* Henyey-Greenstein scattering closure implementation.
* Rename transparent to absorption node and isotropic to scatter node.
* Volume density is folded into the closure weights.
* OSL support for volume closures and nodes.
* This commit has no user visible changes, there is no volume render code yet.

This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
2013-12-28 16:57:02 +01:00
Martijn Berger
114284b1fb creation of path from std::string on Windows (VC10/11/12) crashes (access error)
Summary:
Seems to be a known problem in boost: https://svn.boost.org/trac/boost/ticket/6320

Applied the solution but do not know if this is the right place.

Reviewers: dingto, brecht

Reviewed By: dingto

Differential Revision: https://developer.blender.org/D140
2013-12-27 22:38:46 +01:00
Thomas Dinges
1578b55c27 Cycles: Move SIMD utility functions into its own file.
Recently added SSE macros for noise texture can be moved here as well, but I leave this for later.
2013-12-27 21:30:21 +01:00
Thomas Dinges
a92abf5089 Cycles / Perlin Noise: Optimize noise calculation by using SIMD instructions on CPU.
This makes scenes with a Noise Texture render faster, the BMW file is 12-15% faster now.

Patch by Sv. Lockal, many thanks! :)
2013-12-27 18:48:37 +01:00
Campbell Barton
d09a8ea9e7 Code Cleanup: style 2013-12-27 14:21:03 +11:00
Thomas Dinges
40f79cf6e7 Cycles / Hair: Avoid duplicate calculations and remove redundant if branch, instead add the condition to the one above. 2013-12-26 21:52:46 +01:00
Sergej Reich
a706b9feda Rigidbody: Code cleanup
Remove redundant extern keyword.
2013-12-26 21:33:58 +01:00
Sergej Reich
ceb2430dd7 Rigidbody: Allow triangle mesh shapes to deform during simulation
Only supported when using the "Deform" mesh source.
2013-12-26 18:38:06 +01:00
Sergej Reich
c96601138d Rigidbody: Use own structure to store mesh data for collision shapes
This gives us better access to the data and should also be faster to
create.
2013-12-26 18:38:06 +01:00
Thomas Dinges
03fed41e59 Cycles / Hair: Further cleanup of UI and internals.
* UI: Remove deprecated condition (CURVE_RIBBONS) and hide backface property, when it's hardcoded in C (Curve/Line segments && Ribbons).

* Remove "use_tangent_normal" and "CURVE_KN_TANGENTGNORMAL" as its unused (follow up for last commit).
2013-12-26 03:25:30 +01:00
Thomas Dinges
a649b6eef5 Cycles / Hair: Some cleanup and optimizations for hair code.
* Remove dead code from line segments BVH refine.
CURVE_KN_TANGENTGNORMAL and CURVE_KN_TRUETANGENTGNORMAL are either both true, or both false. Therefore a true/false condition is impossible.
This was a leftover of CURVE_CUSTOM, which was removed in r59234.

* Use "else if" in blender_curves.cpp.
2013-12-26 02:02:14 +01:00
Thomas Dinges
ad0a3de3ce Cycles / OpenCL: Let the OpenCL runtime determine its optimal work-group size automatically, by passing a NULL pointer here.
This is recommended in the Intel OpenCL optimization docs (http://software.intel.com/en-us/vcsource/samples/optimizing-opencl) and I can confirm a small performance increase here (1-2% on nVidia OpenCL, up to 8% on Intel OpenCL).
2013-12-24 20:20:57 +01:00
Thomas Dinges
4ba80fd461 Cycles / Hair: No need to calculate curvepoint() when we use Ribbon curves.
Also some style cleanup.
2013-12-24 04:00:45 +01:00
Thomas Dinges
65ab283168 Code cleanup / Cycles: Remove CUDA check (we don't support sm_1x anymore) and unused hair flag. 2013-12-22 14:43:37 +01:00
Thomas Dinges
427105e425 Code cleanup / Cycles: Remove unused interpolation code for hair triangles, we only support cardinal curves. 2013-12-22 14:14:09 +01:00
Sergey Sharybin
ff9974ed69 Fix T37898: blenderplayer painfully slow in recent builds
Issue was caused by recent image cache rewrite and root of
the issue goes to the fact that blender player doesn't
initialize cache limiter and it uses 32meg of memory only.

This leads to infinite image loading/freeing.

For now disabled cache limiter in game engine, this brings
back old behavior.

In theory we might be smarter here, but better caching
policy is to be discussed.
2013-12-22 15:26:59 +06:00
Sergey Sharybin
78698a2ecf Add ItemDestroyable to the cache limitor
This callback is used when cache limiter needs to remove
some cached objects when running out of limit.

From blender side it's used to keep painted images always
in memory.

This fixes issue when painted images were removing from
the memory after image cache rewrite.
2013-12-22 14:44:56 +06:00
Campbell Barton
c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
Thomas Dinges
9bd3a226ae Cleanup: Code and style cleanup for Cycles curve export code. 2013-12-21 00:20:16 +01:00
8ed0878f0f Fix T37884: cycles hair rendering crash with UV coordinates.
This was broken in a recent bugfix for zero length hairs.
2013-12-20 00:08:46 +01:00
6ccf3402cb Fix T37790: OSL not rendering subsurface scattering color correct since upgrade to 1.4. 2013-12-18 12:29:11 +01:00
Sergey Sharybin
c5d7ea091f Changes to partial update during rendering
Summary:
Mainly addressed to solve old TODO with color managed fallback
to CPU mode when displaying render result during rendering.

That fallback was caused by the fact that partial image update
was always acquiring image buffer for composite output and was
only modifying display buffer directly.

This was a big issue for Cycles rendering which renders layers
one by one and wanted to display progress of each individual
layer. This lead to situations when display buffer was based on
what Cycles passes via RenderResult and didn't take layer/pass
from image editor header into account.

Now made it so image buffer which partial update is operating
with always corresponds to what is set in image editor header.

To make Cycles displaying progress of all the layers one by one
made it so image_rect_update switches image editor user to
newly rendering render layer. It happens only once when render
engine starts rendering next render layer, so should not be
annoying for navigation during rendering.

Additional change to render engines was done to make it so
they're able to merge composite output to final result
without marking tile as done. This is done via do_merge_result
argument to end_result() callback. This argument is optional
so should not break script compatibility.

Additional changes:

- Partial display update for Blender Internal now happens from
  the same thread as tile rendering. This makes it so display
  conversion (which could be pretty heavy actually) is done in
  separate threads. Also gives better UI feedback when rendering
  easy scene with small tiles.

- Avoid freeing/allocating byte buffer for render result
  if it's owned by the image buffer. Only mark it as invalid
  for color management.

  Saves loads of buffer re-allocations in cases when having
  several image editors opened with render result. This change
  in conjunction with the rest of the patch gave around
  50%-100% speedup of render time when displaying non-combined
  pass during rendering on my laptop.

- Partial display buffer update was wrong for buffers with number
  of channels different from 4.

- Remove unused window from RenderJob.

- Made image_buffer_rect_update static since it's only used
  in single file.

Reviewers: brecht

Reviewed By: brecht

CC: dingto

Differential Revision: http://developer.blender.org/D98
2013-12-17 23:42:38 +06:00
Thomas Dinges
011ae78857 Cycles / OpenCL: Fix compile error on OS X
After update to Mac OS X 10.9.1, OpenCL works now on my Intel CPU in the 2013 Macbook Pro (even the entire kernel).
The Intel Iris Pro GPU still segfaults here though, even when all flags are disabled (building "clay like" kernel only).

Maybe we need the -no-missing-prototypes for AMD hardware still, but I couldn't find a way to distuinguish here.
2013-12-17 09:59:18 +01:00
c05209ec01 Fix T37827: cycles XML mesh export utility not longer worked. 2013-12-16 11:08:41 +01:00
Peter Staples
4a141022c3 Fix T37816: make cycles panel registration work better with addons.
This would give an error when an addon removed a panel.
2013-12-14 18:00:25 +01:00
cccd06ea44 Fix T37810: GLSL dither shader not working on OS X.
The GLSL function textureSize() is not supported here, only when we start using
OpenGL core profile will this work. For now check the supported GLSL version and
use a somewhat slower replacement.
2013-12-14 16:01:48 +01:00
Thomas Dinges
1bebdc9ad0 Fix T37264: cycles CPU render had limited number of float images, bumped to 1024.
GPU is still limited to 5, but there's no good reason for the CPU to be limited.
2013-12-14 15:07:46 +01:00
Thomas Dinges
b43ce8a140 Code cleanup / Cycles: Remove some unused hair code. 2013-12-14 13:11:44 +01:00
1e045a2417 Cycles: CUDA runtime kernel compilation can now find CUDA 6.0. 2013-12-13 19:12:07 +01:00
Sergey Sharybin
5a91df3271 Implement GPU-side dither
Summary:
Uses some magic pseudo-random which is actually a
texture coordinate hashing function.

TODOs:
- Dither noise is the same for all the frames.
- It's different from Floyd's dither we've been
  using before.
- Currently CPU and GPU dithering used different
  implementation. Ideally we need to use the same
  dither in CPU.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D58
2013-12-13 12:36:45 +06:00
Campbell Barton
6c96535fd8 Code Cleanup: use static for sky_model_data.h 2013-12-13 04:40:30 +11:00
Sergey Sharybin
abb7e9f09b Attempt to fix compilation error on Debian armel kernel 2013-12-12 17:33:36 +06:00
Sergey Sharybin
b53bc572fd Attempt to fix compilation against libav-0.8.9 2013-12-11 22:40:45 +06:00
Sergey Sharybin
aeee7118ae Cache limiter cleanup and small fixes
- Made code a bit less cluttered to follow
- Fixed possible deadlock when enforcing limit
  and highest priority element is still referenced.
2013-12-11 16:32:41 +06:00
d7945b7202 Fix T37704: cycles hair render error with hair density vertex group.
Zero length hairs were causing problems, now it skips rendering them as they
are invisible anyway.
2013-12-10 19:47:27 +01:00
7e5d2fee71 Fix T37694: cycles particles emitter object rendering when it shouldn't.
This was broken by a recent bugfix for T37159.
2013-12-09 21:59:45 +01:00
b38f645bf1 Fix build error when building without OSL support. 2013-12-09 05:28:19 +01:00
38adc8a91f Cycles OSL: update to build with latest OSL master shader group changes. 2013-12-08 15:15:27 +01:00
Campbell Barton
05e96ba160 Style: use frozen sets 2013-12-08 22:53:55 +11:00
Thomas Dinges
28d5f2ab60 Cycles: Update stdosl.h to OSL 1.4.0. (includes new aastep functions). 2013-12-08 12:20:15 +01:00
Thomas Dinges
2069606dc5 Code cleanup: UI cleanup for cycles UI code and fix typo in system info. 2013-12-08 12:13:09 +01:00
Sergey Sharybin
b6646c6a2a Bummer, forgot to test with OSL disabled. 2013-12-08 15:19:59 +06:00
Sergey Sharybin
46f8dba4c7 Extend system-info with information about OIIO, OCIO and OSL
Summary:
Version of those libraries might be useful to know.

- OIIO and OCIO is exposed via bpy.app.oiio and bpy.app.ocio.
  There're "supported", "version" and "version_string" defined
  in those modules.

- OSL is available as _cycles.osl_version and _cycles.osl_version_string.

Reviewers: campbellbarton

Reviewed By: campbellbarton

CC: dingto

Differential Revision: http://developer.blender.org/D79
2013-12-08 15:03:17 +06:00