Commit Graph

2887 Commits

Author SHA1 Message Date
Dalai Felinto
03cc3b94c9 Fisheye Equidistant Lens algorith bugfix
r = lens * theta

Thanks for Adriano Oliveira for reporting this and chasing down the right formula.
Now fulldome works no longer need to use equisolid + a specific lens+sensor size.

And happy birthday to me. And yes, that's how I celebrate it ;)
2012-11-09 09:11:24 +00:00
Sergey Sharybin
ffbf0a1b12 Cycles: no need in spin lock in memory statistics
This functions are called from device code which is guaranteed
not to be called simultaneously from different threads.
2012-11-09 08:47:08 +00:00
Sergey Sharybin
76525d5398 Cycles: persistent images option
This option enables keeping loaded images in the memory in-between
of rendering.

Implemented by keeping render engine alive for until Render structure
is being freed.

Cycles will free all data when render finishes, optionally keeping
image manager untouched. All shaders, meshes, objects will be
re-allocated next time rendering happens.

Cycles cession and scene will be re-created from scratch if render/
scene parameters were changed.

This will also allow to keep compiled OSL shaders in memory without
need to re-compile them again.

P.S. Performance panel could be cleaned up a bit, not so much happy
     with it's vertical alignment currently but not sure how to make
     it look better.

 P.P.S. Currently the only way to free images from the device is to
       disable Persistent Images option and start rendering.
2012-11-09 08:46:53 +00:00
Brecht Van Lommel
f171d0f29c Fix #33125: cycles OSL crash with multiple render sessions running at the same time. 2012-11-09 03:10:22 +00:00
Campbell Barton
610d746c12 code cleanup: double promotion warnings with new bevel code & wrong use of NULL in cycles. 2012-11-09 03:08:02 +00:00
Brecht Van Lommel
863291bc8e Fix #33113: cycles not rendering motion blur correct with dying particles.
There were a bunch of other issues with dupli motion blur and syncing, the problem
being that there was no proper way to detect corresponding duplis between frames
or updates. As a solution, a persistent_id was added to the DupliObject. It's an
extension of the previous index value, with one index for each dupli level. This
can be used to reliably find matching dupli objects between frames. Works with
nested duplis, multiple particle systems, etc.
2012-11-08 16:35:28 +00:00
Brecht Van Lommel
e73408f247 Cycles: add strength input for normal map node. 2012-11-08 16:35:20 +00:00
Campbell Barton
617a73c573 code cleanup: unused defines & some formatting. 2012-11-08 06:46:10 +00:00
Campbell Barton
353ad46e10 code cleanup: quiet double promotion warnings 2012-11-07 23:52:33 +00:00
Jens Verwiebe
aa42934cef itask: reworked conditionals for osx version compatibility 2012-11-07 21:19:43 +00:00
Brecht Van Lommel
204113b791 Fix #33107: cycles fixed threads 1 was still having two cores do work,
because main thread works as well.
2012-11-07 21:00:49 +00:00
Bastien Montagne
01200ca2ac UI message fixes... 2012-11-07 14:56:53 +00:00
Jens Verwiebe
d7fe02936b Fix ITASK warnings 2012-11-07 11:57:51 +00:00
Jens Verwiebe
a68416e681 OSX: some more version target cleanups and corrections 2012-11-07 10:43:31 +00:00
Campbell Barton
852a41fb0e style cleanup, also remove redundant call to set_listbasepointers in free_main(). 2012-11-07 01:02:28 +00:00
Dalai Felinto
0890c2a4a0 support for string parameters in OSL nodes
for now subtype is not defined, but once we start parsing the metadata we can set texture inputs as FILEPATH
also, it takes relative strings and convert to absolute for all strings (which is arguably a good solution, but
should work for now)
2012-11-06 21:36:44 +00:00
Brecht Van Lommel
d68981158b Fix cycles crash with normal map node, issue with tangent sign attribute. 2012-11-06 21:27:59 +00:00
Brecht Van Lommel
3e9f2938f0 Cycles OSL: support for the trace(point pos, vector dir, ...) function, to trace
rays from the OSL shader. The "shade" parameter is not supported currently, but
attributes can be retrieved from the object that was hit using the
getmessage("trace", ..) function.

As mentioned in the OSL specification, this function can't be used instead of
lighting, the main purpose is to allow shaders to "probe" nearby geometry, for
example to apply a projected texture that can be blocked by geometry, apply
more “wear” to exposed geometry, or make other ambient occlusion-like effects.

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

Example .blend and render:
http://www.pasteall.org/blend/17347
http://www.pasteall.org/pic/show.php?id=40066
2012-11-06 19:59:10 +00:00
Brecht Van Lommel
209cd25745 Cycles OSL: phong_ramp(N, exponent, colors[8]) closure added, which works like
a specular ramp shader. Note this is OSL only still, for experimenting.

Patch by Thomas.
2012-11-06 19:59:07 +00:00
Brecht Van Lommel
27d647dcf8 Cycles: 4 new nodes.
* Tangent: generate a tangent direction for anisotropic shading. Can be either
  radial around X/Y/Z axis, or from a UV map. The default tangent for the
  anisotropic BSDF and geometry node is now always radial Z, for UV tangent use
  this node now.

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

* Normal Map: generate a perturbed normal from an RGB normal map image. This
  is usually chained with an Image Texture node in the color input, to specify
  the normal map image. For tangent space normal maps, the UV coordinates for
  the image must match, and the image texture should be set to Non-Color mode
  to give correct results.

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

* Refraction BSDF: for best results this node should be considered as a building
  block and not be used on its own, but rather mixed with a glossy node using a
  fresnel type factor. Otherwise it will give quite dark results at the edges for
  glossy refraction.

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

* Ambient Occlusion: controls the amount of AO a surface receives, rather than
  having just a global factor in the world. Note that this outputs a shader and
  not a color, that's for another time.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Ambient_Occlusion
