Commit Graph

3788 Commits

Author SHA1 Message Date
Thomas Dinges
e4f9cc32ec Merged revision(s) 58859-58993 from trunk/blender into soc-2013-dingto. 2013-08-07 16:57:18 +00:00
Campbell Barton
4f29aeeff2 code cleanup: some structs were declaring data when only typedef's were intended, make local vars and functions static. 2013-08-07 03:44:05 +00:00
Thomas Dinges
da4679f6d8 * Make MSVC happy. 2013-08-06 23:47:47 +00:00
Campbell Barton
d58a385084 minor edits to float/double conversion suggested by DingTo 2013-08-06 23:34:47 +00:00
Campbell Barton
81acaf5f15 quiet double-promotion warnings, change octree.cpp to use a float (vector accumulated into a float anyway) 2013-08-06 06:38:52 +00:00
Campbell Barton
34c64b8ea3 cycles builds with -Wdouble-promotion again. 2013-08-06 06:36:34 +00:00
Campbell Barton
ce2e2b141e use gcc malloc attribute for low level allocation functions, prevents gcc from checking if resulting pointers alias existing pointers, also use sentinel attribute for uiButGetStrInfo so incorrect usage gives a warning. 2013-08-05 20:57:13 +00:00
Brecht Van Lommel
d01fbce3bb Fix #36380: cycles render error with sun lamp that has object scale 0,0,0. 2013-08-05 14:22:07 +00:00
Brecht Van Lommel
3bf175f270 Cycles OSL: image texture lookup optimization, acquire the per thread handle
for texture system in advance. Patch by Martijn Berger, with some tweaks.

There was about a 10% performance improvement on OS X in my tests with the
images.blend test file. This may be less on other platforms because OS X has
particularly slow mutex locks.
2013-08-05 12:49:15 +00:00
Brecht Van Lommel
28f893f23a Fix wrong cycles cmake + msvc build flags with relwithdebinfo and minsizerel.
Patch by Karsten Schwenk.
2013-08-05 12:02:43 +00:00
Thomas Dinges
d06fa3ba2b Code cleanup / Cycles:
* Various string and comment fixes.
2013-08-05 01:24:41 +00:00
Campbell Barton
41721e11fb fix for 2 memory leaks in dualcon library, quite bad since they leaked on every evaluation. 2013-08-04 18:05:29 +00:00
Campbell Barton
35db9c5e70 Support WITH_CXX_GUARDEDALLOC for dualcon library 2013-08-04 17:58:17 +00:00
Thomas Dinges
c26754fe9d Cycles / OpenCL:
* Was broken after Blackbody merge, forgot to rename a struct...
2013-08-04 12:40:46 +00:00
Campbell Barton
a270481239 add missing NULL check in RB_dworld_export if fopen fails. 2013-08-04 04:30:14 +00:00
Campbell Barton
bd89bd9e1c avoid using MEM_reallocN_id directly, add utility macro for freeing. 2013-08-04 03:00:04 +00:00
Thomas Dinges
02ec0b9431 Cycles:
* Forgot to rename some SSS pass strings.
* Some typo fixes.
2013-08-03 21:45:57 +00:00
Campbell Barton
2a8d76d734 add versions of MEM_reallocN, MEM_recallocN which take a string arg so new allocs have an ID, changing existing functions signatures would be too disruptive at the moment. 2013-08-03 17:53:41 +00:00
Thomas Dinges
5fc6f04fc8 Cycles / SSS:
* Render Passes are now available for Subsurface Scattering (Direct, Indirect and Color pass). 

This is part of my GSoC project, SVN merge of r58587, r58828 and r58835.
2013-08-03 13:12:09 +00:00
Thomas Dinges
b84858778c Merged revision(s) 58785-58855 from trunk/blender into soc-2013-dingto. 2013-08-03 12:49:08 +00:00
Thomas Dinges
745ec9766e Cycles / SSS Render Passes:
* Finished the implementation, Direct and Indirect Passes work now. 

Patch by Brecht and myself.
2013-08-02 19:57:14 +00:00
Thomas Dinges
702bf77b34 Cycles / Squared Samples:
* After some feedback decided to remove this option from the Progressive integrator, it only makes sense for Non-Progressive where we have different values for the sample types.
2013-07-31 22:51:48 +00:00
Antony Riakiotakis
ac8e379a87 Fix linking issue, we use bundled static glew so we should define static glew in ghost as well. 2013-07-31 22:39:17 +00:00
Thomas Dinges
0d9364463f Merged revision(s) 58779, 58783-58784 from trunk/blender into soc-2013-dingto. 2013-07-31 21:49:10 +00:00
Thomas Dinges
e48acb7dec Code cleanup, use bools here. Forgot to change that. 2013-07-31 21:40:52 +00:00
Thomas Dinges
2a2f0319bc Cycles / HSV Separator and Combine node:
* Added nodes to separate and combine hsv colors.

Part of my GSoC 2013 project, SVN merge of r57981.
2013-07-31 21:27:48 +00:00
Thomas Dinges
34009da32e Cycles / Vector Transform node:
* Add a note to convert a Vector, Point or Normal between World <=> Camera <=> Object coordinate space. 

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

Part of my GSoC 2013 project, SVN merge of r57599, r57670, r57918, r57919, r58245 and r58775.
2013-07-31 21:18:23 +00:00
Thomas Dinges
6d9720ef63 Cycles / Blackbody to RGB node:
* Added a node to convert a temperature in Kelvin to an RGB color. This can be used e.g. for lights, to easily find the right color temperature. 
= Some common temperatures =
Candle light: 1500 Kelvin
Sunset/Sunrise: 1850 Kelvin
Studio lamps: 3200 Kelvin
Horizon daylight: 5000 Kelvin

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

Thanks to Philipp Oeser (lichtwerk), who essentially contributed to this with a patch! :)

This is part of my GSoC 2013 project. SVN merge of r57424, r57487, r57507, r57525, r58253 and r58774
2013-07-31 20:56:32 +00:00
Thomas Dinges
3840e0b234 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce.
This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. 

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

This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
2013-07-31 20:30:37 +00:00
Thomas Dinges
2a25acb108 Cycles / Vector Transform node:
* Code cleanup to avoid duplicated enum code.
* Added a third type for conversion next to Point and Vector: Normal. This is basically the same result as with the Vector type, but normalizes the vector at the end. 

