Commit Graph

3788 Commits

Author SHA1 Message Date
Campbell Barton
f6b37f34ec code cleanup:
- add missing headers from cmake (own omission)
- quiet rna_test.c unused define warnings.
- minor style edits
- spelling corrections and ignore all uppercase words with spell checking script.
2013-09-05 19:56:49 +00:00
Sergey Sharybin
44ff79c432 Added a brie instruction how to build simple memtest 2013-09-05 16:32:44 +00:00
Sergey Sharybin
be42cd54df Ghost test application could be compiled again
Was an IRC request to have Ghost application up
and running for investigation purposes.
2013-09-05 16:22:07 +00:00
Campbell Barton
90b9fa3608 fix [#36459] Official blenderplayer can not go fullscreen on Linux
use modified patch from Alex Fraser (z0r)
2013-09-04 23:43:25 +00:00
Mitchell Stokes
42deb95583 Ghost_SDL: Fixing the DEF_CURSOR macro so it works in release builds. 2013-09-04 21:57:14 +00:00
Thomas Dinges
cb19d9fa35 Code cleanup / Cycles:
* Removed unused member of the device_memory template.
2013-09-04 16:24:58 +00:00
Thomas Dinges
65f21d9b43 Code cleanup / Cycles:
* Avoid special code, when Subsurface is enabled.
Ideally we should only use the function, and get rid of the extra duplicate, but this is slower on CUDA.
2013-09-04 16:11:21 +00:00
Thomas Dinges
37e91d8965 Compile fix / Cycles:
* 'T' is now also used for the Subsurface closure.
2013-09-04 13:37:35 +00:00
Nathan Letwory
d5fba56b38 Add new cursor types to data handling to account for Intuos 4 device (pen and eraser).
Thanks to Ayden Polat for helping to find out the cursor type codes.
2013-09-04 12:10:02 +00:00
Brecht Van Lommel
efe7793152 Fix cycles CUDA/OpenCL build error after recent change. 2013-09-04 01:04:14 +00:00
Brecht Van Lommel
60e5abe71f Fix a few issues reported by coverity scan. 2013-09-03 22:39:21 +00:00
Brecht Van Lommel
b314209356 Cycles: add a sharpness input to the Cubic SSS falloff. When set to 1 this will
give a result more similar to the Compatible falloff option. The scale is x2
though to keep the perceived scatter radius roughly the same while changing the
sharpness. Difference with compatible will be mainly on non-flat geometry.
2013-09-03 22:39:17 +00:00
Alexander Kuznetsov
a3410a1b47 Fixed crash on Visual Studio 2013-09-03 15:30:07 +00:00
Campbell Barton
2dc988df8c reorder BLI_strict_flags.h include so its not conflicting with stdio.h on apple. 2013-09-03 04:39:12 +00:00
Campbell Barton
8f1e51a7d9 remove WINDOWS checks in cmake, this variable isn't defined on windows and checks weren't needed.
also remove redundant dot_v3v3 in shrinkwrap constraint.
2013-09-03 03:04:44 +00:00
Thomas Dinges
dace5b9b84 Cycles:
* Document the members of the Ray struct.
2013-09-02 15:43:28 +00:00
Sergey Sharybin
35b61a7512 Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.

Makes code easier to follow and allows to manage special
attributes in more efficient way.

Thanks Campbell for review!
2013-09-01 15:01:15 +00:00
Brecht Van Lommel
4bcccc24c1 Fix OS X compile error after enabling strict build flags for this module. 2013-09-01 14:10:41 +00:00
Brecht Van Lommel
f3252c261d Fix #36620: sss + indirect light rendering artifacts, due to wrong correlation in
the random numbers.
2013-09-01 14:10:40 +00:00
Campbell Barton
fe427f0561 kd-tree,
- replace numbers with defines for allocation increments and default array size.
- move array reallocation into a static function (deduplicate 2x).

also fix own mistake with uninitialized slop-space var in memory printing statistics.
2013-09-01 08:58:46 +00:00
Joshua Leung
33c68846de Mingw/Windows Compiling Fix
This commit attempts to fix the following error:

intern\guardedalloc\intern\mallocn.c: In function 'rem_memblock':
intern\guardedalloc\intern\mallocn.c:977:48: error: conversion to 'intptr_t' from 'size_t' may change the sign of the result [-Werror=sign-conversion]

From the references I've managed to find, it appears that
the second arg to munmap() should be size_t not intptr_t.
Fortunately though, we don't use this arg anyways atm, so 
this should be quite harmless...
2013-09-01 05:12:36 +00:00
Campbell Barton
9ad5f32fc0 use strict flags for guarded alloc 2013-09-01 02:46:34 +00:00
Thomas Dinges
ce326e20c8 Cycles:
* World background samples (Branched Path) were missing after integrator rename.
2013-08-31 16:36:54 +00:00
Thomas Dinges
f4f4dac523 Cleanup:
* Silence /arch:SSE2 warning on msvc x64.
2013-08-31 03:18:55 +00:00
Thomas Dinges
8f699dbd5e Cycles:
* More build fixes, 2 link errors remain. http://www.pasteall.org/45279

Note: Probably those paths should only be added for Windows and Linux, as "OPENIMAGEIO_LIBPATH" already inherit them for Mac OS. Also "OPENIMAGEIO_LIBRARIES" inherits the libs for Linux already. Is that intended or a lack of consistency?
2013-08-31 02:56:03 +00:00
Thomas Dinges
615894323a Cycles / Standalone:
* Fix some link errors on Windows, still missing png, zlib, jpeg and tiff.

I couldn't yet figure out the correct flags to pass on here, and the 2300 lines huge main CMakeLists file doesn't help with it...
2013-08-31 02:25:43 +00:00
Brecht Van Lommel
29f6616d60 Cycles: viewport render now takes scene color management settings into account,
except for curves, that's still missing from the OpenColorIO GLSL shader.

The pixels are stored in a half float texture, converterd from full float with
native GPU instructions and SIMD on the CPU, so it should be pretty quick.
Using a GLSL shader is useful for GPU render because it avoids a copy through
CPU memory.
2013-08-30 23:49:38 +00:00
Brecht Van Lommel
60ff60dcdc RenderEngine API: add viewport draw utility functions to bind a GLSL fragment
shader for converting colors from linear to display space, based on the scene
color management settings.

if engine.support_display_space_shader(scene): # test graphics card support
	engine.bind_display_space_shader(scene)
	# draw pixels ..
	engine.unbind_display_space_shader()
2013-08-30 23:49:35 +00:00
Brecht Van Lommel
6785874e7a Fix #36137: cycles render not using all GPU's when the number of GPU's is larger
than the number of CPU threads
2013-08-30 23:09:22 +00:00
Campbell Barton
427317d8d8 use CMAKE_DL_LIBS rather then linking libdl directly.
added to cycles standalone too.
2013-08-30 20:26:57 +00:00
Thomas Dinges
499bec2a85 Fix for [#36610] The new sky model produces strange results
* Clamp theta sky coordinates, to prevent a negative solarElevation. 

Note: This means that you cannot get absolute night with the new model, but this is not supported anyway. So when you reach the maximum sunset, use the World Strength to further decrease the light.
2013-08-30 18:04:23 +00:00
Thomas Dinges
a51f8e4353 Cycles / Standalone:
* Standalone can now be compiled without the GUI, making the glut dependency optional. 

Added WITH_CYCLES_STANDALONE_GUI cmake flag.
2013-08-30 17:34:27 +00:00
Brecht Van Lommel
0933c6093e Fix #36611: cycles issue loading png file with 2 channels. 2013-08-30 17:01:44 +00:00
Campbell Barton
e8605f9df9 quiet compiler warnings 2013-08-30 16:52:54 +00:00
Thomas Dinges
0502fc0112 Cycles Standalone:
* Fix compiler warning, == / = mismatch.
2013-08-30 16:39:39 +00:00
Brecht Van Lommel
9135425607 Attempted fix for #36569: couldn't unmap memory errors on Windows. The guardedalloc optimizations were not entirely thread safe for mmap. 2013-08-29 23:46:44 +00:00
Mitchell Stokes
07e655dfa6 Cleaning up some prints related to SDL. 2013-08-29 22:48:37 +00:00
Mitchell Stokes
d4eeca430d Adding support for enabling/disabling vsync to Ghost_SDL. 2013-08-29 22:48:31 +00:00
Brecht Van Lommel
978080707c Fix part of #36594: 16 bit tiff not loading with correct color space in cycles. 2013-08-29 20:53:20 +00:00
Sergey Sharybin
034d5a9578 Use static odifier for non-public functions in new sky model. 2013-08-29 12:36:02 +00:00
Campbell Barton
1ac57ccbc8 correct own recent commit, malloc_usable_size() isn't valid for mmap()'d memory. 2013-08-28 22:12:40 +00:00
Brecht Van Lommel
841fe45df9 Cycles: change Gaussian subsurface scattering falloff to be more similar to
the Cubic falloff, see here for details.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering
2013-08-28 19:22:46 +00:00
Thomas Dinges
7ba41a3c7c Cycles / OpenCL:
* Some fixes for OpenCL, was broken after recent changes.
2013-08-28 14:36:47 +00:00
Thomas Dinges
d539bd4672 Cycles / Sky Texture:
* Added a new sky model by Hosek and Wilkie: "An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/ 

Example render:
http://archive.dingto.org/2013/blender/code/new_sky_model.png
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Sky_Texture

Details:
* User can choose between the older Preetham and the new Hosek / Wilkie model via a dropdown. For older files, backwards compatibility is preserved. When we add a new Sky texture, it defaults to the new model though. 
* For the new model, you can specify the ground albedo (see documentation for details). 
* Turbidity now has a UI soft range between 1 and 10, higher values (up to 30) are still possible, but can result in weird colors or black. 
* Removed the limitation of 1 sky texture per SVM stack. (Patch by Lukas Tönne, thanks!)

Thanks to Brecht for code review and some help! 

This is part of my GSoC 2013 project, SVN merge of r59214, r59220, r59251 and r59601.
2013-08-28 14:11:28 +00:00
Campbell Barton
1a6b364c28 should fix builds for osx 2013-08-28 11:22:29 +00:00
Campbell Barton
d1d6a13297 include slop-space in debug statistics (gcc/clang only) 2013-08-28 10:17:26 +00:00
Thomas Dinges
ff4e018753 Cycles / Standalone:
* Rename test to standalone.

Note: New CMAKE flag is WITH_CYCLES_STANDALONE.
2013-08-27 02:37:48 +00:00
Brecht Van Lommel
60ca0558c0 Fix issue in last subsurface commit with branched path tracing, was rendering too bright. 2013-08-24 15:36:14 +00:00
Brecht Van Lommel
722d0d92ad Cycles: reduce noise using regular path tracing + subsurface scattering with
new cubic and gaussian falloff. Like the branched path tracer, this will now
shade all intersection points instead of using one at random.
2013-08-24 15:02:08 +00:00
Campbell Barton
af1c274be7 skip building moto if its not needed. 2013-08-24 10:23:41 +00:00
Campbell Barton
b97334f992 add GPL header to treehash.c and add missing includes to cmake. 2013-08-24 03:17:28 +00:00
Thomas Dinges
8b20dfe60e Cycles:
* Fix Cycles using wrong AA sample values, after integrator renaming.
2013-08-24 00:27:20 +00:00
Brecht Van Lommel
e25ad0778f Fix #36545: crash with branched path tracing, correlated multi-jittered
sampling and subsurface scattering.
2013-08-23 23:04:50 +00:00
Bastien Montagne
5b83a89c81 Followup to r59434 : py UI scripts edits.
Notes:
* Made those edits by full checking of py files, so I should have spoted most needed edits, yet it remains quite probable I missed a few ones, we'll fix if/when someone notice it...
* Also made some cleanup "on the road"!
2013-08-23 20:41:21 +00:00
Brecht Van Lommel
01e22d1b9f Cycles: more code refactoring to rename things internally as well. Also change
property name back so we keep compatibility.
2013-08-23 14:34:34 +00:00
Brecht Van Lommel
22f4874877 Cycles: change Progressive sampling option in UI to an enum of "Path Tracing"
and "Branched Path Tracing", to try to make it more clear that this is not
related to progressive refinement, non-progressive was always a bad name anyway.
2013-08-23 14:08:40 +00:00
Brecht Van Lommel
805cca3903 Fix clang compile warning. 2013-08-23 14:08:39 +00:00
Thomas Dinges
f560d25666 Code cleanup / Cycles:
* Some style tweaks for hair code.
2013-08-23 12:19:35 +00:00
Thomas Dinges
e203c4c390 Cycles / Sampling UI:
* Do not show Total Samples print for Progressive, when Square Samples are disabled. In this case it's obvious even without the print. :)
2013-08-23 11:39:48 +00:00
Campbell Barton
e8dced9074 style cleanup: pep8 2013-08-23 04:04:46 +00:00
Thomas Dinges
fc9d4bdf73 Cycles / Sampling UI:
* Add a "Total Samples" info at the bottom of the panel.
This makes understanding the Non-Progressive integrator easier, as it displays how many samples are used for the different ray types. 

* Rename Squared Samples to Square samples, to indicate that the action is not already done. The new Total Samples info should make this easier to understand now as well. Also added back for Progressive integrator, for consistency. 

Screenshot:
http://www.pasteall.org/pic/show.php?id=57980
2013-08-22 19:57:56 +00:00
Brecht Van Lommel
0b42f14079 Fix #36526: SSS + hair crash after recent changes. 2013-08-21 12:20:38 +00:00
Brecht Van Lommel
5d97c93c08 Fix compiler warning due to undefined BVH_FUNCTION_FEATURES with patch by Campbell,
and a coverity warning about use of uninitialized variables with OSL.
2013-08-20 18:25:59 +00:00
Thomas Dinges
605f7f4b9f Code cleanup / Cycles:
* Remove unused hair presets enum.
2013-08-20 11:22:26 +00:00
Campbell Barton
f3654ce6b6 fix incorrect docs [#36518] Vector.rotate() does not return value as documented 2013-08-20 08:41:34 +00:00
Sergey Sharybin
ba6b83d63d Get rid of PATH_MAX in Ghost System X11
The reason of this is because PATH_MAX is not guaranteed
to be defined on all platforms and Hurd doesn't define it.

So either we need to support arbitrary long file path or
we need to define own maximum path length.

The rule here would be:

- If it's not big trouble to support arbitrary long paths
  (i.e. in ghost by using std::string instead of char*)
  then arbitrary long path shall be implemented.

- For other cases to use PATH_MAX please include BLI_fileops.h
  which takes care of making sure PATH_MAX is defined.

Additional change: get rid of own changes made yesterday
which were supposed to make storage.c work fine in cases
PATH_MAX is not define, but on the second though it lead
to unneeded complication of the code.

Thanks Campbell for review!
2013-08-20 08:33:04 +00:00
Campbell Barton
20fdea918d code cleanup: confirm include guards to our convention 2013-08-19 14:40:16 +00:00
Sergey Sharybin
cbfd2a8e62 Apparently sizeof(unsigned) is 4 bytes on both 32 and 64 bit platforms
For now assume sizeof(int) == 4 for all supported platforms, could be
changed in the future.

Added an assert to functions which depends on this this, so we'll
easily notice bad things happening.
2013-08-19 14:03:44 +00:00
Bastien Montagne
c79e175d9b Fix [#36454] 'Tiles' settings in Render/Performance panel don't respect keyframes
These are not animatable! Note this is the case of most (all?) render settings, maybe we should go over both Cycles and internal ones, there are still quite a bunch of them that are marked as animatable... :/
2013-08-19 13:30:17 +00:00
Sergey Sharybin
499ccf731b Forgot this in previous commit
Solves compilation issues on Win and OSX

--
svn merge -r59180:59181 ^/branches/soc-2013-depsgraph_mt
2013-08-19 10:53:10 +00:00
Sergey Sharybin
c0f8e15295 Speedup for guarded allocator
- Re-arrange locks, so no actual memory allocation
  (which is relatively slow) happens from inside
  the lock. operation system will take care of locks
  which might be needed there on it's own.

- Use spin lock instead of mutex, since it's just
  list operations happens from inside lock, no need
  in mutex here.

- Use atomic operations for memory in use and total
  used blocks counters.

This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.

There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization
2013-08-19 10:51:40 +00:00
Sergey Sharybin
efa836531e Commit atomic operations file
Not currently used, but needed for some further changes
2013-08-19 10:44:18 +00:00
Sergey Sharybin
018ab045e3 Added check for whether thread lock is being removed while thread is using guarded alloc.
--
svn merge -r58788:58789 ^/branches/soc-2013-depsgraph_mt
2013-08-19 10:38:27 +00:00
Campbell Barton
47c23750e8 style cleanup: indent/whitespace 2013-08-19 01:48:44 +00:00
Thomas Dinges
676b019846 Cycles:
* Fix 16 byte alignment for constant hair kernel data.
2013-08-18 22:25:37 +00:00
Thomas Dinges
8080c10c32 Cycles / SSS:
* OSL rendered Black with Compatible Fallof option, fixed. 

Note: OSL uses compatible scattering when "Compatible" or "Bicubic" is selected. I guess compatible will be removed later? If not we need to fix this properly.
2013-08-18 20:49:58 +00:00
Stuart Broadfoot
a71f84606a Fix compile of last commit 2013-08-18 15:09:51 +00:00
Brecht Van Lommel
b9ce231060 Cycles: relicense GNU GPL source code to Apache version 2.0.
More information in this post:
http://code.blender.org/

Thanks to all contributes for giving their permission!
2013-08-18 14:16:15 +00:00
Brecht Van Lommel
d43682d51b Cycles: Subsurface Scattering
New features:

* Bump mapping now works with SSS
* Texture Blur factor for SSS, see the documentation for details:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering

Work in progress for feedback:

Initial implementation of the "BSSRDF Importance Sampling" paper, which uses
a different importance sampling method. It gives better quality results in
many ways, with the availability of both Cubic and Gaussian falloff functions,
but also tends to be more noisy when using the progressive integrator and does
not give great results with some geometry. It works quite well for the
non-progressive integrator and is often less noisy there.

This code may still change a lot, so unless you're testing it may be best to
stick to the Compatible falloff function.

Skin test render and file that takes advantage of the gaussian falloff:
http://www.pasteall.org/pic/show.php?id=57661
http://www.pasteall.org/pic/show.php?id=57662
http://www.pasteall.org/blend/23501
2013-08-18 14:15:57 +00:00
Stuart Broadfoot
2fd11a6617 Updates for the Cycle Hair UI. With the following changes
- Removed the cycles subdivision and interpolation of hairkeys.
- Removed the parent settings.
- Removed all of the advanced settings and presets.
- This simplifies the UI to a few settings for the primitive type and a shape mode.
2013-08-18 13:41:53 +00:00
Thomas Dinges
8b955e9b19 Cycles / Sky Model:
* Replaced the Preetham model with the newer Hosek / Wilkie model:
"An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/ 

* We use the sample code data, which comes with the paper, but removed some unnecessary parts, we only need the xyz version.
* New "Albedo" UI paraemeter, to control the ground albedo (between 0 and 1). 
* Works with SVM only atm (CPU and CUDA). 

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

ToDo / Open Questions:
* OSL still uses the old model, will be done later. In the meantime it's useful to compare the two models this way.
* The new model needs a much weaker Strength value (0.01), otherwise it's white. Can this be fixed? 
* Code cleanup.
2013-08-17 16:08:03 +00:00
Thomas Dinges
0786eebd11 Merged revision(s) 59108-59184 from trunk/blender into soc-2013-dingto. 2013-08-16 12:50:13 +00:00
Thomas Dinges
9591957c8a Cycles / Motion Blur:
* Added a new panel "Settings" to the object tab.
* Motion blur can now be enabled/disabled on a per object basis, so we can disable motion blur for certain objects.
* Also added some code for the Motion Multiplier, to weaken/strengthen the motion effect per object, but that is still disabled and hidden from the UI.
2013-08-16 12:18:01 +00:00
Sergey Sharybin
58d7ae891d Blender might be compiled without guardedalloc again
This is useful for benchmark tests, to make CPU cache
utilization as good as we could with current design.
2013-08-15 07:36:56 +00:00
Joerg Mueller
c8f75fb5b1 Adding a new state for sound handles in audaspace: stopped.
Now sounds that stopped playing but are still kept in the device can be differentiated from paused sounds with this state.
This should also fix the performance issues mentioned in [#36466] End of SequencerEntrys not set correctly.
Please test if sound pausing, resuming and stopping works fine in the BGE and sequencer, my tests all worked fine, but there might be a use case that needs some fixing.
2013-08-14 21:21:00 +00:00
Thomas Dinges
2c2206a272 Cycles:
* Remove an unneeded return in shader_bsdf_eval(), function is void. 
* if / else if tweak in shader_bsdf_ao().
2013-08-14 19:38:14 +00:00
Campbell Barton
2f5e10f7b8 include order change for osl, fixes gcc compile error - undefined uintptr_t 2013-08-14 06:51:18 +00:00
Thomas Dinges
ace1dbf77f Merged revision(s) 59035-59107 from trunk/blender into soc-2013-dingto.
Skipping 59034 (Non-Progressive on GPU).
2013-08-13 09:15:03 +00:00
Thomas Dinges
8cda3264bd Code cleanup:
* Some typo fixes.
2013-08-13 08:43:31 +00:00
Lukas Toenne
795fa1f199 Fix #36437 Cycles no longer rendering Emitter object (Particle Systems). The change r58999 was ignoring the "show_emitter" setting by particles (the result would be the same as long as hair was not
used). If particle emitters are forced to show all other of the usual duplicator hiding should be disabled.
2013-08-12 06:53:17 +00:00
Thomas Dinges
9dfd2823c4 Code cleanup / Cycles:
* Remove unused "PathThroughput" variable.
* Don't compile unused voronoi code, we only use Distance Squared atm. 
* Various typo and comment fixes.
2013-08-11 16:55:24 +00:00
Thomas Dinges
48ae40ccdf Code cleanup / Cycles:
* Rename "curve_kernel_data" to just "curve", to avoid redundant naming.
2013-08-11 15:27:04 +00:00
Thomas Dinges
30f279be26 Code cleanup / Cycles:
* Remove code for the unused Wave texture variations. 

We have quite some unused code in the texture area, I guess it doesn't harm to clean a bit up here. 
We can always get the code back from SVN if we need something.
2013-08-10 00:52:57 +00:00
Thomas Dinges
743a7a4a4b Cycles:
* GPU kernel can now be compiled without __NON_PROGRESSIVE__ again, was broken after my last commit. Also add a check for have_error(), in case the GPU kernel comes without Non-Progressive, to avoid a crash.

* Don't compile progressive kernel twice on CPU, if __NON_PROGRESSIVE__ would be disabled there.
2013-08-09 20:03:49 +00:00
Brecht Van Lommel
be7b4e26b1 Fix cycles not rendering with 1x1 resolution anymore, not so common for users
but nice for debugging.
2013-08-09 19:55:46 +00:00
Brecht Van Lommel
fd263bf725 Fix cycles passes UI panel to line up better. 2013-08-09 19:55:45 +00:00
Thomas Dinges
a18112249d Cycles / Non-Progressive integrator:
* Non-Progressive integrator is now available on the GPU (CUDA, sm_20 and above). 

Implementation details:
* kernel_path_trace() has been split up into two functions:
kernel_path_trace_non_progressive() and kernel_path_trace_progressive().

* We compile two CUDA kernel entry functions (in kernel.cu) for the two integrators, they are still inside one .cubin file but due to the kernel separation there should be no performance problem. I tested with the BMW file on my Geforce 540M and the render times were the same for 100 samples (1.57 min in my case).

This is part of my GSoC project, SVN merge of r59032 + manual merge of UI changes for this from my branch.
2013-08-09 18:47:25 +00:00
Thomas Dinges
e924df98cb Merged revision(s) 58994-59032 from trunk/blender into soc-2013-dingto. 2013-08-09 17:30:21 +00:00
Thomas Dinges
17494b9fe8 Cycles / Non-Progressive integrator:
* Code refactor to split the GPU kernel into two, one for each integrator.
This way we can enable Non-Progressive integrator on GPU in trunk without a performance drop.

Thanks to Brecht for some help and review!
2013-08-09 17:23:54 +00:00
Brecht Van Lommel
9d9c64582b Fix #36355: cycles render of objects with both duplis and hair would not render
the hair in some cases.
2013-08-07 19:02:15 +00:00
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