2012-11-06 19:59:02 +00:00
Brecht Van Lommel
ccffb6811c Cycles: disable OpenCL in builds for now, since it's not working and is only
confusing users at this point. For experiments you can define the
CYCLES_OPENCL_TEST environment variable to make it show up in the UI.
2012-11-06 19:58:51 +00:00
Dalai Felinto
1c6c3ead4f quick hack to allow 10.8 to build again, will wait Jens for real fix
but basically the error I get is:
Error: redefinition of enumerator 'NSEventTypeRotate'
...

for all the NSEvents
2012-11-06 19:26:45 +00:00
Jens Verwiebe
acc8c654fc OSX: substitute all MAC_OS_X_VERSION defines with MAC_OS_X_VERSION_MIN_REQUIRED macros, to get more reliable version (api) covering 2012-11-06 15:19:49 +00:00
Sergey Sharybin
f07a563f3b Silent strict compiler flag.
Brecht, could you please verify it's indeed nothing should be done for frame node here?
2012-11-06 10:18:42 +00:00
Joshua Leung
2638728bd2 Bugfix: Missing ')' broke Cycles addon 2012-11-05 23:13:09 +00:00
Dalai Felinto
2d7598693e update fisheye tooltip - it was wrongly suggesting equidistant for fulldomes 2012-11-05 19:07:38 +00:00
Sergey Sharybin
a1b954d608 Update CMake rules for audaspace 2012-11-05 14:47:28 +00:00
Joerg Mueller
5a8d5f77af Audaspace:
Replacing AUD_Reference with boost::shared_ptr.
2012-11-05 14:24:35 +00:00
Sergey Sharybin
1231232169 Partial revert of own rev44548.
That was more like workaround which solved particular issue with freestyle
rendering, but introduced some more uncontrollable issues, main of which is
recursive fracture would likely suffer from non-manifolds results of previous
step.

Boolean operation is not the only way to generate zero-area face, it could
also happen with character animation and it's indeed better be solved from
freestule side.

This should fix: #33041 Boolean difference sometimes produces meshes with holes
2012-11-05 12:11:43 +00:00
Sergey Sharybin
b74ba5c595 Stupid copy-paste typo in tiles commit.
That was an example how you should not code :)
2012-11-05 11:57:14 +00:00
Sergey Sharybin
540c9d4208 Cycles: fix crash rendering textured objects in OpenCL
Issue was caused by changed order of texture slots -- float textures
have got lower slots indices than byte textures. OpenCL was still assuming
byte textures goes before float.
2012-11-05 08:05:24 +00:00
Sergey Sharybin
759ea40787 Render engines: replace number of x/y tiles with tile size
Now tile size is setting up explicitly instead of using number of tiles.

This allows better control over GPU performance, where having tiles aligned
to specific size makes lots of sense.

Still to come: need to update startup.blend  to make tiles size 64x64.
2012-11-05 08:05:14 +00:00
Sergey Sharybin
6eec49ed20 Cycles: memory usage report
This commit adds memory usage information while rendering.

It reports memory used by device, meaning:

- For CPU it'll report real memory consumption
- For GPU rendering it'll report GPU memory consumption, but it'll
  also mean the same memory is used from host side.

This information displays information about memory requested by Cycles,
not memory really allocated on a device. Real memory usage might be
higher because of memory fragmentation or optimistic memory allocator.

There's really nothing we can do against this.

Also in contrast with blender internal's render cycles memory usage
does not include memory used by scene, only memory needed by cycles
itself will be displayed. So don't freak out if memory usage reported
by cycles would be much lower than blender internal's.

This commit also adds RenderEngine.update_memory_stats callback which
is used to tell memory consumption from external engine to blender.
This information is used to generate information line after rendering
is finished.
2012-11-05 08:04:57 +00:00
Sergey Sharybin
d71004ea69 Cycles: multi-gpu rendering doesn't know for sure which sample is being sampled,
so only report tile number is being processed
2012-11-05 08:04:41 +00:00
Joshua Leung
ead0005b20 Compile fix on Mingw:
"interface" appeared to be a shadowed var (or even a macro/define elsewhere)
which was causing errors like:
intern\cycles\blender\blender_mesh.cpp:124:23: error: multiple types in one
declaration
intern\cycles\blender\blender_mesh.cpp:124:23: error: declaration does not
declare anything [-fpermissive]
2012-11-05 02:40:10 +00:00
Brecht Van Lommel
2ba840652d Cycles: improve Anisotropic BSDF node, changing the Roughness U/V inputs to
Roughness, Anisotropy and Rotation. Also a fix for automatic tangents and
OSL attribute handling.

Meaning of new sockets explained in the documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Anisotropic
2012-11-04 22:31:32 +00:00
Ton Roosendaal
35e5432029 Possible bugfix 32474
Windows systems: text editor, text object, doesn't allow to input the standard
set of ALT+key characters (the ones coming from the OS).

- Reverted fix january 2012 - that meant to use text object ALT+keys
- Removed old (90ies) feature for hardcoded special characters in Text object.
  (OS delivers this now)

Will wait for confirmation by windows compiler :)
2012-11-04 13:34:13 +00:00
Campbell Barton
7579a9ec37 code cleanup: double promotions 2012-11-04 10:20:16 +00:00
Campbell Barton
ff014a3077 code cleanup: cmake - add missing headers, remove directories from source listing.
also remove logImageLib.c - empty file.
2012-11-03 15:49:38 +00:00
Brecht Van Lommel
9db3f2368c Cycles: use mikktspace now for computing tangents from UV maps. This avoids ugly
averaged tangents at UV seams but instead now the seams will show as discontinuities
in the tangent.
2012-11-03 15:36:02 +00:00
Campbell Barton
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
Campbell Barton
060ea498b0 use library argument for bpy.path.abspath in case of linked nodes. 2012-11-03 15:05:09 +00:00
Brecht Van Lommel
eb87529e23 Cycles OSL: shader script node
Documentation here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/OSL
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.65/Cycles

These changes require an OSL build from this repository:
https://github.com/DingTo/OpenShadingLanguage

The lib/ OSL has not been updated yet, so you might want to keep OSL disabled
until that is done.