Thanks to Brecht for code review!
2013-07-31 20:05:13 +00:00
Thomas Dinges
b6024a0e75 Cycles / Blackbody Node:
* Some optimizations to avoid divisions on runtime, avoid possible division by zero and code cleanup. 

Thanks to Brecht for code review!
2013-07-31 19:03:42 +00:00
Thomas Dinges
380ee3d30a Cycles / Non-Progressive integrator:
* Code cleanup, to avoid separate code for CPU and GPU.
2013-07-31 18:46:11 +00:00
Thomas Dinges
6a902d1a81 Cycles / Ray Depth:
* Fix some things which came up in code review. Includes some fixes for background lights and changes to variables, to avoid some castings.

Thanks to Brecht for code review! :)
2013-07-31 18:40:11 +00:00
Thomas Dinges
a3e34e5fbc Merged revision(s) 58682-58770 from trunk/blender into soc-2013-dingto. 2013-07-31 18:14:18 +00:00
Thomas Dinges
3d57740a38 Cycles / Non-Progressive integrator:
* Avoid check for !LABEL_TRANSPARENT in "kernel_path_non_progressive_lighting", transparency is either handled in the outer loop or in the "kernel_path_indirect" function, but not here.
2013-07-30 12:56:39 +00:00
Thomas Dinges
5ce3588c6c Cycles:
* Increase the maximum amount of closures per shader from 16 to 64, so more complex closure trees can be rendered.

I measured performance on CPU and GPU (Geforce 540M) and couldn't find a performance impact, but if someone encounters a noticeable impact on his system, please report.
2013-07-30 09:26:45 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Brecht Van Lommel
c0875290bc Fix #36290: cycles generated texture coordinates were not sticking to the
surface again, got lost in an unrelated optimization.
2013-07-29 19:39:23 +00:00
Brecht Van Lommel
6135a7adc8 Fix #36235: cycles crash deactivating render layer during rendering. 2013-07-29 15:32:24 +00:00
Thomas Dinges
ac80b9d198 Cycles / SSS Render Passes:
* First step toward Subsurface Scattering render passes (Color, Direct and Indirect).
* Added UI, DNA and RNA for the new Passes on the Blender side.
* Basic Cycles integration. 
* Only the SSS Color Pass works so far. 

ToDo: Direct and Indirect Pass.
Should "subsurface" be a part of BsdfEval and "path_subsurface" of PathRadiance or is that the wrong way? Should it be integrated more like the AO render pass? Some input from Brecht or Stuart would be nice. :)
2013-07-24 23:47:02 +00:00
Thomas Dinges
45227e25fe Merged revision(s) 58452-58584 from trunk/blender into soc-2013-dingto. 2013-07-24 21:56:06 +00:00
Thomas Dinges
965e0aeb59 Cycles / CMJ:
* path_rng_2D() was missing an else branch for the sobol case after fix in r57383.
2013-07-23 16:23:30 +00:00
Campbell Barton
b8c3efc8c3 code cleanup: compiler warnings 2013-07-21 16:40:34 +00:00
Thomas Dinges
636b314677 Code cleanup / Cycles:
* Remove useless else branch, after recent changes.
2013-07-21 10:30:22 +00:00
Thomas Dinges
19b5fc17dc Merged revision(s) 58424-58448 from trunk/blender into soc-2013-dingto
Had to resolve manual conflict in addon/ui.py and blender/blender_sync.cpp due to Non-Progressive integrator, which is enabled in my branch.
2013-07-20 15:46:49 +00:00
Thomas Dinges
715855d0b9 Merged revision(s) 58356-58423 from trunk/blender into soc-2013-dingto.
Note: Keep own splash.
2013-07-20 15:34:19 +00:00
Thomas Dinges
9732c6283e Cycles / CPU Rendering:
* "Auto Detect" now again uses the umber of cores, instead number of cores + 1.

This was added before we had Tile rendering and benchmarks on several systems showed that there is no gain with this now. There might be some slight difference (0.5% or so) slower/faster depending on the scene, but this is negligible.
2013-07-20 00:40:03 +00:00
Campbell Barton
a2a99bbc17 edit to r58425, BLI_math is available here, better not copy,paste from linearrgb_to_srgb.
also remove redundant check in AUD_FFMPEGReader::seek.
2013-07-20 00:35:41 +00:00
Thomas Dinges
ac1d58d962 Cycles / Sampling Presets:
* Add Presets for Sampling. This comes with a simple Preview and Final preset, but as this is varying a lot depending on the scene, they should just be a starting point. The user can add own presets here.

* Some UI layout changes to match the settings a bit better.
2013-07-19 23:59:40 +00:00
Thomas Dinges
51a3371d87 Code cleanup / Cycles:
* Use USHRT_MAX rather than manual value, suggested by Campbell.
2013-07-19 22:56:54 +00:00
Thomas Dinges
d336ae8992 Cycles / Sampling UI:
* Add a "Squared Samples" option to the UI, to use squared values for ease of use. This can make it easier from an artist point of view, to weak settings. 

With this enabled, all Sample values will be squared. So 10 Samples become 100 Samples.
For the Non-Progressive integrator: 4 AA Samples * 5 Diffuse Samples would become 16 AA Samples * 25 Diffuse = 400 in total.

