Commit Graph

3425 Commits

Author SHA1 Message Date
Brecht Van Lommel
d835d2f4e6 Code cleanup: avoid some warnings due to implicit uint/int/float/double conversion. 2013-06-07 16:06:17 +00:00
Brecht Van Lommel
a604fb730d Cycles: mist pass added, with start/depth/falloff control. If the pass is
enabled in a render layer a Mist Pass panel will be shown in the world
properties.
2013-06-07 12:45:26 +00:00
Campbell Barton
a6b505ef0b style cleanup 2013-06-06 06:02:46 +00:00
Brecht Van Lommel
e66f3eb499 Cycles: GLSL materials now can use multiple UV maps with the attribute node. 2013-06-05 15:54:39 +00:00
Thomas Dinges
9e4914e055 Cycles:
* Revert r57203 (len() renaming)
There seems to be a problem with nVidia OpenCL after this and I haven't figured out the real cause yet. 
Better to selectively enable native length() later, after figuring out what's wrong. 

This fixes [#35612].
2013-06-04 17:20:00 +00:00
Brecht Van Lommel
5d18bef762 Fix #35614: cycles objects on mask layer in render layers were writing passes
such as motion/uv/normal but they should have been excluded from them.
2013-06-04 15:41:45 +00:00
Brecht Van Lommel
3fe117bd3d Fix build error on non-x86 architectures as pointed out by Jochen Schmitt. 2013-06-04 11:21:13 +00:00
Thomas Dinges
c5ed6765b9 Cycles / Math functions:
* Rename some math functions:
len -> length
len_squared -> length_squared
normalize_len -> normalize_length

* This way OpenCL uses its inbuilt length() function, rather than our own. The other two functions have been renamed for consistency. 
* Tested CPU, CUDA and OpenCL compile, should be no functional changes.
2013-06-02 20:39:32 +00:00
Campbell Barton
7068a5eba7 tweak to recent commit, don't show keymap in menu tooltips. 2013-06-02 15:58:43 +00:00
Thomas Dinges
0fa08424b7 Code cleanup / Cycles:
* Avoid 2 int castings in hair code and fix some comments.
2013-06-02 14:52:29 +00:00
Thomas Dinges
e46a8f5d76 Fix for #35591:
* Cycles Mix closure could render strange effects, when the user entered a value out of the 0...1 range. This was already clamped for OSL, clamp for SVM as well.
2013-06-01 12:23:49 +00:00
Brecht Van Lommel
0ad88d1001 Fix another windows / msvc build error. 2013-06-01 02:39:34 +00:00
Brecht Van Lommel
4f056d1be7 Fix windows / msvc build error. 2013-06-01 02:28:57 +00:00
Brecht Van Lommel
2d0a586c29 Cycles OpenCL: keep the opencl context and program around for quicker rendering
the second time, as for example Intel CPU startup time is 9 seconds.

* Adds an cache for contexts and programs for each platform and device pair,
  which also ensure now no two threads try to compile and write the binary cache
  file at the same time.
* Change clFinish to clFlush so we don't block until the result is done, instead
  it will block at the moment we copy back memory.
* Fix error in Cycles time_sleep implementation, does not affect any active code
  though.
* Adds some (disabled) debugging code in the task scheduler.

Patch #35559 by Doug Gale.
2013-05-31 16:19:03 +00:00
Brecht Van Lommel
fe02323632 Fix to actually disable DEBUG_BACKTRACE by default. 2013-05-31 12:36:35 +00:00
Sergey Sharybin
1be2936298 Backtrace for unfreed memory blocks
Added an option to show backtrace from where
non-freed datablock was allocated from.

To enable this feature, simply enable DEBUG_BACKTRACE
in mallocn.c file and all unfreed datablocks will
be followed up by a backtrace.

Currently works on linux and osx only,
windows support is on TODO.

This feature is for sure disabled by default,
so does not affect any builds which don't
explicitly define DEBUG_BACKTRACE.
2013-05-30 14:27:24 +00:00
Thomas Dinges
b0cf3a342d Cycles:
* Move some hair width related code into a dedicated branch.
* Don't calculate time/lens RNG when Motion Blur or Depth of Field are disabled
2013-05-30 11:05:02 +00:00
Campbell Barton
65baf6ca5c remove duplicate sys-types headers.
also change define checks in BLI_sys_types.h (was warning a lot in linux about unused defines).
2013-05-29 21:38:23 +00:00
Campbell Barton
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
Alexander Kuznetsov
60befcdc62 Fix for r35524. Thanks Jeffrey Hoover for reporting.
WM_SIZE is dispatched before full init.
2013-05-28 18:36:47 +00:00
Brecht Van Lommel
27b8ea476d Cycles OpenCL: disable requirement of enabling Experimental, environment varibale
already adds an extra step. Also list all features for OpenCL AMD to make testing
easier.
2013-05-28 17:37:24 +00:00
Brecht Van Lommel
33d609144e Cycles: normal maps are now backwards compatible again after recent fix, with
a separate Blender Object/World Space that is compatible with Blender render
baking and uses the YZ flipping convention.
2013-05-28 14:24:03 +00:00
Brecht Van Lommel
601b8c1041 Fix #35505: cycles object space normal mapping did not match blender internal.
Now it uses the same (strange) YZ flipping convention.
2013-05-27 17:48:02 +00:00
Thomas Dinges
722680d7cf Cycles / OpenCL:
* Use advanced shading for nvidia as well, works fine on my Geforce 540M with sm_21. 
I tested the files from regression suite.
2013-05-27 17:13:36 +00:00
Brecht Van Lommel
4bdb54a76e Cycles OpenCL: patch #35514 by Doug Gale
* Support using devices from all OpenCL platforms, so that you can use e.g. both
  Intel and NVidia OpenCL implementations if you have them installed.
* Fix compile error due to missing fmodf after recent math node change.
* Enable advanced shading for Intel OpenCL.
* CYCLES_OPENCL_DEBUG environment variable for generating debug symbols so you
  can debug with gdb. This crashes the compiler with Intel OpenCL on Linux though.
  To make this work the preprocessed kernel source code is written out, as gdb
  needs this.
* Show OpenCL compiler warnings even if the build succeeded.
* Some small fixes to initialize cdDevice to NULL, add missing NULL check when
  creating buffer and add missing space at end of build options for Apple OpenCL.
* Fix crash with multi device + opencl, now e.g. CPU + GPU render should work.

I did a few tweaks to the code and also:

* Fix viewport render failing sometimes with Apple CPU OpenCL, was not taking
  workgroup size limits into account properly.
* Add compile error when advanced shading in the Blender binary and OpenCL kernel
  are not in sync.
2013-05-27 16:21:07 +00:00
Thomas Dinges
e51ee75e82 Cycles / Passes:
* Some closures (Toon, Diffuse Ramp) were not assigned to a CLOSURE_IS_* define, which made them invisible on render passes.
* Westin closures had wrong type, Sheen is Diffuse, Backscatter is Glossy.
2013-05-27 11:33:17 +00:00
Thomas Dinges
9c6deff652 Cycles / Fresnel:
* Avoid redundant assignment and use correct Normal for Ray Differentials.
2013-05-26 22:34:45 +00:00
Thomas Dinges
d76570c071 Cycles / Hair:
* Fix a condition in the hair BVH code.
2013-05-26 22:13:59 +00:00
Thomas Dinges
2efe0f6733 Cycles / OSL:
* Rename fresnel_dielectric() to fresnel_dielectric_cos() to match SVM, easier when searching code. 
* Also remove an old code comment in bsdf_reflection.h from Cycles branch days.
2013-05-26 17:10:22 +00:00
Alexander Kuznetsov
b9817cd207 Live resize on Windows. Based on Ton's patch for mac.
Removing old resize stuff. 
Windows has resize lag, which creates black gap with openGL. Still looking to fix it.
2013-05-25 21:59:34 +00:00
Ton Roosendaal
24321d4891 Solving ancient Blender window sizing issue;
- Removed grid-snapping for area coordinates on scaling windows. 
  That caused the areas to shrink or expand, and eventually corrupt screen layouts.

- Added simple but efficient life resize for OSX. I need to know why this is so much
  code for Windows... I suggest Windows to just copy same method; dispatch the queue,
  and just let the event system draw.
2013-05-25 14:08:56 +00:00
Thomas Dinges
9bf7a2a8c4 Cycles / Wireframe node:
* Make sure we have valid geometry data, fixes a crash with Lamp objects.

Reported by lichtwerk in IRC, thanks!
2013-05-25 13:34:21 +00:00
Thomas Dinges
99b325cebf Cycles / Toon BSDF:
* Added a toon bsdf node to Cycles. This was already available as OSL only closure, but is now available inside the SVM backed as well, for CPU and GPU rendering. 
* There are 2 variations available, diffuse and glossy toon, selectable via a menu inside the node. 

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Toon

Example render & blend file:
http://www.pasteall.org/pic/show.php?id=51970
http://www.pasteall.org/blend/21579
2013-05-23 17:45:20 +00:00
Daniel Genrich
6a290d8e2a Smoke: Remove accidental leftover code from gSoC Smoke + my Smoke code merge.
Thanks to Miika for pointing this issue out and fixing it.
2013-05-21 19:52:22 +00:00
Miika Hamalainen
2345f0ee99 Fix: Smoke simulations of very high resolutions often produced weird results, as if smoke was colliding in an invisible wall.
This was caused by a "hack" Daniel Genrich introduced in his moving obstacles commit in r46050. I suppose it was originally added to prevent issues with too fast moving obstacles, but now it ended up limiting maximum velocity of higher resolution simulations.

Here is an comparision of 184 resolution simulation (simulation area limited by adaptive domain):
https://www.miikah.org/blender/smoke_with_pressure_limit_hack.png
https://www.miikah.org/blender/smoke_without_pressure_limit_hack.png


I now reverted that hack until a better solution is found. Daniel, can you check this out? Pressure was limited to maximum of dt * dx (= dt / res) which doesn't make sense to limit pressure based on grid resolution. Maybe better to limit with a constant factor instead?
2013-05-21 19:20:48 +00:00
Miika Hamalainen
f276f7f2ef Fix: Smoke simulator produced slightly different results on every run if openmp was enabled.
This was a typical threading issue. Move that particular function out of the parallel block.
2013-05-21 18:57:19 +00:00
Thomas Dinges
6b7d2ed8b6 Code cleanup / Cycles:
* Use M_2PI_F in more places and do multiplication instead of division in gradient texture.
2013-05-21 13:22:11 +00:00
Thomas Dinges
54bb3077e1 Code cleanup / Cycles:
* Re-use already defined Westin closure class.
2013-05-21 13:15:27 +00:00
Brecht Van Lommel
b11dc51974 Fix compiler warnings with westin OSL code. 2013-05-21 10:13:47 +00:00
Brecht Van Lommel
bc0e3ffc0c Fix build error after removing return value from MEM_freeN. 2013-05-21 10:13:42 +00:00
Campbell Barton
cd6b27f2b5 remove return value from MEM_freeN, it wasn't used anywhere and was cast to a different function signature. (which evidently works but error prone). 2013-05-21 07:37:59 +00:00
Campbell Barton
6de829cb7a code cleanup: split scons includes onto multiple lines, reduce chance of include conflicts later on. 2013-05-20 18:42:28 +00:00
Miika Hamalainen
53fd499d28 Fix: smoke noise tile was saved in Blender executable directory, which is often write protected on modern systems.
This caused high resolution smoke to always regenerate new tile when domain was reinitialized, slowing down especially adaptive domain simulations. Now noise tile is saved in Blender temp directory instead.
2013-05-20 17:48:16 +00:00
Thomas Dinges
3758193c18 Cycles / Wireframe node:
* Added a wireframe node (Input category) to get access to Mesh wireframe data. 
The thickness can be controlled via a "Size" parameter, and is available in world units (default) and screen pixel size. 
* Only the triangulated mesh is available now, quads is for later. 

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Wireframe

Render and Example file:
http://www.pasteall.org/pic/show.php?id=51731
http://www.pasteall.org/blend/21510
2013-05-20 15:58:37 +00:00
Thomas Dinges
38dc85f296 Math Node:
* Added a Modulo operation to the math node, available in Compositor, Shader and Texture Nodes.
2013-05-20 14:38:47 +00:00
Thomas Dinges
289ca57e7a Code Cleanup / Cycles:
* Remove an unused parameter from Checker texture and correct a typo in license header.
2013-05-20 00:26:48 +00:00
Campbell Barton
6adec303db revert (ifdef) r54745. which enbabled alpha in the GL buffer.
looks to be the cause of bug [#35415]

we can make this optional.
2013-05-19 11:39:22 +00:00
Thomas Dinges
d12a5d8d63 Cycles:
* Fix OSL compilation for scene_intersect(), when __Hair__ was disabled.
2013-05-18 22:40:21 +00:00
Thomas Dinges
eaf493d323 Cycles / OSL:
* Added Westin Sheen and Westin Backscatter closures for testing, useful for Cloth like effects. 

Only available via OSL, added an example OSL shader to the Templates (Text Editor).
2013-05-18 14:36:03 +00:00
Brecht Van Lommel
423ffa6043 Painting / Sculpting: more tweaks to pressure sensitivity
* Also do pressure interpolation for brush size and spacing.
* Do smoothing of pressure when smooth stroke and sample average is enabled.
* Revert the OS X specific pressure change to pressure ^ 2.5, for low pressure
  values like 0.05 it makes the pressure 100x lower, which is problematic. If
  we need to adjust the pressure curve it should be done for all platforms.

Still weak:

* Pressure of first touch on tablet is difficult to control, usually it's low
  which makes the stroke start out small or soft, but other times not. Finer
  event capturing at ghost level would help, along with pressure changes without
  mouse movement, but this may also need different paint stroke logic.
* Brush radius is rounded to integers, this gives noticeable stepping.
* Brush falloff is not antialiased, gives noticeable aliasing for small brush
  sizes which was always a problem, but is more common with size pressure control.
2013-05-18 11:25:24 +00:00
Thomas Dinges
75e36650e3 Code cleanup / Cycles:
* Simplify shaperadius() function a bit to avoid castings.
* Style cleanup 1.f -> 1.0f, to follow rest of Cycles code.
2013-05-18 11:04:29 +00:00
Bastien Montagne
9d567dd366 This commit addresses the somewhat weak handling of stackless textures in Blender with default (BI) renderer. To do so, it's defining an "other" texture context, and when in this one, it switches to using the "new shading" texture handling already known with Cycles engine.
So now, in the new "other" tex context, you can (depending on active data) have direct access to modifiers', force's or brushes' textures...

I also refactored a bit how texture contexts are handled (once again, we had some quite similar code in both space_buttons and RNA sources). This should also solve some harmless glitches like "no texture context selected in UI" sometimes when you remove data related to current texture (see e.g. after removing the material from default cube, in startup scene).

This usage of two different systems for textures, and the handling of switches between them, has been a bit tricky to get working right, but it is OK now I think. I also had to add a bool flag to buttons space, SB_TEX_USER_LIMITED (use_limited_texture_context in RNA), which indicates "new shading" texture code whether it has to ignore materials, lamps etc. (BI) or not (Cycles).

Btw, pinned textures from modifiers/force/etc. were also broken (showing nothing), now it should work too.

Thanks to Brecht for reviewing.
2013-05-17 07:10:10 +00:00
Thomas Dinges
616bc9d68f Code cleanup / Cycles:
* Put render resolution x/y into a function.
2013-05-16 21:53:21 +00:00
Thomas Dinges
8e487bebd3 Cycles / BSSRDF:
* Avoid one max() call for the bssrdf radius, the if condition already checks for values < BSSRDF_MIN_RADIUS.
2013-05-16 18:39:45 +00:00
Campbell Barton
f334df5624 code cleanup: double promotion warnings. 2013-05-16 17:20:56 +00:00
Thomas Dinges
34ba69d576 * This is embarrassing... 2013-05-16 15:59:05 +00:00
Thomas Dinges
4475de5bd8 Cycles:
* Revert part of r56832, if code gets more complicated, it's better to keep it more logical here.
2013-05-16 15:47:09 +00:00
Thomas Dinges
9b59e2b95a Code cleanup / Cycles:
* Some simplification of closure code (Velvet and Toon).
2013-05-15 20:38:17 +00:00
Brecht Van Lommel
693f687ebf Fix cycles CUDA error with world multiple importance sampling, after recent OpenCL fixes. 2013-05-15 19:02:30 +00:00
Thomas Dinges
11707119de Cycles:
* Code cleanup, remove unused "resolution" variable from the DeviceTask class, was never used.
2013-05-14 21:18:20 +00:00
Thomas Dinges
1f3bf34ccd Cycles :
* Use is_zero(a) rather than dot(a, a) == 0, saves some calculations.
2013-05-14 18:31:55 +00:00
Brecht Van Lommel
cd3283f573 Cycles CUDA: in case of cryptic error messages in the console, refer to wiki
documentation for possible solutions.
2013-05-13 21:36:48 +00:00
Brecht Van Lommel
213408d4c9 Fix #35340: 3D manipulator not working right after undoing with cmd+Z on OS X.
Another issue with the recent Ghost changes here. For some reason key up events
are not coming through when the command key is pressed. I can't figure out why,
for now just always handle them, still fixes the original bug.
2013-05-13 21:19:30 +00:00
Jürgen Herrmann
3d3a4e8eec Patch [#35234]:
Fix GetWindowsLon and SetWindowsLong issues with VS2012 and Windows 8.
Remove unneeded #ifdef block for GWL_WNDPROC and GWL_USERDATA
2013-05-13 20:27:05 +00:00
Thomas Dinges
d76b758f23 Cycles:
* Fix compile error, when building with __KERNEL_SSE__
2013-05-13 15:31:59 +00:00
Brecht Van Lommel
5c2355d364 Fix ctrl+(shift)+tab shortcut key not working on OS X after recent bugfix to
interact better with system shortcuts.

This is a special shortcut for switching between views and does not get
delivered directly to our view when we pass it through the application key
event handling path. We only have a single OpenGL view, so there's no need to
pass it on to the application, instead just interpret it directly.
2013-05-12 22:15:05 +00:00
Thomas Dinges
d46480377c Cycles / Orthographic Camera:
* Avoid one unneeded division by 1.0f and save one variable assignment.
2013-05-12 17:14:01 +00:00
Thomas Dinges
7636aeffe1 Cycles / Math:
* Add M_2PI_F and M_4PI_F constants and use them inside the codebase.
2013-05-12 14:13:29 +00:00
Campbell Barton
7b707fff56 correct assert for driver evaluation,
also add asserts for listbase functions when the list is NULL, and use noreturn attribute for jpeg_error.
2013-05-12 05:54:33 +00:00
Brecht Van Lommel
f35a9328e0 Fix for previous fix, not sure it will cause issues in practice but better be
sure to avoid invalid memory access.
2013-05-11 12:21:33 +00:00
Brecht Van Lommel
a919b0e4c3 Fix #35265: on OS X, pressing system shortcuts such as cmd+M or cmd+` would both
insert text in the text editor and do the associated operation like minimizing the
window or switching windows.

The code was always doing both without trying to ensure only one is done. Now we
integrate a bit better with the event handling and pass the event to NSApp, which
then decides to handle the event itself or pass it on to the window, from where
we then send it back to be handled.
2013-05-11 10:15:27 +00:00
Brecht Van Lommel
561cf26c2f Fix #35306: cycles normal mapping not working with flat shading. 2013-05-11 09:31:58 +00:00
Thomas Dinges
4ae201e105 Cycles / Closures:
* Avoid some unnecessary re-declarations of closure data and simplify *_setup() functions a bit.
2013-05-10 22:41:24 +00:00
Brecht Van Lommel
eaa6479ae3 Cycles: bump node changes to add a Distance input that controls the overall displacement
distance, and an Invert option to invert the bump effect.
2013-05-10 16:57:17 +00:00
Brecht Van Lommel
8e9b6daa8e Fix for recent bugfix with anisotropic node crash, could do invalid memory access. 2013-05-10 15:10:54 +00:00
Brecht Van Lommel
31e39e9b0e Cycles: add Use Surfaces and Use Hair option to render layers, to disable rendering
of hair and surfaces, similar to blender internal options.
2013-05-10 13:34:49 +00:00
Thomas Dinges
96a11219f6 Code cleanup / Cycles:
* Change some more if / else if conditions to switch / case. 
* Avoid an unneeded variable casting in phong_ramp closure.
2013-05-10 12:51:30 +00:00
Brecht Van Lommel
34d7392297 Fix #35282: cycles color ramp set to constant interpolation did not work well. 2013-05-10 11:44:24 +00:00
Brecht Van Lommel
e46551246c Fix #35272: cycles GPU crash with anisotropic shader in group node.
Problem was that due to group proxy node the anisotropic node did not detect
early enough that it needs generated texture coordinate data to generate the
tangent. Now the proxy nodes are removed earlier.
2013-05-10 11:31:57 +00:00
Thomas Dinges
522eeaa6a0 Cycles / OpenCL:
* Remove old comment for sm_13 cards and really check for OpenCL 1.1.
2013-05-09 16:16:41 +00:00
Brecht Van Lommel
168bcfb46b Cycles OpenCL: fix other build issues when enabling more features. 2013-05-09 15:28:38 +00:00
Thomas Dinges
ba55f2da64 Cycles:
* Change some if / else if conditions to switch / case.
2013-05-09 15:20:00 +00:00
Thomas Dinges
602a7f77c6 Cycles / Filter functions:
* Avoid some variable castings here to save some calculations.
2013-05-09 14:37:32 +00:00
Thomas Dinges
13bcf0c104 Cycles:
* Remove unused film_response table code.
2013-05-09 14:21:36 +00:00
Thomas Dinges
ce40e7fe27 Cycles / OSL:
* Remove custom template from r52885, not needed anymore as OSL 1.3 is a requirement and we do not use a custom branch anymore.
2013-05-09 14:13:43 +00:00
Brecht Van Lommel
d0ffbeec73 Cycles OpenCL: a few fixes to get things compiling after kernel changes,
for Apple OpenCL on OS X 10.8 and simple AO render.

Also environment variable CYCLES_OPENCL_TEST can now be set to CPU, GPU,
ACCELERATOR, DEFAULT or ALL values to test particuler devices.
2013-05-09 14:05:40 +00:00
Brecht Van Lommel
d236b4d60f Cycles bump node: change the Strength value to work better, previously it would
give results that were either too weak or too strong, this makes it give more
predictable results. The downside is that it breaks backwards compatibility but
the previous behavior was almost broken.
2013-05-09 14:05:37 +00:00
Thomas Dinges
01dc4b034f Cycles / Tile Rendering:
* Code refactor of tile ordering to simplify the code and avoid some branching. 
* Changed the Center method, so it really follows center -> corners, instead of the BI method, which was confusing sometimes.
2013-05-08 19:49:09 +00:00
Brecht Van Lommel
360a86d658 Attempt to fix OS X build with 10.6 SDK, was not working due to recent fullscreen bug fixes. 2013-05-08 19:37:36 +00:00
Thomas Dinges
872a8ed1bf Cycles / Hair rendering:
* Enable hair rendering on the GPU.

Patch by Stuart Broadfoot, with small tweaks by me, to only enable it on sm_20 and above.
2013-05-08 17:33:25 +00:00
Brecht Van Lommel
3e763d7e4d Fix #35246: cycles has no simple way to combine bump and normal mapping. Now
the Bump node has a Normal input, so you can chain it after a Normal Map node.
Note that normal mapping always has to be done first because it is tied to the
particular mesh surface and tangents.
2013-05-08 13:23:13 +00:00
Campbell Barton
7d4eee2b18 add option to disable guardedalloc, helps for debugging memory errors
since guardedalloc confuses them.

The option cases a warning on build, since its ownly for experimental
use.
2013-05-08 12:55:23 +00:00
Sergey Sharybin
a4cf8b3779 Supress error message if dlopen for jack.so failed
This is mainly happening when there's no jack installed
in the system and no reason to cause general panic
messages in the terminal about this.
2013-05-07 15:49:23 +00:00
Brecht Van Lommel
2a4ee23a25 Fix #35225: new OS X Lion fullscreen did not work together well with old
fullscreen option. It was possible to enable both at the same time which got
you stuck in a state where it was impossible to exit fullscreen. Now I've made
them mutually exlusive, only one can be enabled at the same time.

Note the reason we need to support both is because the new Lion fullscreen does
not work with multiple monitors, it will just give black screens on the other
monitors. This is a limitation of OS X, you can find many complaints about this
online.
2013-05-06 13:39:25 +00:00
Brecht Van Lommel
62087935ec Fix #35209: cycles generated texture coordinates did not stick to deforming meshes. 2013-05-05 05:56:41 +00:00
Brecht Van Lommel
838949c3e7 Fix #35207: addition to previous fix to avoid OSL getting uninitialized
ray differentials for lighting, which could cause bad texture filtering
artifacts or performance.
2013-05-03 21:34:51 +00:00
Brecht Van Lommel
356ca7ec8a Fix for recent glossy BSDF fix, color ramp test file was rendering different. 2013-05-03 13:17:28 +00:00
Brecht Van Lommel
a5d6820b6d Possible fix for #35198: uninitialized memory access with background multiple
importance sampling + OSL.
2013-05-03 05:24:05 +00:00
Brecht Van Lommel
273f5226da Fix #35160: cycles was rendering glossy BSDF's with zero roughness too rough
after a bugfix for precision issues with low roughness. Now it renders them as
perfectly sharp which avoids the problematic calculations rather than increasing
the roughness.
2013-05-02 22:05:57 +00:00
Bastien Montagne
30556d4cd5 Some minor cleanup/polish... 2013-05-01 17:49:19 +00:00
Bastien Montagne
fd6ab0564d This should at least prevent crash in [#35172]... 2013-05-01 17:11:07 +00:00
Lukas Toenne
8843eb9063 Fix for bug reported by Thomas Dinges on IRC: OSL script node was not initializing the data_type variable for shader sockets and so tried to set a non-existing float RNA property, leading to failed assert. 2013-05-01 13:28:44 +00:00
Brecht Van Lommel
aa2a0e4ab0 More build fixes for visual studio 2012.
Patch #35019, #35131 and #35152 by Jurgen Herrmann.
2013-04-29 19:15:56 +00:00
Thomas Dinges
b13ef55973 Cycles / SCons:
* Fast math compiler flag was set for Cycles, but not OSL.
2013-04-29 15:52:38 +00:00
Sergey Sharybin
b1b5274549 Tweak allocation vars for XYZ space for more accurate GPU transform
Also extend 3DLUT edge size to 64 (1 meg of memory) to increase
transform accuracy as well.
2013-04-29 10:53:10 +00:00
Bastien Montagne
428debd9c8 Fix for "new" Cycles handling of textures, UI code assumed all texture users use "texture" as prop name, but at least WeightVG modifiers do not.
Fixed by adding a "texture_user_property" member to spacebuts' context, and using it to get the prop identifier in ui script.

Thanks to Brecht for its advice!
2013-04-28 15:20:52 +00:00
Brecht Van Lommel
8cd455f9b4 Fix #35121: cycles 3D viewport render pause button not working during render. 2013-04-28 12:31:24 +00:00
Ton Roosendaal
753fe9f0b9 Keeping my commit count high!
Previous GLSL code had error, the if() statement had to be negated.
2013-04-28 11:05:49 +00:00
Ton Roosendaal
eae651db3a GLSL display of float buffers with alpha:
Previous version worked, now a version with simplifying this GLSL code.
2013-04-28 11:03:01 +00:00
Ton Roosendaal
e355abebee This glsl shader works for OCIO with alpha. OSX iMac with ATI.
There's no logical reason I can find... but I commit it because many others have
the same error, so we can check.
2013-04-28 10:46:18 +00:00
Sergey Sharybin
69b0b0a624 Fix for fix in alpha de-premul
We do not need to premul shader result, opengl
is already configured for straight alpha.
2013-04-27 17:50:11 +00:00
Sergey Sharybin
6a04ff11af Premultiplication in OCIO shader went wrong,
it used to apply alpha on source color after
conversion, not on result.
2013-04-27 17:08:37 +00:00
Sergey Sharybin
d376a1b740 Apparently better not to use values like 1.0f in GLSL code
Fix from debug session of self and Ton, was affecting OSX
builds, making GLSL display transform not working on this
platform.
2013-04-27 16:43:15 +00:00
Sergey Sharybin
514e322895 Print error log to the console if OCIO shader compilation failed 2013-04-27 16:34:56 +00:00
Brecht Van Lommel
ac849f98f5 Fix #35102: crash with experimental cycles displacement feature due to
uninitialized memory usage.
2013-04-27 02:54:24 +00:00
Brecht Van Lommel
48a6fe86ca Fix #34172: cycles BVH build crashing in some rare circumstances on 32 bit linux.
The problem was (again) the x86 extended precision float register being used for
one float value while the other was rounded to lower precision. This caused the
strictly weak order requirement for std::sort to be broken.
2013-04-26 02:18:29 +00:00
Sergej Reich
3d1b24af00 rigidbody: Code cleanup
Remove outdated comment.
2013-04-25 19:50:51 +00:00
Brecht Van Lommel
811587ce32 Fix #35077: cycles incorrectly rendered an empty with dupligroup that was
dupliverted by its parent.
2013-04-25 14:16:24 +00:00
Francisco De La Cruz
70de23dabb Fix #29932 Left Shift + Numpad 1,2,3 not Aligning to Active
Intermediate Shift+Key messages were resetting modifier flags.
2013-04-25 05:32:32 +00:00
Brecht Van Lommel
18b1ab1598 Fix #34714: cycles viewport render would restart when minimizing and unminimizing
a maximized Blender window in Ubuntu Unity. The window size would slightly change
as part of the unminimize effect.

Now cycles waits 0.2 seconds before restarting rendering after a viewport resize,
also a bit less flickery when changing the 3d view size in Blender itself.
2013-04-24 20:12:12 +00:00
Brecht Van Lommel
dee74c299f Attempt to fix #35041 and #34725: cycles crash with OSL and both a 3D viewport
and preview running at the same time.

It seems there's something in OSL/LLVM that's not thread safe, but I couldn't
figure out what exactly. Now all renders share the same OSL ShadingSystem which
should avoid the problem.
2013-04-22 14:27:12 +00:00
Sergej Reich
ed19108891 rigidbody: Add function to perform convex sweep test
This is a experimental collision detection function, so the API might
change in the future.

Note: The simulation needs to be stepped before this function can be
used, otherwise the rigid body world might not be valid.

Patch [#34989]  Bullet Convex sweep test API
by Vilem Novak (pildanovak), thanks!
2013-04-21 19:53:40 +00:00
Alexander Kuznetsov
b0f8ece9d9 Forgot disable else and it became: else /* */ break;
Caused a crash on Windows on alt-key when a tablet was plug in.
2013-04-20 16:14:31 +00:00
Sergey Sharybin
349b71fd02 Bring back support of FFmpeg >= 0.7
After planar codecs support minimal FFmpeg was
bumped to 0.10 which was not so much nice because
it was only released only later last year.

Didn't find a way to make compatibility code local
in ffmpeg_compat, so there're some ifdefs in
audaspace and writeffmpeg.

Not entirely happy, but having a bit of ifdefs in
code better than lots of real PITA for platform
maintainers.
2013-04-19 17:23:08 +00:00
Alexander Kuznetsov
177080a15d Disabling live resize for Windows for now.
Bug #34990

However, cleanscreen on redraw is still disabled, so when resizing blender will have frozen image.
2013-04-18 13:30:41 +00:00
Antony Riakiotakis
a34acd0de4 Beware of SUBSURAFACES (sounds latin) 2013-04-18 12:40:04 +00:00
Brecht Van Lommel
ed1a08382f Cycles: code refactoring to deduplicate the various BVH traversal variations.
Now there is a single BVH traversal code with #ifdefs for various features.
At runtime it will then select the appropriate variation to use depending if
instancing, hair or motion blur is in use.

This makes scenes without hair render a bit faster, especially after the
minimum width feature was added. It's not the most beautiful code, but we can't
use c++ templates and there were already 4 copies, adding 4 more to handle the
hair case separately would be too much.
2013-04-17 20:07:22 +00:00
Brecht Van Lommel
45552a4595 Cycles: initialize LCG for sss and hair sampling without using the sobol sampler,
slightly faster but also fixes the u/v sampling dimensions not longer being at even
values which is needed for best results.
2013-04-17 14:48:01 +00:00
Brecht Van Lommel
cf0e457e52 Fix #35004: fireflies with .tif image in cycles, try to avoid extreme values when
openimageio can't detect premul/straight alpha correct.
2013-04-17 14:47:58 +00:00
Stuart Broadfoot
8c246ddb99 Cycles Hair: Corrected own stochastic hair rng mistake and removed an unnecessary padding variable
- Corrected the Sobol dimension and removed a pad variable in Curve Struct.
2013-04-17 11:27:56 +00:00
Brecht Van Lommel
c9fc3874d6 Cycles: when render layers have per layer number of samples set, the Sampling
panel now has an option to specify how to use them. There's three options:

* Use: render layer samples override scene samples
* Bounded: bound render layer samples by scene samples
* Ignore: ignore render layer sample settings
2013-04-16 16:18:14 +00:00
Brecht Van Lommel
18feb1630d Fix #34966: cycles packed PNG images were showing alpha fringe, packed images
were not properly premultiplied.
2013-04-16 13:52:38 +00:00
Campbell Barton
a120049c3b use psys->seed for smoke random number generator, increase size of MATHUTILS_TOT_CB and reduce float->double conversions. 2013-04-16 09:04:34 +00:00
Campbell Barton
d044fd3299 update uncrustify config, use floats for FloatProperty() min/max 2013-04-16 03:27:51 +00:00
Antony Riakiotakis
e93f00d73d Compile fixes for recent commits 2013-04-16 00:56:24 +00:00
Stuart Broadfoot
638b084f82 Cycles Hair: Strand Minimum Pixel Size
Code is added to restrict the pixel size of strands in cycles. It works best with ribbon primitives and a preset for these is included. It uses distance dependent expansion of the strands and then stochastic strand removal to give a fading. To prevent a slowdown for triangle mesh objects in the BVH an extra visibility flag has been added. It is also only applied for camera rays.

The strand width settings are also changed, so that the particle size is not included in the width calculation. Instead there is a separate particle system parameter for width scaling.
2013-04-15 21:38:31 +00:00
Sergey Sharybin
427f56f1f0 Fix compilation with current FFmpeg trunk
AVCODEC_MAX_AUDIO_FRAME_SIZE was deprecated and
finally removed from current trunk.

Initial patch by Lawrence D'Oliveiro (ldo) with
own modification, Thanks!
2013-04-15 11:08:02 +00:00
Thomas Dinges
77a78658ea Cycles / Non-Progressive integrator:
* Subsurface samples were not taken into account for the Sobol directions table.
2013-04-14 19:22:12 +00:00
Peter Schlaile
1166609cd3 == FFMPEG / Canon DSLR footage workaround ==
The latest ffmpeg versions include a workaround to deal with a certain
pecularity in Canon DSLR footage: instead of decoding pictures with the
proper resolution of 1920x1080 they decode it with 1920x1088 and add a
black bar at the bottom.

Needless to say, that this screws up things in a lot of areas within blender
(proxy indices, mask animations etc.)

Since all blender versions besides Linux x86 32bit seem still to include
older ffmpeg versions which still contain this bug, this patch adds
a workaround for older versions until we have all versions on all platforms
up to date.

See also: http://git.libav.org/?p=libav.git;a=commit;h=30f515091c323da59c0f1b533703dedca2f4b95d
2013-04-14 13:44:04 +00:00
Antony Riakiotakis
15f3bbfe9e Fix some compilation errors for MinGW. Thanks to vildas on irc for
bringing this to attention.
2013-04-13 16:29:18 +00:00
Thomas Dinges
6f9495fc29 Fix for [#34968] Cross compiling from linux for windows is broken
* Patch by Martijn Berger (juicyfruit).
2013-04-13 09:28:07 +00:00
Sergey Sharybin
6569ab813f Fix for material icon rendering with cycles
Materials icons used to miss transparent background
and were using world environment which didn't give
so nice results.

Reviewed by Brecht, thanks!
2013-04-11 12:49:57 +00:00
Lukas Toenne
549fa84afa Fix #34948, bug in Cycles node groups. The proxy node maps used to identify external connections of node group nodes were having name clashes with input/output sockets of the same name, leading to invalid cyclic connections in the cycles shader graph that were subsequently removed (prints warnings in terminal). Solution is to use two separate maps for inputs and outputs so group node sockets can safely use the same identifier. 2013-04-11 09:16:36 +00:00
Campbell Barton
ece766ee7e code cleanup: unused defines, remove unused scanfill success value from BLI_scanfill_begin(). 2013-04-10 23:52:07 +00:00
Jens Verwiebe
b9b23d697b Fluid threads: re-add an erratically forgotten line, fix typo, set default threadcount to logical threadcount of machine 2013-04-10 23:19:57 +00:00
Jens Verwiebe
5ac66ee378 Fluid threads: add a restore to former omp threadcount when baking is done, todo: default should be logical corecount 2013-04-10 23:10:25 +00:00
Campbell Barton
8c1cb10cfd code cleanup: unused vars, make other vars static. 2013-04-10 22:49:50 +00:00
Jens Verwiebe
842d0a4258 The fluid threads setting is still WIP, for now fix compiling without openMP enabled 2013-04-10 20:05:11 +00:00
Jens Verwiebe
cbe9ae244e Add a gui control for setting omp threads in fluids 2013-04-10 18:35:18 +00:00
Brecht Van Lommel
34707c19f2 Fix 34764: cycles issue rendering instanced mesh with NaN coordinates. 2013-04-09 20:48:53 +00:00