Commit Graph

5386 Commits

Author SHA1 Message Date
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
Campbell Barton
6af043424d Workaround for glew initialization bug
It turns out libGL from Intel crashes when calling glxewInit (where mesa, nvidia work fine),
unfortunately the only option without making larger changes to glew,
is to inline the parts of glew we're using - before the glx context is created.
2015-10-12 22:07:24 +11:00
Campbell Barton
9cea429f78 Fix T46431: Init glew before glx-context crashes
Initialize glxew before glew,
so we can check whats supported before creating the context.

This also removes need for mxIgnoreNoVersion.
2015-10-12 15:08:20 +11:00
ea7ce7fcf4 Fix T46447: fix build on non-x86 platforms. 2015-10-12 03:22:43 +02:00
Sergey Sharybin
88005475db Cycles: Make light behavior in local view matching BI
Title says it all, based on feedback of artists from gooseberry team.

This mainly affects cases when going to a local view from layers setup
when some lamps were on invisible layers. Those lights are no longer
becoming visible to the object in local view.

Reviewers: brecht, juicyfruit, dingto

Reviewed By: juicyfruit, dingto

Subscribers: maxon, eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1326
2015-10-11 20:16:53 +05:00
Sergey Sharybin
3f4c0612fe Fix T45058: Cycles hair shader reflects incorrectly for meshes
The issue was caused by non-continuous tangent space calculated for triangles.

This commit adds a Tangent input to Hair BSDF node which can be used to hook up
Tangent calculated form UV as an input to the node in order to make sure the
tangent space is continuous.

Doing this as an input instead of using default tangent layer from UV because of
several reasons:

- This way it's really easy to preserve compatibility with existing setups.

- Default UV map is not necessarily giving continuous space, one might want to
  use other tangent space sources or distort the space for some artistic
  decision.

Reviewers: juicyfruit, dingto

Reviewed By: dingto

Differential Revision: https://developer.blender.org/D1428
2015-10-11 19:43:30 +05:00
Sergey Sharybin
34e7285b0a Cycles: Gracefully handle out-of-memory happening in device vector
Currently only image loading benefits of this and will give magenta color
when image manager detects it's running out of memory.

This isn't ideal solution and can't handle all cases. For example, OOM
killer might kill process before it realized it run out of memory, but
in other cases this could prevent some crashes.

Reviewers: juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1502
2015-10-11 19:41:59 +05:00
Sergey Sharybin
8a1afc28db Cycles: Increase number of textures allowed for OpenCL render
Currently OpenCL devices are packing images into a single texture,
which means technically number of textures is not limited here.

Now OpenCL will use same number of textures as CPU. If we want
to bump number of textures further, this values are to be modified
in sync.

NOTE OpenCL still does not support float textures.

Original patch from a guy called bliblubli in the tracker with
some own modifications.

Reviewers: brecht, dingto, sergey

Differential Revision: https://developer.blender.org/D1530
2015-10-11 18:22:01 +05:00
307d4b3139 Revert "Fix T46406: Cycles ignores default socket value associated with group socket"
Fixes T46442.
2015-10-10 21:57:00 +02:00
b098609186 Fix various compiler warnings. 2015-10-10 17:35:30 +02:00
240f356166 Fix T45167: OS X inertial scrolling can lead to unexpected zooming.
Differential Revision: https://developer.blender.org/D1539
2015-10-10 14:00:02 +02:00
a8dd0af8cf Fix T46341: OS X trackpad and magic mouse gestures not working with 10.11 SDK.
Differential Revision: https://developer.blender.org/D1539
2015-10-10 14:00:02 +02:00
Campbell Barton
f42ae6c569 Fix/Workaround T46431: blender-softwaregl crashes
Order of initialization bug only impacted mesa's software-gl.

For now effectively revert support for glx-context-flags.
2015-10-10 19:39:35 +11:00
Sergey Sharybin
ad5f6a95dd Cycles: Fix compilation error of CUDA kernel after recent decomposition changes 2015-10-09 17:53:29 +05:00
Sergey Sharybin
b54447c0eb Cycles: Make sure ray direction is always normalized
Ray direction is assumed to be normalized in such areas as scaling intersection
distance on instance push/pop when doing ray-scene intersection, but it was
possible that some closures wouldn't give normalized direction which could cause
wrong intersection checks.

Now normalization will happen on surface bounce, which could be a bit of a waste
if closure actually gives normalized direction, but currently only transparent
BSDF seems to give guaranteed normalized direction.
2015-10-09 15:58:03 +05:00
Sergey Sharybin
29247a7a05 Cycles: Fix wrong intersection with motion blur and degenerate object transform 2015-10-09 15:58:03 +05:00
Sergey Sharybin
4974ed93ef Cycles: Fix issues with quick inverse of degenerate matrix
This fixes part of the issues reported in T46322. Still need to solve
issue with wrong intersection distance scaling.
2015-10-09 15:58:03 +05:00
Sergey Sharybin
8fa4fccec4 Cycles: Fix intersection issues caused by degenerate instance matrix
Issue was caused by wrong intersection distance scaling on instance pop,
which could cause intersection distance to become zero, confusing following
intersection checks.
2015-10-09 15:58:03 +05:00
Sergey Sharybin
350cf8ea7f Cycles: Cleanup, whitespace around keywords 2015-10-08 19:08:28 +05:00
Sergey Sharybin
7083423eb4 Fix T46407: Enabling OSL breaks Vector Transform node 2015-10-08 19:04:42 +05:00
Lukas Stockner
e3abcd6723 Cycles: Add an interpolation option to environment textures
This commit exposes the interpolation parameter for environment textures (requested by DolpheenDream on IRC), just as it already is for image textures.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D1544
2015-10-08 15:45:45 +02:00
Sergey Sharybin
1730c3666f Fix T46406: Cycles ignores default socket value associated with group socket 2015-10-08 16:05:51 +05:00
Sergey Sharybin
fca1d14214 Cycles: Fix wrong float3->float3 conversion node 2015-10-08 16:05:50 +05:00
Sergey Sharybin
8d108db184 Fix T46405: Cycles point density missing update when modifying source object 2015-10-08 12:41:05 +05:00
Sergey Sharybin
ac098007fb Cycles: Fix for point density always using render settings for modifiers 2015-10-08 12:41:05 +05:00
Sergey Sharybin
91f1886b8e Fix T46352: Cycles fails to render when material contains UV mapped texture as volume input 2015-10-05 14:45:03 +05:00
Sergey Sharybin
518d68fae0 Cycles: Add some TODO comments about derivatives 2015-10-05 12:54:05 +05:00