Patch by Matt Heimlich, with some minor edits by myself. Thanks!
2013-07-19 22:51:48 +00:00
Thomas Dinges
fd1d4151f1 Fix for [#36216] Viewport render with CMJ sampler and unlimited passes freezes
* If Preview Samples are set to 0 (unlimited) it now assumes 65536 instead of INT_MAX. 

This doesn't affect regular sampling, you can still enter fixed values of 100k or whatever.
2013-07-19 14:00:53 +00:00
Campbell Barton
824ec5a388 code cleanup: case & brace placement 2013-07-19 10:40:43 +00:00
Campbell Barton
cbe43fd385 code cleanup: pass event by pointer to getClipboard_xcout 2013-07-19 10:40:27 +00:00
Campbell Barton
a15ac6ee09 code cleanup: use bool for widget struct, also edit odd strncpy use. 2013-07-19 10:39:44 +00:00
Thomas Dinges
c04575b974 Merged revision(s) 58241-58355 from trunk/blender into soc-2013-dingto. 2013-07-17 21:43:38 +00:00
Thomas Dinges
271ffb43e5 * Fix a typo in code. 2013-07-17 21:25:44 +00:00
Thomas Dinges
c7e2c3f5e1 Possible fix for [#36086] Activating the opencl option in the compositor causes blender crash
* Now OCL_init() returns error messages if the OpenCL library cannot be loaded.
2013-07-17 12:57:03 +00:00
Campbell Barton
925c5010e8 fix for checking char arrays against NULL, instead check their first character. also remove some dead code (return directly after return). 2013-07-16 11:42:07 +00:00
Campbell Barton
b1403415ae fix [#36157] Memory Leak in GHOST_DropTargetX11
would leak a little bit of memory for every window created.
2013-07-16 05:10:58 +00:00
Campbell Barton
02ba328ca8 clang/cmake - quiet warnings for external libs and reference moto as a system include. 2013-07-15 08:26:16 +00:00
Thomas Dinges
17b1840a06 Cycles / Blackbody node:
* Fix the weird results with 800-804.3 Kelvin in SVM. This was an offset issue with the lookup table, made the table slightly larger now (from 954 to 956) which gives a small gap between the R/G/B components. 
* Use Luminance also for values below 800 Kelvin, for consistency.
2013-07-15 04:38:35 +00:00
Thomas Dinges
b39a84e9aa Cycles / Vector Transform node:
* Code cleanup, to avoid case-sensitive checks for OSL.
2013-07-14 22:02:40 +00:00
Thomas Dinges
11fe01b0da Merged revision(s) 58226-58240 from trunk/blender into soc-2013-dingto. 2013-07-14 16:54:20 +00:00
Brecht Van Lommel
08dc76b1ec Fix a few issues found by coverity code scan in cycles code, nothing that caused
an actual bug as far as I can tell.
2013-07-14 13:19:57 +00:00
Brecht Van Lommel
cad3406c81 Fix some unnecessary memory allocation slowness in cycles mesh export. 2013-07-14 12:51:41 +00:00
Thomas Dinges
12a45c8b1b Merged revision(s) 58093-58225 from trunk/blender into soc-2013-dingto. 2013-07-13 23:52:43 +00:00
Thomas Dinges
17ee2732f4 UI / Cycles:
* Make it more clear for the user what affects 3D View and Final render.
* Static / Dynamic BVH only affects viewport, BVH Cache only final. (see BlenderSync::get_scene_params)
2013-07-12 00:08:55 +00:00
Brecht Van Lommel
e64937c96d Fix #36091: external render engines like Luxrender don't work well with the save
buffers option, it requires specific tile sizes and if they don't match what
OpenEXR expects file saving can get stuck.

Now I've made support for his optional, with a bl_use_save_buffers property for
RenderEngine, set to False by default.
2013-07-11 12:22:29 +00:00
Brecht Van Lommel
3a89f98a24 Fix #36053: slow GPU render with panorama camera + depth of field. 2013-07-10 17:25:52 +00:00
Brecht Van Lommel
9460d9f344 Fix #36080: fix cycles crash with certain group node setups, accessing freed
memory.
2013-07-10 10:50:19 +00:00
Thomas Dinges
0b4244d1df Merged revision(s) 58059-58092 from trunk/blender into soc-2013-dingto. 2013-07-09 00:58:25 +00:00
Thomas Dinges
c4fa047894 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which returns the current ray bounce (0, 1, 2, 3...)
* This can be used to use different shaders for direct and indirect lighting and artificial effects.

Examples:
* http://www.pasteall.org/pic/show.php?id=55158 Here we use the output to apply a different shader to the third bounce. As in this example, you can use Math Nodes (Greater Than / Less Than) if you want to use values outside of the 0/1 range.

* http://www.pasteall.org/pic/show.php?id=55159 Here we restrict the maximum bounce on a per shader basis for the left sphere. This way it looks like we would only have 1 max bounce set in the scene "Light paths" panel. 
This can be used to e.g. improve performance for objects far from the camera, which do not need full GI. 

Technical notes:
* Implemented for both integrators and SVM/OSL.
* This is done by passing state.bounce to the shader_setup_from_* functions.
* Note: We don't pass state.bounce to kernel_shader_evaluate() and therefore shader_setup_from_displacement() method doesn't set the value, this is outside the path trace loop. Maybe a ToDo?
2013-07-09 00:18:13 +00:00
Brecht Van Lommel
3d847ed6e6 Fix #36064: cycles direct/indirect light passes with materials that have zero
RGB color components gave non-grey results when you might no expect it.

What happens is that some of the color channels are zero in the direct light
pass because their channel is zero in the color pass. The direct light pass is
defined as lighting divided by the color pass, and we can't divide by zero. We
do a division after all samples are added together to ensure that multiplication
in the compositor gives the exact combined pass even with antialiasing, DoF, ..

Found a simple tweak here, instead of setting such channels to zero it will set
it to the average of other non-zero color channels, which makes the results look
like the expected grey.
2013-07-08 23:31:45 +00:00
Brecht Van Lommel
a2553444fa Fix #35969: blender internal and cycles not updating mesh while in edit mode.
Patch for blender internal made by Campbell.
2013-07-08 22:41:14 +00:00
Sergey Sharybin
7d2030d233 Arrempt to fix Cycles compilation with Clang
Issue is caused by missing sse flags for Clang compilers,
this flags only was set for GNU C compilers.

Added if branch for Clang now, which contains the same
flags apart from -mfpmath=sse, This is because Clang was
claiming it's unused argument.

Probably OSX would need some further checks since it's
also using Clang. I've got no idea why it could have
worked for OSX before..
2013-07-07 18:29:57 +00:00
Thomas Dinges
0b5b82bb53 Merged revision(s) 57979-58058 from trunk/blender into soc-2013-dingto 2013-07-07 14:23:20 +00:00
Brecht Van Lommel
e75064bd34 Fix #36037: cycles from dupli generated texture coordinates were wrong, should
have been normalized to 0..1 range.
2013-07-07 10:39:56 +00:00
Thomas Dinges
285ef99931 Cycles:
* Added 2 new nodes to combine and separate HSV colors. 

Screenshot:
http://www.pasteall.org/pic/show.php?id=54828
2013-07-03 23:46:56 +00:00
Thomas Dinges
e7fc69bdfd Merged revision(s) 57908-57978 from trunk/blender into soc-2013-dingto. 2013-07-03 22:12:42 +00:00
Campbell Barton
905cb1639a update doxygen congfig and tweaks to warnings when running doxygen. 2013-07-03 04:47:50 +00:00
Brecht Van Lommel
65cbcde831 Fix cycles world ray visibility not working correct with multiple importance
sampling.
2013-07-02 21:03:16 +00:00
Thomas Dinges
3a6e382d4a Cycles / Vector Transform Node:
* After some more thinking, solved the remaining ToDos. :) 
* Added is_object check to check if we have a valid object.
* If we operate on the world, and try to convert from/to object space, we now assume world space instead, same as OSL.
2013-07-01 23:17:24 +00:00
Thomas Dinges
7f1005cd6a Cycles / Vector Transform Node:
* Implementation of the node for SVM. This covers all possible transformations: World <> Object <> Camera space.
As far as I can tell, it also works fine with Motion Blur enabled.

ToDo:
* SVM differs from OSL, when the node is used on the world.
2013-07-01 22:56:56 +00:00
Thomas Dinges
8c9769c18d Cycles UI script:
* Fix a merge error, device_type was not defined anymore after Non-Progressive integrator changes for GPU.
2013-07-01 21:30:45 +00:00
Thomas Dinges
465a7195b4 Merged revision(s) 57828-57907 from trunk/blender into soc-2013-dingto 2013-07-01 15:23:48 +00:00
Brecht Van Lommel
c776d5e003 Fix #35904: on Windows force NVidia Optimus, which does automatic graphics
switching between an integrated Intel and a dedicated NVidia card, to use the
dedicated card for Blender.

A more portable and general solution would be nice, but it's all I could find:
http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
2013-06-28 17:58:48 +00:00
Brecht Van Lommel
54b1976958 Fix #35896: cycles crash with OSL image textures and viewport + preview render
running at the same time.
2013-06-28 13:05:21 +00:00
Thomas Dinges
4a113cab0a Merged revision(s) 57768-57827 from trunk/blender into soc-2013-dingto 2013-06-27 16:16:54 +00:00
Thomas Dinges
c15b13f78f Cycles / Ramp closures:
* Fix crash with negative values in Phong Ramp, and add some checks to survive INF and NAN values. 

Patch by Brecht and myself.
2013-06-27 16:08:06 +00:00
Thomas Dinges
c6ce8de20e Code cleanup / Cycles:
* Some cleanup for castings.
2013-06-27 15:48:16 +00:00
Brecht Van Lommel
b466a5c9a9 Fix #35890: memory leak in OS X ghost locale detection. 2013-06-27 13:24:55 +00:00
Campbell Barton
603258d763 fix for zero length normalize before scanfill for meshes and other minor changes. 2013-06-27 04:32:44 +00:00
Thomas Dinges
29a82a04fa Cycles:
* Assure SSE2 intrinsics are also used on SSE3 CPUs and x86.
2013-06-27 00:03:48 +00:00
Brecht Van Lommel
7902fa57b6 Code cleanup: cycles
* Reshuffle SSE #ifdefs to try to avoid compilation errors enabling SSE on 32 bit.
* Remove CUDA kernel launch size exception on Mac, is not needed.
* Make OSL file compilation quiet like c/cpp files.
2013-06-26 23:29:33 +00:00
Thomas Dinges
372c4f80f4 * Comment out change from r57790 to fix compilation for now. 2013-06-26 23:15:52 +00:00
Thomas Dinges
ce06d6d795 Cycles / Brick texture:
* Avoid some unneeded int castings, they were only needed in the original Texture Nodes implementation as custom1 and custom2 were shorts.
2013-06-26 23:08:18 +00:00
Thomas Dinges
15f5da4cd4 Cycles / SSE2:
* kernel_sse2 was built without actual SSE2 intrinsics on x86 systems.
2013-06-26 22:12:23 +00:00
Brecht Van Lommel
e11e30aadf Fix Cycles OpenCL issue if context/program creation fails, mistake by me,
patch #35866 by Doug Gale to fix it.
2013-06-26 12:24:33 +00:00
Thomas Dinges
63f1e253c3 Merged revision(s) 57671-57767 from trunk/blender into soc-2013-dingto 2013-06-26 11:46:55 +00:00
Brecht Van Lommel
8574808b2d Fix #35546: clicking cycles "Use Nodes" did not do a proper undo push, due to
button disappearing as soon as it's clicked. Workaround now is to make this an
operator. Thanks to Lukas and Campbell for tracking this down.
2013-06-25 16:38:40 +00:00
Brecht Van Lommel
0309f442bb Render stats text: show elapsed time for blender internal, hide useless "Single Layer"
at the start, more clearly indicate what the render time of the last frame was, some
other tweaks for consistency.
2013-06-24 22:41:24 +00:00
Thomas Dinges
15aed4127b Fix [#35852], hide Cycles sampling pattern menu, when using GPU. 2013-06-24 04:28:07 +00:00
Brecht Van Lommel
8acdc0515d Fix #35847: cycles group nodes did not work well exposing inputs like normal or
texture coordinate that should automatically use the default normal or texture
coordinate appropriate for that node, rather than some fixed value specified by
the user.
2013-06-23 19:24:32 +00:00
Thomas Dinges
00234dab2f Merged revision(s) 57587-57670 from trunk/blender into soc-2013-dingto 2013-06-23 18:04:13 +00:00
Thomas Dinges
e4ef608020 Cycles / Vector Transform Node:
* Implementation of Vector Transform Node into Cycles.
* OSL backend is done, SVM needs the matrices still.
2013-06-23 17:51:08 +00:00
Brecht Van Lommel
240fb6fa26 Cycles: ensure any SSE data is allocated 16 byte aligned, happens automatically
on many platforms but is not assured everywhere.
2013-06-22 14:35:09 +00:00
Brecht Van Lommel
5da48f425f Cycles OSL: don't set optimize=2 option in OSL shading system, this is already
the default, and by not setting it the user can override it with an environmnet
variable, for example:

export OSL_OPTIONS="optimize=0"
2013-06-22 12:52:15 +00:00
Campbell Barton
dfbbac9b94 style cleanup 2013-06-22 10:59:30 +00:00
Brecht Van Lommel
86c7bf7331 Fix #35812: cycles image texture node not doing proper alpha handling of PNG
images with open shading language enabled.
2013-06-21 13:05:10 +00:00
Brecht Van Lommel
2e3035dd80 Cycles OpenCL: make displacement and world importance sampling work. 2013-06-21 13:05:08 +00:00
Brecht Van Lommel
e1f79351d6 Fix #35804: NVidia OpenCL render issue after sampler changes, workaround what looks like a compiler bug. 2013-06-21 12:34:34 +00:00
Brecht Van Lommel
2df82a2a2b Code cleanup: fix some vs2012 compiler warnings 2013-06-21 12:33:19 +00:00
Thomas Dinges
230f4e7ca2 Cycles / GPU Image Textures:
* On nvidia Kepler GPUs (sm_30 and above), there are now 145 byte images available, instead of 95. 
We could extend this to about 200 if needed. 

Could not test this, as I don't have a Kepler GPU, so feedback on this would be appreciated.

Thanks to Brecht for review and some fixes. :)
2013-06-20 15:14:14 +00:00
Brecht Van Lommel
8d6e5e2fee Cycles: update build configurations to include CUDA sm_35 architecture. When using
a compiler older than CUDA 5.0 it will give a warning and skip this architecture.
2013-06-20 13:10:47 +00:00
Joerg Mueller
e5944d23ed Fix for [#35230] CPU freeze at playback after cutting/deleting/duplicating audio strip 2013-06-20 07:46:40 +00:00
Thomas Dinges
e6fc174152 Merged revision(s) 57499-57586 from trunk/blender into soc-2013-dingto 2013-06-19 20:40:54 +00:00
Brecht Van Lommel
f811e6e3ae Cycles: optimized SSE BVH traversal now also works with SSE2 CPUs, so all the
way back to Pentium 4, using a slightly less efficient instruction.

Also ensure /Ox is used for Visual Studio for RelWithDebInfo builds.
2013-06-19 17:54:26 +00:00
Brecht Van Lommel
16204bd647 Cycles: prepare to make CUDA 5.0 the official version we use
* Add CUDA compiler version detection to cmake/scons/runtime
* Remove noinline in kernel_shader.h and reenable --use_fast_math if CUDA 5.x
  is used, these were workarounds for CUDA 4.2 bugs
* Change max number of registers to 32 for sm 2.x (based on performance tests
  from Martijn Berger and confirmed here), and also for NVidia OpenCL.

Overall it seems that with these changes and the latest CUDA 5.0 download, that
performance is as good as or better than the 2.67b release with the scenes and
graphics cards I tested.
2013-06-19 17:54:23 +00:00
Jürgen Herrmann
a7416641e6 Fix for Debug build on MSVC2008 and MSVC2012 after Cycles Kernel optimization:
Compiler optimization was accidentally set to /Ox for debug build too.
Changed this to be /Od in Debug and /Ox in Release mode.
2013-06-19 17:17:51 +00:00
Thomas Dinges
dd54b99b33 Cycles / UI:
* Some tweaks to the material "Settings" panel.
2013-06-18 22:34:37 +00:00
Brecht Van Lommel
649dd6f648 Fix cycles crash on some processors. We actually need S-SSE3 support for this
new BVH traversal code, not just SSE3.
2013-06-18 16:52:02 +00:00
Brecht Van Lommel
484d765bd4 Cycles: attempt to fix internal compile error with some visual studio builds 2013-06-18 13:19:16 +00:00
Jürgen Herrmann
5fc1d9205a Cycles BVH Build fix for MSVC 2012.
needs to include intrin.h for _BitScanForward and _BitScanReverse.
2013-06-18 12:32:43 +00:00
Thomas Dinges
c194cdaedf Cycles / BVH:
* GCC needs -mssse3 compile flag too (4.7.2) to compile.
2013-06-18 10:05:47 +00:00
Brecht Van Lommel
d57c6748c4 Cycles: optimization for BVH traveral on CPU's with SSE3, using code from Embree.
On the BMW scene, this gives roughly a 10% speedup overall with clang/gcc, and 30%
speedup with visual studio (2008). It turns out visual studio was optimizing the
existing code quite poorly compared to pretty good autovectorization by clang/gcc,
but hand written SSE code also gives a smaller speed boost there.

This code isn't enabled when using the hair minimum width feature yet, need to
make that work with the SSE code still.
2013-06-18 09:36:06 +00:00
Brecht Van Lommel
9131adca9f Cycles: add "Transparent Shadow" option for materials, to disable them per material. 2013-06-18 09:36:00 +00:00
Thomas Dinges
ac4058a211 Cycles / Blackbody node:
* Code cleanup to avoid duplicated table defines, moved them into kernel_types.h.
2013-06-17 16:12:55 +00:00
Thomas Dinges
9042b599e0 Cycles / GPU:
* Enable the Non-Progressive integrator on GPU (CUDA) for testing.

In order to compile the CUDA kernel with it, you need at least 6GB of system memory and CUDA Toolkit 5.0 or 5.5.
It should also work with CUDA Toolkit 4.2, but in this case you should have 12GB of RAM. 

In case any problems arise, just change line 65 of kernel_types.h to disable Non-Progressive again. 
-- #define __NON_PROGRESSIVE__
++ //#define __NON_PROGRESSIVE__
2013-06-17 15:56:28 +00:00
Thomas Dinges
a841813cd9 Cycles / Blackbody node:
* Replaced the Brute Force version with a nice lookup table, this speeds it up a lot. 
Patch by Philipp Oeser (lichtwerk) with some cleanup and changes by myself. Thanks! 

ToDo:
* Temperature values between 800 and 804 Kelvin are wrong in SVM, check on this.
2013-06-16 16:08:11 +00:00
Thomas Dinges
0429595440 Merged revision(s) 57423-57498 from trunk/blender into soc-2013-dingto 2013-06-16 12:05:39 +00:00
Thomas Dinges
9e16c5a9e4 Cycles / Blackbody node:
* First (brute force) implementation for SVM. This works and delivers the same result as OSL, but it's slow. 
* Code inside svm_blackbody.h inspired by a patch by Philipp Oeser (#35698), thanks. 

Ideas:
* Use a lookup table to perform the calculations on render/ level.
* Implement it as a RNA property only, and do the calculation like Sun/Sky precompute.
2013-06-15 23:47:09 +00:00
Campbell Barton
9161a4daa5 fix for own error in recent solitify refactor (r57402), face flip check was incorrect. 2013-06-14 16:10:32 +00:00
Thomas Dinges
88b30ccb8c Cycles:
* Style cleanup for M_PI constants.
* Move Wireframe node into __EXTRA_NODES__ define
2013-06-14 14:29:00 +00:00
Brecht Van Lommel
f8bfe53ded Fix #35730: cycles not rendering dupliverted metaball, needs another special
exception.
2013-06-13 14:33:18 +00:00
Brecht Van Lommel
f9b06060c2 Fix #35729: cycles normal maps not showing properly in preview render. 2013-06-13 13:55:05 +00:00
Brecht Van Lommel
a17d8a29bb Fix #35733: lamps on render layers that are both excluded and used for masking
should not be used, same as emissive meshes.
2013-06-13 13:09:32 +00:00
Thomas Dinges
d523d27e62 Cycles / Blackbody node:
* First step towards a Blackbody to RGB converter. You can specify a color in Kelvin inside the node.
* Only implemented for OSL atm, SVM will follow.
2013-06-13 08:55:51 +00:00
Brecht Van Lommel
a5f60e9337 Fix #35723: cycles motion blur rendering issue after recent optimizations to skip
some unneeded object syncing.
2013-06-12 20:47:48 +00:00
Brecht Van Lommel
37f92119e4 Fix #35665: more CUDA issues with recent kernel changes, tested on sm_20, sm_21
and sm_30 cards, so hopefully it should all work now.

Also includes some warnings fixes related to nvcc compiler arguments, should make
no difference otherwise.
2013-06-11 21:58:48 +00:00
Brecht Van Lommel
e895e2e0d1 Fix #35711: cycles border render issue after recent changes. 2013-06-11 14:15:46 +00:00
Brecht Van Lommel
de83a4f13c Fix #35251: cycles crash rendering with a particular user preferences configuration. 2013-06-11 12:52:02 +00:00
Sergey Sharybin
e969bb207d Fix compilation error caused by recent wavelength node commit
Apparently, it's bad idea to rely on compiler to cast NULL
which is (void*)0 to int -- and in fact if i was a compiler
would also generate an error.

Further, couldn't see why we need to pass NULL or 0 th add_node,
argument value is defautl to 0 already.
2013-06-11 08:07:05 +00:00
Thomas Dinges
9020df976c Cycles / Wavelength to RGB node:
* Added a node to convert wavelength (in nanometers, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.

* Code cleanup:
** Moved color functions (xyz and hsv) into dedicated utility files.
** Remove svm_lerp(), use interp() instead. 

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

Example render:
http://www.pasteall.org/pic/show.php?id=53202

This is part of my GSoC 2013. (revisions 57322, 57326, 57335 and 57367 from soc-2013-dingto).
2013-06-10 21:55:41 +00:00
Brecht Van Lommel
2213b92e48 Fix cycles OSL node sockets not preserving values when updating with new code. 2013-06-10 20:47:58 +00:00
Brecht Van Lommel
9d3ad07f14 Cycles: ray visibility panel is now also available for the world, works same as
meshes and lamps. The light path node already made this possible but it's a bit
faster to render this way and convenient.
2013-06-10 20:34:34 +00:00
Brecht Van Lommel
d16a608f6d Fix cycles backwards compatibility for specular_toon shader this actually needs
to be done in cycles itself to keep compatibility for bytecode too.

Also fix broken button to compile OSL from the text editors, this got broken after
recent change to disable editing of library linked nodes.
2013-06-10 20:10:03 +00:00
Brecht Van Lommel
2ce0ecd956 Attempt to fix #35665: disable correlated multi jitter sampling on the GPU for now,
seems to be giving issues with CUDA 4.2 but I can't figure out why exactly.
2013-06-10 19:01:37 +00:00
Brecht Van Lommel
ab52b15964 Fix #35681: cycles excluded layers still got evaluated before and after
rendering even if they were not used on any render layers.
2013-06-10 13:53:38 +00:00
Brecht Van Lommel
183629b451 Fix cycles OSL backwards compatibility for specular_toon, it got renamed to glossy_toon
but we can keep the old name working too.
2013-06-10 13:06:10 +00:00
Lukas Toenne
4a8f71fc1d Custom Group Node type for extending existing nodes from python scripts. This is a sort of workaround for the lack of APIs in our existing node systems (compositor, cycles, BI, textures). These systems
don't have any way to deal with scripted node types yet, which could in principle by added with pynodes. The NodeCustomGroup type adds a way of scripting nodes by automating node groups which the
hardcoded system can then interpret like regular groups.

The new NodeCustomGroup type has the basic node_tree pointer property like the regular group node types and also uses the same socket interface system as regular groups. This means that input/output
sockets can be mapped to internal nodes in the same way as regular node groups in renderers and the compositor. On top of that, however, the NodeCustomGroup type can be subclassed in python scripts to flesh out
scripted node types with own draw functions, properties, updates and so on.

NB: Only cycles currently supports this node type and its derivatives, other systems may follow later.
2013-06-10 12:19:39 +00:00
Thomas Dinges
cf359f6c7f Cycles / Wavelength to RGB node:
* Added a node to convert wavelength (in nanometer, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.

Example render:
http://www.pasteall.org/pic/show.php?id=53202

ToDo:
* Move some functions into an util file, maybe a common util_color.h or so.
* Test GPU, unfortunately sm_21 doesn't work for me yet.
2013-06-09 20:46:22 +00:00
Brecht Van Lommel
28add50083 Fix #35696: cycles crash with no world assigned to scene, after recent changes. 2013-06-09 18:05:53 +00:00
Brecht Van Lommel
13b3b425f8 Fix #35665: cycles CUDA crash after recent changes. This works around a compiler
bug in CUDA 4.2 (solved in 5.5) with typedef'd function parameters.
2013-06-09 16:37:04 +00:00
Thomas Dinges
49115b4dd3 Cycles:
* Use float_to_int() functions in a few more places.
2013-06-09 15:09:15 +00:00
Brecht Van Lommel
d749413ef7 Fix related to #35681: avoid some unnecessary cycles updated when using exclude
render layers.
2013-06-09 11:57:51 +00:00
Antony Riakiotakis
b0d5555a06 Fix compilation of cycles for MinGW-w64 after recent commits. MinGW-w64 has conflicting redefinitions of the SSE functions in windows.h, so we will be using this header instead, since we can't always avoid including it instead of the sse headers. 2013-06-08 21:48:01 +00:00
Brecht Van Lommel
bcfff4f190 Cycles: invert mist pass so that 0 is nearby and 1 is far away. This is the
opposite of Blender Internal but it makes more sense I think.
2013-06-08 17:56:40 +00:00
Brecht Van Lommel
0a54311450 Fix #35672: missing update when changing light ray visibility during viewport render. 2013-06-08 13:43:38 +00:00
Thomas Dinges
e2c02c47ad Cycles / OpenCL:
* Fix for recent commits, ceilf is not available in OpenCL.
2013-06-08 11:38:23 +00:00
Brecht Van Lommel
c53b20b683 Cycles: window texture coordinates now work with orthographic cameras, this
was an old issue since the first version.
2013-06-08 10:51:33 +00:00
Brecht Van Lommel
58a290234b Cycles: ray visibility options now work for lamps and mesh lights, with and without
multiple importance sampling, so you can disable them for diffuse/glossy/transmission.

The Light Path node here is still weak and does not give this info. To make that
work we'd need to evaluate the shader multiple times which is slow and we can't
detect well enough when it is actually needed.
2013-06-07 18:59:23 +00:00
Brecht Van Lommel
b20a7e01d0 Cycles: experimental correlated multi-jittered sampling pattern that can be used
instead of sobol. So far one doesn't seem to be consistently better or worse than
the other for the same number of samples but more testing is needed.

The random number generator itself is slower than sobol for most number of samples,
except 16, 64, 256, .. because they can be computed faster. This can probably be
optimized, but we can do that when/if this actually turns out to be useful.

Paper this implementation is based on:
http://graphics.pixar.com/library/MultiJitteredSampling/

Also includes some refactoring of RNG code, fixing a Sobol correlation issue with
the first BSDF and < 16 samples, skipping some unneeded RNG calls and using a
simpler unit square to unit disk function.
2013-06-07 16:06:22 +00:00
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
Jens Verwiebe
84ba3f6521 Fix scons compile after GHOST_Sizer commit 2013-04-09 18:58:01 +00:00
Alexander Kuznetsov
f652b11ed1 Live window resizing on Windows
Custom implementation for resizing (GHOST_SizerWin32)

Some things still don't work:
* esc cancel
* max windows size
* aero (sizing) snap on win7

hbrBackground = 0 to disable clear screen.

Thanks to dfelinto for help in finding of root cause.
2013-04-09 17:21:05 +00:00
Brecht Van Lommel
e802efb7af Fix #34740: cycles rendering issue mixing glossy/glass BSDF's with zero or very
low roughness and same index of refraction.

Problem was bad float precision due to low roughness, which caused the pdf for
the different closures to not match properly.
2013-04-09 15:24:20 +00:00
Brecht Van Lommel
7cb4d78b52 Fix #34921: cycles rendered a specific scene with a small high poly object
contained in a large low poly object very slow, due to failure case of fast
multithread BVH binning. Tweaked parameter now to avoid this.
2013-04-08 20:04:03 +00:00
Campbell Barton
a4520320ef fix [#34900] Building blender as a python module is broken in trunk
patch provided by reporter - Martijn Berger (juicyfruit)

also quiet warnings for headless mode.
2013-04-08 05:01:35 +00:00
Thomas Dinges
68fc443194 Cycles UI:
* Revert ui.py changes from r55868, I merged that over manually with tweaks in r55858.
2013-04-07 08:42:08 +00:00
Tamito Kajiyama
4c42f5c8a9 Missing updates in the doc/ and intern/ folders during the merger in revision 55847. 2013-04-07 06:56:49 +00:00
Campbell Barton
63d523336f freestyle lineset tag attribute was defined but not used, also some code cleanup. 2013-04-07 01:38:03 +00:00
Thomas Dinges
9c117ba54e Properties Editor / Render Layers:
* Cycles Render layers UI was broken after freestyle merge (changes were not merged). Did manual edits now with some tweaks.
* Some layout fixes for Mask Layer.
2013-04-06 23:05:32 +00:00
Gaia Clary
92b6365e21 fix: #34871 Cycles/CUDA/sm_35: Build problems probably due to issues with float3 operators (on windows?) 2013-04-06 11:52:40 +00:00
Brecht Van Lommel
cf3ec257a2 Fix #34880: cycles motion blur render issue with some compilers. Actually is a bigger
problem where accessing float4 members with [] stops working due to optimizer, will
check that later.
2013-04-05 23:03:10 +00:00
Brecht Van Lommel
7404c1a553 Fix another part of #34877: cycles progress status text not showing correct with
per render layer samples in addition to the progress bar.

Also fixed job progress bar not working at all on high DPI / retina, was so small
the actual progress was not visible.
2013-04-05 17:57:26 +00:00
Thomas Dinges
5e0cdd6473 Code cleanup / Cycles / Object Attributes:
* Change some long "else if" conditions into switch case.
2013-04-05 17:03:59 +00:00
Sergey Sharybin
394a45a645 Fix #34877: The render status feedback (progress bar) does not take into account specific Renderlayer samples 2013-04-05 16:59:19 +00:00
Brecht Van Lommel
3863e72c73 Fix #34679: cycles image texture alpha fringes. New rule is now that color output
will not give straight RGB values if the alpha output is used, so that mixing with
a transparent BSDF gives the correct result.
2013-04-05 16:43:53 +00:00
Sergey Sharybin
e579400d92 Fixed typo in OCIO GLSL module, was using address to a pointer.. 2013-04-05 11:10:59 +00:00
Sergey Sharybin
a53a106065 Fix #34872: Every images are displayed as black in UV/image editor
Issue was caused by some mesa drivers does not support GL_RGBA16F.

Now added check around glTexImage2D to verify whether requested
internal format is actually supported. If not blender will fall
back to non-GLSL image display.
2013-04-05 11:01:35 +00:00
Brecht Van Lommel
54363910bc Attempt to fix #34871: random CUDA 3.5 compile failure due to recent change. 2013-04-04 23:52:33 +00:00
Brecht Van Lommel
c77f46d2dd Fix #34601: cycles OSL crash when using preview render and viewport render at
the same time, due to shared texture cache system.
2013-04-04 23:48:07 +00:00
Brecht Van Lommel
4c8e70d049 Fix #34700: orthographic camera DOF was still not working correct. 2013-04-03 17:32:30 +00:00
Brecht Van Lommel
743552ff2a Fix #34852: multilayer SSS material rendering different in progressive and
non-progressive integrator.
2013-04-03 16:12:13 +00:00
Sergey Sharybin
9c49e71216 Bunch of fixes for GLSL display transform
- GLSL shader wasn't aware of alpha predivide option,
  always assuming alpha is straight. Gave wrong results
  when displaying transparent float buffers.

- GLSL display wasn't aware of float buffers with number
  of channels different from 4, crashing when trying to
  display image with different number of channels.

  This required a bit larger changes, namely now it's
  possible to pass format (GL_RGB, GL_RGBAm GL_LUMINANCE)
  to glaDrawPixelsTex, This also implied adding format to
  glaDrawPixelsAuto and modifying all places where this
  functions are called.

  Now GLSL will handle both 3 and 4 channels buffers,
  single channel images are handled by CPU.

- Replaced hack for render result displaying with a bit
  different hack.

  Namely CPU conversion will happen only during render,
  once render is done GLSL would be used for displaying
  render result on a screen.

  This is so because of the way renderer updates parts
  of the image -- it happens without respect to active
  render layer in image user. This is harmless because
  only display buffer is modifying, but this is tricky
  because we don't have original buffer opened during
  rendering.

  One more related fix here was about when rendering
  multiple layers, wrong image would be displaying when
  rendering is done. Added a signal to invalidate
  display buffer once rendering is done (only happens
  when using multiple layers). This solves issue with
  wrong buffer stuck on the display when using regular
  CPU display space transform and if GLSL is available
  it'll make image displayed with a GLSL shader.

- As an additional change, byte buffers now also uses
  GLSL display transform.

  So now only dutehr and RGB curves are stoppers for
  using GLSL for all kind of display transforms.
2013-04-03 15:59:54 +00:00
Brecht Van Lommel
9cd197cd82 Fix incorrect OS X warning message in console when using multisample antialiasing
about number of samples not matching the requested number.
2013-04-02 19:18:38 +00:00
Sergey Sharybin
f871d9a82f Fixes for recent GLSL display space conversions
- Building without OCIO will give correct results again
- If GLSL failed to compile, fallback to glaDrawPixelsAuto
  will happen.
2013-04-02 17:28:29 +00:00
Brecht Van Lommel
5c74e6dae2 Cycles: small code cleanup + fix SSS closure mixed with other closures doing
a bit too much work.
2013-04-02 16:37:28 +00:00
Brecht Van Lommel
be1a5a2328 Fix 34831: SSS issue with non-progressive render, due to error in closure merging code. 2013-04-02 15:53:24 +00:00
Joerg Mueller
97ce56dc76 Bugfix for [#34845] FFmpeg: .wav file playback crashes Blender since r55693 2013-04-02 15:48:09 +00:00
Brecht Van Lommel
952f03150f Fix #34832: SSS render freeze with object instances. 2013-04-02 14:19:05 +00:00
Brecht Van Lommel
5ac6e1ae84 Fix #34833: crash using SSS node on windows, invalid memory access when building lookup table. 2013-04-02 13:34:50 +00:00
Antony Riakiotakis
d067ba9cbc Fix build for MinGW without opencollada (updated libs coming soon), MinGW64 now builds with opencollada 2013-04-02 02:05:03 +00:00
Brecht Van Lommel
07d027b102 Fix FFMPEG build error with older versions after planar formats commit. 2013-04-01 20:51:52 +00:00
Brecht Van Lommel
de9dffc61e Cycles: initial subsurface multiple scattering support. It's not working as
well as I would like, but it works, just add a subsurface scattering node and
you can use it like any other BSDF.

It is using fully raytraced sampling compatible with progressive rendering
and other more advanced rendering algorithms we might used in the future, and
it uses no extra memory so it's suitable for complex scenes.

Disadvantage is that it can be quite noisy and slow. Two limitations that will
be solved are that it does not work with bump mapping yet, and that the falloff
function used is a simple cubic function, it's not using the real BSSRDF
falloff function yet.

The node has a color input, along with a scattering radius for each RGB color
channel along with an overall scale factor for the radii.

There is also no GPU support yet, will test if I can get that working later.

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

Implementation notes:
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/Subsurface_Scattering
2013-04-01 20:26:52 +00:00
Brecht Van Lommel
40b05d364e Cycles: code refactoring to add generic lookup table memory. 2013-04-01 20:26:43 +00:00
Sergey Sharybin
03c337f61c Epic fail in original GLSL display transform commit
Apparently C== allowed to have implementations of
OCIOImpl::setupGLSLDraw, OCIOImpl::finishGLSLDraw and
OCIOImpl::freeGLState in two different files.

STUPID!
2013-04-01 13:41:45 +00:00
Sergey Sharybin
547342bf73 Hopefully compilation with FFmpeg 0.10 works fine now. 2013-04-01 10:53:29 +00:00
Joerg Mueller
271a7a5554 Audaspace: adding support for ffmpeg planar formats, breaks support for older ffmpeg versions. 2013-04-01 09:46:35 +00:00
Thomas Dinges
2c58e96685 Cycles / Shader Graph optimization:
* Unnecessary shader inputs inside the Mix Shader are now ignored, in case the factor is 0.0 / 1.0 and not connected. 
This way we save some render time for complex node graphs. 

Example: http://www.pasteall.org/pic/show.php?id=48226
Check the Mix Shader at the end: In this case, Cycles will now avoid the complete huge shader tree, and only calculate the Diffuse Shader.
Rendertime decreased from 1:50 min to 1:20 min on CPU. GPU rendering benefits as well from this. 

This only affects SVM, OSL was already doing these optimizations.
2013-03-31 01:18:10 +00:00