Still todo:
* Auto update for external .osl files not working currently, press update manually
* Node could indicate better when a refresh is needed
* Attributes like UV or generated coordinates may be missing when requested from
  an OSL shader, need a way to request them to be loaded by cycles
* Expose string, enum and other non-socket parameters
* Scons build support

Thanks to Thomas, Lukas and Dalai for the implementation.
2012-11-03 14:32:35 +00:00
Brecht Van Lommel
615fe0295f Cycles OSL: refactoring and fixes
* Moved kernel/osl/nodes to kernel/shaders
* Renamed standard attributes to use geom:, particle:, object: prefixes
* Update stdosl.h to properly reflect the closures we support
* Fix the wrong stdosl.h being used for building shaders
* Add geom:numpolyvertices, geom:trianglevertices, geom:polyvertices attributes
2012-11-03 14:32:13 +00:00
Joerg Mueller
b59290a835 Preparation to use boost::shared_ptr. 2012-11-03 09:49:49 +00:00
Brecht Van Lommel
40b3c3a4e6 RNA C++: fixes for lookup_int/lookup_string which were not working in some cases,
and don't use ReportList for function arguments.
2012-11-02 13:36:20 +00:00
Campbell Barton
db8b7fcabb style cleanup and correct own invalid comment. 2012-10-31 11:45:41 +00:00
Brecht Van Lommel
0c3d3e5562 Cycles: optimization to not compile shaders and load images that are not
used by any mesh/lamp/world.
2012-10-30 11:51:17 +00:00
Campbell Barton
eb69d1c1ae style cleanup: also quiet harmless compiler warning. 2012-10-29 15:43:54 +00:00
Campbell Barton
0c6a0b293f style cleanup 2012-10-28 15:23:16 +00:00
Campbell Barton
e903701450 style cleanup 2012-10-27 01:46:47 +00:00
Brecht Van Lommel
d19894c8cb Fix #32972: cycles crash switching OSL to SVM in viewport render. 2012-10-26 09:25:02 +00:00
Sergey Sharybin
2505984b52 Cycles: use simplier strategy in next_tile for viewport rendering
No need to find tile closest to rendered center in this case, just
return first possible tile. Saves some computation power.
2012-10-25 12:03:36 +00:00
Joerg Mueller
73f5944ebc Audaspace:
OpenAL multichannel playback support fixed. This should fix bug [#31561] Audio only coming from Front Left in layout and bge.
2012-10-25 10:42:09 +00:00
Joerg Mueller
ad2dffe7c6 Audaspace:
Fix for channel mapping bug. Now 7.1 channels should get mapped correctly.
2012-10-25 10:25:30 +00:00
Joerg Mueller
e66ee1ca9f Audaspace:
RAII locking implementation. This should fix bug [#32096] Background music stops when playing 3D sounds.
2012-10-24 21:33:44 +00:00
Brecht Van Lommel
05f563339b Fix #31894: cycles node muting not working, was not implemented yet. 2012-10-24 21:05:44 +00:00
Brecht Van Lommel
d430046afc Fix blender player link error with scons, include opennl for lapacian smooth modifier. 2012-10-24 19:26:00 +00:00
Sergey Sharybin
1fecf8ff31 Patch #29142: Reduce hopping when switching between perspective and orthographic on 3D view
Patch by Yasuhiro Fujii, thanks!

Original issue was that in vases viewport's lens are different from default
value switching between perspective and orthographic projections will change
viewplane a lot, which is disorienting and annoying.
2012-10-24 16:15:46 +00:00
Sergey Sharybin
d4ee07537e Fix #32951: Progressive refine crashing Blender when used with multiple cuda devices
This time issue was caused by Save Buffers enabled and the reason blender
crashed was tiles generated by cycles didn't match tiles generated by
openexr.

Currently solved it in a way that background rendering will allocate tiles
in the same way render parts are generated in blender. Viewport rendering
will still be using sliced image, but it's more tricky to change and it's
no so big deal for now.
2012-10-24 14:43:29 +00:00
Campbell Barton
c93978d445 code cleanup: some edits for unused vars in recent smooth addition and some style edits. 2012-10-24 11:31:57 +00:00
Sergey Sharybin
40242c2f44 Cycles: update buffers only once in a while when progressive refine is used
It'll mimic the same behavior as regular tile rendering update and it should
give pretty noticeable boost on simpler scenes.
2012-10-23 17:24:23 +00:00
Sergey Sharybin
933864da18 Fix #32951: Progressive refine crashing Blender when used with multiple cuda
Issue was caused by offline rendering could have been allocated the same tile
to different devices and in this case buffers would become invalid.

Made it more clear in the code, so now it's  flag for tile manager to indicate
whether tiles should always be allocated for the same device or not.

Also cleaned a way how tile index for progressive refine is calculating,
which is now avoids tricky computation based on tile coordinate and it's
dimensions.
2012-10-23 16:36:53 +00:00
Campbell Barton
9c58865d20 code cleanup: remove $Id's that crept back in, also osl style edits 2012-10-23 11:47:23 +00:00
Sergey Sharybin
8a2c30ac57 RNA C++ API improvements
Added support of such features, as:

- Ability to call RNA functions using C++ classes
  For example RenderEngine.tag_update

- Property setters (for scalars and arrays)
  Used Qt/jQuery-like getters/setters style, meaning Class.prop() is a getter,
  Class.prop(value) is a setter.

Still to come:

Collection functions are not currently registering inside a property
Meaning BlendData.meshes wouldn't be a subclass of BlendDataMeshes result
you'll need to explicitly create BlendDataMeshes for now instead of doing
BlendData.meshes.remove()
2012-10-22 17:34:16 +00:00
Brecht Van Lommel
57b7f405a4 Fix related to #32929: update list of available devices for cycles rendering
while Blender is running, not only on load. It might help a case when Blender
is started before the CUDA driver is fully initialized.
2012-10-22 14:04:44 +00:00
Brecht Van Lommel
655e24979b Fix #32947: cycles color to float conversion issue after integer socket commit. 2012-10-22 12:22:15 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
Bastien Montagne
0ee62e4ea6 Revert part of r51487 (those files are needed by the boolean ops code, /intern/bsp/...)! 2012-10-22 06:47:54 +00:00
Campbell Barton
a4b2783169 small optimization for BLI_heap(), give some speedup in decimeter.
- use unsigned ints only (where mixing signed/unsigned)
- turn heap_swap into an inline function, add SWAP_TVAL macro to swap values using a temp value as storage.
- added type checking SHIFT3/4 macros

also style cleanup for CTR_Map
2012-10-22 03:25:53 +00:00
Campbell Barton
226a5ee834 remove LOD_Decimator (c++ decimator), now replaced by bmesh decimator. also remove CTR c++ classes that are no longer used. 2012-10-22 02:39:26 +00:00
Bastien Montagne
26d0492653 A final bunch of UI messages fixes and tweaks, and some BKE_report()<->BKE_reportf() fixes. 2012-10-21 14:02:30 +00:00
Lukas Toenne
285947318f Fix for OSL closure base class. The 'blur' method is not implemented and must be declared pure virtual ('= 0') to avoid compiler error (on Ubuntu 12.04, gcc 4.6.3). 2012-10-21 09:10:47 +00:00
Campbell Barton
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
Joshua Leung
a1a0c8da13 Bugfix [#32932] Can't see the Speaker properties when using Cycles 2012-10-21 05:23:58 +00:00
Campbell Barton
7deb8d8a26 code cleanup: spelling 2012-10-20 20:36:51 +00:00
Campbell Barton
bc8f602601 style cleanup 2012-10-20 18:46:57 +00:00
Thomas Dinges
ba7a7c0925 Cycles / OSL:
* Fix Mapping node, used wrong identifiers for Vector In/Out.
2012-10-20 17:50:24 +00:00
Brecht Van Lommel
73b79a6763 Cycles OSL: light path, texture coordinate, bump and blended box mapping now up
to date and working.
2012-10-20 15:09:36 +00:00
Brecht Van Lommel
e287c97fea Cycles: disable motion blur for CUDA entirely now, also goes wrong on other
architectures. Still did not find a good solution.
2012-10-20 15:09:27 +00:00
Thomas Dinges
950524722c Cycles:
* Build system fixes for closure refactor.
2012-10-20 14:08:49 +00:00
Lukas Toenne
d36dc6d8de Integer socket support in Cycles. Int values are already supported natively in OSL, but were not used as actual ints on the SVM stack. This patch implements all the necessary functionality to support reading input values from RNA properties and convert between SHADER_SOCKET_INT and other types. 2012-10-20 13:11:45 +00:00
Brecht Van Lommel
9a1c1f132d Cycles OSL: most closure code is now shared between OSL and SVM. Also fix
transmission pass and filter glossy option.

The BSDF closure class is now more similar to the SVM closures, and includes
some flags and labels that are needed to properly categorize the BSDF's for
render passes. Phong closure is gone for the moment, needs to be adapated to
the new structure still.
2012-10-20 12:18:00 +00:00
Brecht Van Lommel
3abef3a2e6 Cycles OSL: some build system tweaks to avoid global includes and definitions,
which ensures there is no conflict with other libraries, and avoids full rebuild
when toggling OSL on/off.
2012-10-20 12:17:45 +00:00
Campbell Barton
9f8070d047 code cleanup:
- define array sizes for functions that take vectors.
- quiet some -Wshadow warnings.
- some copy/paste error in readfile.c made it set the same particle recalc flag twice.
2012-10-20 08:02:18 +00:00
Thomas Dinges
ef80ff105f Cycles/ Layer Weight Node:
* Small tweak for the blend value, to avoid division by zero. 

Thanks to Brecht for pointing out the solution.
2012-10-19 13:51:37 +00:00
Campbell Barton
9b07c98bb4 code cleanup: minor style change & quiet warning, also add assert for BM_vert_splice() to check for invalid use. 2012-10-19 03:07:58 +00:00
Brecht Van Lommel
497ea5f306 Fix #32912: cycles crash with dead particles, actual crash was caused by an
inconsistency in the particle system code, using <= and <. Also tightened up
checks on cycles side to avoid other potential crashes.
2012-10-18 15:00:32 +00:00
Sergey Sharybin
b861f8c3f8 Cycles: suppress path to nvcc appearing in the console in cases
cuda toolkit is installed to different place than /usr/local/cuda
(i.e. happens when using cuda toolkit from repository)
2012-10-18 13:48:02 +00:00
Lukas Toenne
d396bf3546 Fix for OSL compile errors.
1) object_fetch_transform_motion omits the per-object motion blur test (r51394), must use object_fetch_transform_motion_test.
2) KernelCamera.ndctoworld has been removed (r51402), do transform invert directly.
2012-10-18 13:16:57 +00:00
Brecht Van Lommel
95963289c8 More fixes related to #32900, motion blur with cuda sm 2.0 still disabled. 2012-10-18 12:45:27 +00:00
Campbell Barton
812b17f306 style cleanup 2012-10-18 04:51:37 +00:00
Brecht Van Lommel
9d260eedeb Fix #32904: strange pattern on subdivided cube with anistropic shader. Now
tangents from generated coordinates are computed per pixel on the fly, avoids
bad interpolation of singularities.
2012-10-17 23:09:12 +00:00
Thomas Dinges
b2142d6533 Cycles: OSL compile fixes. 2012-10-17 22:58:18 +00:00
Brecht Van Lommel
6915394a3b Attempts to fix CUDA issues on sm 2.0 cards, still no luck getting motion blur
working, but this should make it not crash.

Also fix for wrong shutter time, should have been shorter.
2012-10-17 22:48:29 +00:00
Brecht Van Lommel
4ad103cedd Fix cycles motion blur not working correct with shutter time > 2.0. The soft
limit is 2.0, and anything beyond that is extrapolation which might not work
so well but is still allowed.
2012-10-17 17:27:30 +00:00
Jason Wilkins
11908552db Missing semicolons in intern/ghost/intern/GHOST_WindowCocoa.mm 2012-10-17 17:20:09 +00:00
Thomas Dinges
17c82a7e57 Cycles / OSL:
* Layer Weight is now available in OSL.
2012-10-17 16:16:35 +00:00
Campbell Barton
0c2a1500f2 minor changes
- stub from last commit was incorrect (copied old docs)
- decimator was making copy of quadric for no reason.
- correct typo
2012-10-17 16:10:04 +00:00
Brecht Van Lommel
d08b06f773 Cycles: motion blur is now curved and passes exactly through the midpoint.
Previously it would only interpolate between the previous and next frame,
which meant it might not hit the current frame position.
2012-10-17 12:55:23 +00:00
Brecht Van Lommel
afb75ad2af Cycles: add Tangent input for Anisotropic BSDF.
Also refactor SVM BSDF code, preparing it to be shared with OSL.
2012-10-17 12:17:17 +00:00
Lukas Toenne
0551aa14bb Fix for OSL 'background' attributes (attributes that are not associated to a particular object). Atm this is only the 'ray_length' attribute.
Background attributes are used as fallback in two cases:
1) Non-object light samples (e.g. lamp shaders)
2) Fallback if no implicit object attribute can be found
2012-10-17 12:12:26 +00:00
Campbell Barton
536d9fec80 code cleanup:
- move object_iterators.c --> view3d_iterators. (ED_object.h had to include ED_view3d.h which isn't so nice)
- move projection functions from view3d_view.c --> view3d_project.c (view3d_view was becoming a mishmash of utility functions and operators).
- some some cmake includes as system-includes.
2012-10-17 04:13:03 +00:00
Campbell Barton
fa06aab433 code cleanup: add check spelling osl 2012-10-17 01:53:29 +00:00
Campbell Barton
aeda5142ef style cleanup: make OSL follow our C style convention. http://wiki.blender.org/index.php/Dev:Doc/CodeStyle 2012-10-17 01:47:37 +00:00
Thomas Dinges
a1af01249d Cycles / OSL:
* Add Light Falloff Node.
2012-10-17 00:28:46 +00:00
Thomas Dinges
b4a83e1d0e Cycles / OSL:
* Ray Length is now available in OSL (via get_attribute)
2012-10-16 22:42:05 +00:00
Daniel Genrich
c9fdf6e496 Smoke: Animated collision objects do no longer block smoke. Smoke gets transfered velocity from moving collision object.
Result:
http://www.youtube.com/watch?v=KRtc8eAgaZA

Part of my Blender Development Project Phase III, merged from Smoke2 branch

WIP docs:
http://wiki.blender.org/index.php/User:Genscher/Smoke_Development_Project_2012
2012-10-16 17:01:22 +00:00
Lukas Toenne
617cdb4642 Fix for second bug reported in #32846: Particle emitters are still shown for secondary instances with "show emitter" disabled. This requires checking the duplicator visibility on dupli objects themselves after generating the dupli-list.
The emitter visibility option is messy design, it makes such checks unnecessarily complicated. A better approach would be to allow non-mesh objects to carry particle data, these objects would just be invisible anyway without having to care about extra settings. However, this conflicts with the simplistic particle design of "owner is the emitter" ...
2012-10-16 15:38:52 +00:00
Brecht Van Lommel
7680f88f18 Fix object motion blur crash with lamp sampling(?), missed a check.
Motion blur documentation is here:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.65/Cycles#Motion_Blur
2012-10-16 13:20:57 +00:00
Sergey Sharybin
9be4c94204 Cycles: non-camera viewport render border support
This makes it possible to do a border render inside a viewport even
when not looking through the camera.

Render border could be defined by Ctrl-B shortcut (works for both
camera render border and viewport render border).

Camera render border could still be defined using Shift-B (so no
muscule memory would be broken). Currently used a special flag of
operator to do this, otherwise you'll need to either two operators
with different poll callback or it could go into conflict with a
border zoom,

Border render of a viewport could be enabled/disabled in View
panel using "Render Border" option.
2012-10-16 11:57:46 +00:00
Lukas Toenne
af537c283c Fix for (camera) motion blur changes in Cycles OSL. Compilation was broken due to changed object transform functions. Also added a few missing renderer service implementations for matrix callbacks. 2012-10-16 10:59:35 +00:00
Brecht Van Lommel
7521ce083d Cycles: object motion blur enabled, so in addition to camera motion, moving
objects in the scene will also cause motion blur.

This change does come with a bit of a slow down to the CPU rendering kernel even
with motion blur disabled, due to extra overhead in handling of object matrices.
It's a few percentages on simpler scenes, not so noticeable on more complex ones.
With motion blur enabled rendering is of course also slower as would be expected,
though from testing especially GPU rendering handles it quite well.

This does not support motion blur from deforming objects yet, only translation,
scale and rotation. Deformation blur is probably for another release.
2012-10-16 10:48:19 +00:00
Campbell Barton
af6abc8c80 MESH_OT_vert_connect was missing select flush (newly created edges were not selected).
also <120 line length for cycles property descriptions.
2012-10-16 03:21:22 +00:00
Brecht Van Lommel
fe16b26206 Cycles: fix some update issues with camera motion blur, and do some more work
for getting object motion blur ready.
2012-10-15 21:12:58 +00:00
Daniel Genrich
8a25e2d2b2 Smoke: Merge parts of Smoke2 branch
New:
----------
Collision objects do cause vorticity when passing through smoke

Part of my Smoke Development Project (milestone III)
2012-10-15 19:57:18 +00:00
Brecht Van Lommel
fe47ae525d Cycles: tweak progressive refine tooltip to make it more clear 2012-10-15 17:56:53 +00:00
Brecht Van Lommel
c10c6b1cea Fix #32844: cycles camera motion blur producing completely blurred frames sometimes. 2012-10-15 17:56:40 +00:00
Daniel Genrich
827c70abd8 Update to stable Eigen 3.1.1
- Fixes several bugs within the Eigen library:
http://eigen.tuxfamily.org/index.php?title=ChangeLog#Eigen_3.1.1
2012-10-15 16:29:23 +00:00
Sergey Sharybin
c5300c638c Solve some issues with smoke when using strict compile flags
- Mark some functions as static
- ifdef-ed currently unused functions from spectrum.cpp
- Fixed missing prototype for smectrum() function
2012-10-15 09:25:03 +00:00
Campbell Barton
4d4664d98f code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
Campbell Barton
3a947cf537 code cleanup: remove redundant casts 2012-10-14 08:49:01 +00:00
Campbell Barton
27e54f4d37 code cleanup: remove redundant casts. quiet some qualifier warnings. 2012-10-14 07:40:16 +00:00
Sergey Sharybin
3b88a29abf Cycles: progressive refine option
Just makes progressive refine :)

This means the whole image would be refined gradually using as much
threads as it's set in performance settings. Having enough tiles is
required to have this option working as it's expected.

Technically it's implemented by repeatedly computing next sample for
all the tiles before switching to next sample.

This works around 7-12% slower than regular tile-based rendering, so
use this option only if you really need it.

This commit also fixes progressive update of image when Save Buffers
option is enabled.

And one more thing this commit fixes is handling display buffer with
Save Buffers option enabled. If this option is enabled image buffer
wouldn't have neither byte nor float buffer until image is fully
rendered which could backfire in missing image while rendering in
cases color management cache became full.

This issue solved by allocating byte buffer for image buffer from
tile update callback.

Patch was reviewed by Brecht. He also made some minor edits to
original version to patch. Thanks, man!
2012-10-13 12:38:32 +00:00
Brecht Van Lommel
51105bb2bd Fix for wrong cycles tangent in some cases, was missing transform. 2012-10-13 12:11:01 +00:00
Brecht Van Lommel
fe09b24e86 Cycles: per-BSDF normal input and new Bump node.
Each BSDF node now has a Normal input, which can be used to set a custom normal
for the BSDF, for example if you want to have only bump on one of the layers in
a multilayer material.

The Bump node can be used to generate a normal from a scalar value, the same as
what happens when you connect a scalar value to the displacement output.

Documentation has been updated with the latest changes:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes

Patch by Agustin Benavidez, some implementation tweaks by me.
2012-10-10 15:56:43 +00:00
Brecht Van Lommel
56f798db8c Cycles: make anistropic BSDF / tangent work without UV map, based on generated
coordinates map to a sphere.
2012-10-10 14:21:58 +00:00
Daniel Genrich
cb634b9100 Google Summer of Code project: "Smoke Simulator Improvements & Fire".
Documentation & Test blend files:
------------------
http://wiki.blender.org/index.php/User:MiikaH/GSoC-2012-Smoke-Simulator-Improvements

Credits:
------------------
Miika Hamalainen (MiikaH): Student / Main programmer

Daniel Genrich (Genscher): Mentor / Programmer of merged patches from Smoke2 branch
Google: For Google Summer of Code 2012
2012-10-10 13:18:07 +00:00
Brecht Van Lommel
f0a9b66469 Cycles: Anisotropic BSDF enabled, with tangents now computed from the active UV map.
It's using the Ward BSDF currently, which has some energy loss so might be a bit
dark. More/better BSDF options can be implemented later.

Patch by Mike Farnsworth, some modifications by me. Currently it's not possible yet
to set a custom tangent, that will follow as part of per-bsdf normals patch.
2012-10-10 13:02:20 +00:00
Brecht Van Lommel
94f869a256 Cycles: camera motion blur enabled.
Still more work needed to get object motion blur ready.
2012-10-09 18:37:14 +00:00
Brecht Van Lommel
5f52285a01 Fix cycles task manager calling pthread_join() twice. I haven't seen any bugs
from this but best to fix anyway as it causes undefined behavior. Pointed out
on irc by dslammu, thanks!
2012-10-09 14:28:29 +00:00
Daniel Genrich
a580c891a7 Bugfix [#32703] elbeem's isSimworldOk() will never return FALSE
Fixed as suggested by Campbell, thank you!
2012-10-09 13:09:03 +00:00
Brecht Van Lommel
6a82b985c3 Fix #32815: cycles environment render as lamp crash with resolution >= 1024. 2012-10-08 12:15:18 +00:00
Brecht Van Lommel
e3ab85a3f5 Revert fix for #31806, needs a better solution, can hang compiling some shaders. 2012-10-07 14:15:50 +00:00
Nicholas Bishop
e8bc62e162 Avoid unecessary minimizer calculations in dualcon
* The minimize() function, which solves a least-squares problem, is
  only needed for sharp remesh mode, but was being calculated for
  smooth and blocks modes as well. Disabling this calculation when
  it's not needed gives a big performance boost.
2012-10-06 18:28:38 +00:00
Nicholas Bishop
8b4baa347f Code cleanups for dualcon octree
* Move InternalNode operators from Octree class into InternalNode
  struct

* Constify various member functions
2012-10-06 18:28:34 +00:00
Thomas Dinges
f7d61831e1 Cycles / OSL:
* OSL UI message did not show up when device type was GPU, but User Preferences were None. Also remove experimental check, more convenient for testing.
2012-10-06 17:11:53 +00:00
Lukas Toenne
78978dcd80 Fix for a case of 'static initialization fiasco' with OSL closure variables. The parameter lists are using OIIO::TypeDesc static standards, which are also static variables. With static OSL libraries these are not initialized when the closure parameter lists are initialized, so OSL rejects the closure types.
Putting static initialization into functions works just as well, but ensures the OIIO::TypeDesc access is delayed until initialization is complete.
2012-10-06 16:28:02 +00:00
Brecht Van Lommel
098d611c7b Fix for UV texture coordinate problem in cycles, after recent fix. 2012-10-06 11:52:54 +00:00
Brecht Van Lommel
e23b202693 Fix part of cycles/osl light pass rendering, transmission still not correct. 2012-10-05 17:17:19 +00:00
Brecht Van Lommel
b67d75fad2 Fix generated texture coordinate issue after "from dupli" option was added. 2012-10-05 14:54:32 +00:00
Sergey Sharybin
4c3620c69d Fixed compilation error on widows
Was caused by mixing up own C-API typedefs with OCIO's
2012-10-05 10:05:26 +00:00
Sergey Sharybin
862decfc82 Booleans: epsilon for planar checks seems a bit too small for single precision math
This could solve issue #32748: Boolean Modifiers Making unneeded edges?
2012-10-05 07:31:30 +00:00
Thomas Dinges
3eba198818 * Fix Scons build when OCIO is disabled.
Still fails when it's enabled though (unresolved symbols).
2012-10-04 23:44:03 +00:00
Brecht Van Lommel
fedc8e1722 Cycles: add "From Dupli" option for texture coordinate node. This gets the
Generated and UV coordinates from the duplicator of instance instead of the
object itself.

This was used in e.g. Big Buck Bunny for texturing instanced feathers with
a UV map on the bird. Many files changed, mainly to do some refactoring to
get rid of G.rendering global in duplilist code.
2012-10-04 21:40:39 +00:00
Brecht Van Lommel
282f98a84d Fix #31806: cycles crash rendering a particular node setup with multiple mix/add
shader nodes.
2012-10-04 20:12:16 +00:00
Brecht Van Lommel
2a08c0dc56 Code cleanup: fix some clang checker warnings. 2012-10-04 20:11:54 +00:00
Sergey Sharybin
ef107d1a4d Color Management: fallback to stub ocio implementation in cases when
ocio configuration file failed to load

This solves issues with infinite NULL-checks to prevent crashes in
such situations. Currently only happens if there's no configuration
file at all, but could be tweaked further to fallback if this file
isn't usable by blender.
2012-10-04 13:39:08 +00:00
Campbell Barton
dc8340fa33 correct some include dirs not being included as SYSTEM paths in cmake. 2012-10-02 03:18:48 +00:00
Brecht Van Lommel
b1f1ee5138 Fix/workaround #31987: sample as lamp for environment textures not working
with multi GPU when resolution > 128.
2012-10-01 18:31:32 +00:00
Brecht Van Lommel
02fc3eb56c Fix #32725: cycles border render + panorama camera not working in viewport. It will
still look a bit strange since the viewport can't actually render such panorama views,
so the opengl drawn scene behind the border render will not match up.
2012-10-01 17:09:12 +00:00
Thomas Dinges
b012c3cf46 Cycles UI Tweak:
* Don't disable Progressive option, just grey out.
2012-09-29 23:45:35 +00:00
Brecht Van Lommel
71195b247e Fix #32072: cycles shadow pass gave different results with/without emitting
materials present, even though it's only taking lamp shadows into account.
2012-09-28 13:41:34 +00:00
Brecht Van Lommel
1d2e59ba1c Fix cycles "synchronizing object" status being shown when it was already finished. 2012-09-28 12:37:20 +00:00
Campbell Barton
589ada7f0c code cleanup: correct spelling 2012-09-28 06:45:20 +00:00
Brecht Van Lommel
46d82a2a12 Fix #32618: cycles multithreaded image loading could crash with CUDA, was a
threading issue that happens once every X frames.
2012-09-27 17:42:09 +00:00
Campbell Barton
8a51d235e6 pep8 cleanup 2012-09-26 21:19:51 +00:00
Campbell Barton
483a6cd6c2 fix for cycles/python script error in normal panel 2012-09-26 19:23:06 +00:00
Sergey Sharybin
c9d4956f45 Color Management: restore abort() in cases of error and WITH_ASSERT_ABORT enabled 2012-09-26 13:21:10 +00:00
Sergey Sharybin
f45f229af2 Use ${OPENEXR_INCLUDE_DIR} instead of ${OPENEXR}/include
There's no CMake symbol names ${OPENEXR} which lead to using /include
as an include directory, which isn't correct.
2012-09-25 07:34:45 +00:00
Jens Verwiebe
87a8aea313 OSL/cmake: the non-intrusive parts, so other os-maintainers can take code over 2012-09-24 19:06:28 +00:00
Brecht Van Lommel
ae7c3eaceb Fix #32638: mesh double sided normals option not available in any Cycles panel. 2012-09-24 14:36:20 +00:00
Campbell Barton
3e6340214d fix for incorrect declaration rna_Object_free_duplilist() in cycles. 2012-09-23 05:02:06 +00:00
Campbell Barton
34114b3b75 code cleanup: remove/comment unused defines 2012-09-22 13:40:31 +00:00
Campbell Barton
1541ee20c8 Improvement to own commit r50810.
Add an optional ghost argument to set the new mouse location when un-grabbing. - without this the mouse would flicker at the old location before moving to the new location - when using the color picker for eg.
2012-09-22 13:23:12 +00:00
Thomas Dinges
c39ac85899 Cycles:
* Change Addons Link to point to the manual instead of the dev documentation. 
* Add sm_30 to Linux build configuration.
2012-09-21 17:53:52 +00:00
Thomas Dinges
fad952f423 * Fix for r50782, new "Geometry Data" Panel was missing in Cycles. 2012-09-21 13:56:10 +00:00
Thomas Dinges
b170eda2d6 Cycles UI:
* Followup for r50550, added checks to the "Samples" Button in World and Lamp Context to properly show the correct options.
2012-09-21 13:32:52 +00:00
Sergey Sharybin
a4f73c5694 Fix #32579: Sequencer crash when changing render dimensions
Memory limitor's queue could be affected when it's being iterated
on enforcing limits -- that's because iteration could free color
managed image buffers.

Fixed by getting least priority element after every element was
freed. Could be optimized a bit, but it anyway shouldn't be so
slow due to specific of cache limiting and limit enforcing finish
condition.
2012-09-20 12:59:16 +00:00
Campbell Barton
fbe13ab84a style cleanup 2012-09-20 12:29:28 +00:00
Campbell Barton
b0c7c8756f code cleanup: cycles now uses system includes for boost/oiio.. etc, so we dont get warnings from system headers. 2012-09-20 09:04:43 +00:00
Campbell Barton
bc69b3a8df style cleanup 2012-09-20 01:32:13 +00:00
Campbell Barton
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
Campbell Barton
5d56a901a8 code cleanup: c++ - use empty() rather than size(), use prefix operators for non-primitive types - recommended for non primitive types. 2012-09-20 00:55:32 +00:00
Brecht Van Lommel
51eed03e94 Fix #31888: cycles crashes using movie for image texture. This is not supported
but should not crash either. This fix is more of a workaround, the crash seems
to be in openimageio or one of the libraries it uses.
2012-09-19 23:55:12 +00:00
Brecht Van Lommel
2e80d9ccc0 Fix #32018: non-progressive integrator crash. 2012-09-19 17:09:11 +00:00
Sergey Sharybin
d0f4c96394 Color Management: don't apply display transform on Non-Color images
Also don't color manage data buffers in texture painting.

Makes it possible to view heights and normal maps in proper space
and also paint on them without applying extra transformation.
2012-09-19 15:01:36 +00:00
Brecht Van Lommel
22fdc63b86 Color management: fix crashes and memory leaks when using custom OCIO configuration
Also fix some missing color spaces when loading some OCIO configurations, by falling
back to scene linear if role is not found. There can still be some errors in the
console, need to check this further.

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management#OpenColorIO_Configuration
2012-09-18 19:20:26 +00:00
Campbell Barton
a4ff2b9140 code cleanup: warnings 2012-09-18 03:15:12 +00:00
Campbell Barton
f6251a1f32 code cleanup: warning and style 2012-09-17 22:34:42 +00:00
Lukas Toenne
efaf512406 Revert r50528: "Performance fix for Cycles: Don't wait in the main UI thread when resetting devices."
This commit leads to random freezes in Cycles rendering:
https://projects.blender.org/tracker/index.php?func=detail&aid=32545&group_id=9&atid=498

The goal of this commit was to remove UI lag for OSL, but since that is not officially supported yet, better revert it until a proper fix can be implemented in 2.65.
2012-09-17 12:07:06 +00:00
Brecht Van Lommel
3f3fec37e5 Fix cycles panorama camera not working with depth of field, patch by
Daniel M. Basso, thanks!
2012-09-17 11:25:29 +00:00
Brecht Van Lommel
89eeae955b Cycles: change preview "resolution divider" that gave the number of lower
resolutions to render, to a "start resolution" which gives the resolution
to start at.

This avoids unnecessary rendering of small resolutions in small viewports,
and avoids long waiting on big viewports.
2012-09-17 10:55:18 +00:00
Sergey Sharybin
fc7de23537 Color Management: fix crash when displaying render preview if OCIO was disabled buildtime 2012-09-16 15:17:22 +00:00
Lukas Toenne
acb2c7e0d1 OSL Fix for fireflies in velvet bsdf, ported over from SVM fix in r41738. 2012-09-16 13:17:39 +00:00
Sergey Sharybin
7f1cfbfff5 Fix some warnings treated as errors here. 2012-09-16 12:33:39 +00:00
Campbell Barton
e84b300d9e use the format attribute in more places, disable X11 options when building with GHOST_SDL 2012-09-16 10:39:19 +00:00
Campbell Barton
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Campbell Barton
c2a1dcf621 fix for error in recent commit (made function static that shouldn't have been), add extra gcc warnings to cmake. 2012-09-16 01:35:00 +00:00
Campbell Barton
d724d0adfe code cleanup: quiet warnings for gcc's -Wundef, -Wmissing-declarations 2012-09-16 00:26:36 +00:00
Campbell Barton
2d6839ce65 code cleanup: remove unused structs and also some style cleanup. 2012-09-15 23:13:24 +00:00
Campbell Barton
518c80fc94 remove unused parts of raskter module. 2012-09-15 23:05:34 +00:00
Lukas Toenne
d9788e4fa4 Yet another OSL fix: Some functions are missing stubs that were not used in old OSL implementation yet. 2012-09-15 18:08:51 +00:00
Lukas Toenne
f4b7a8a545 Fix for OSL 'Normal' node: the Direction parameter is of 'normal' type instead of generic 'vector'. 2012-09-15 16:31:11 +00:00
Lukas Toenne
41081b3e8c Generate compatible OSL shader parameter names in cases where the node has and input and output with the same name. In that case the convention is to add suffixes "In" and "Out" respectively.
Example:

Blender node has one input "Color" and one output "Color"

-> OSL parameter names should be "ColorIn" and "ColorOut"
2012-09-15 16:31:07 +00:00
Lukas Toenne
21964e6538 OSL implementation of RGB ramp node.
The sampled color ramp data is passed to OSL as a color array. This has to be done as actual float[3] array though, since the Cycles float3 type actually contains 4 floats, leading to shifting color components in the array.

Additional parameter set functions for arrays have been added to the Cycles OSL interface for this purpose.
2012-09-15 15:41:37 +00:00
Thomas Dinges
b6fd8ae97a Cycles / OSL:
* Fix Musgrave Texture, used wrong Perlin Noise (0..1) instead of -1..1. Also added comment to noise_basis() to make it clear which noise type is used there.
2012-09-15 15:03:43 +00:00
Thomas Dinges
a55d13bb9e Cycles / OSL:
* Fixes for Voronoi, Gradient and Magic Textures. SVM and OSL renders excactly the same now.
2012-09-15 13:56:09 +00:00
Sergey Sharybin
b93da9b01e Color Management, Stage 1: Initial OpenColorIO library integration
This commit integrates support of OpenColorIO library into build systems.

It also contains C-API for OpenColorIO library which could be used by Blender.

CMake has got find rules familiar to OpenImageIO's one which makes it easier
for build system to find needed libraries and includes. Scons only could use
explicitly defined paths to libraries and includes.

C-API would be compiled and Blender would be linked against C-API and OpenColorIO
but it wouldn't affect on Blender behavior at all.

OpenColorIO could be disabled by setting up WITH_OCIO to Off in CMake and
setting WITH_BF_OCIO in Scons.
2012-09-15 10:03:17 +00:00
Campbell Barton
3fc2ba5259 syntax error in previous commit 2012-09-15 05:09:42 +00:00