Commit Graph

76 Commits

Author SHA1 Message Date
Sergey Sharybin
097aa852cf Cycles: Silent paranoid uninitialized GCC warnings in release kernels 2015-06-13 16:29:54 +02:00
Sergey Sharybin
e2354e64d2 Cycles: Cleanup, spaces around assignment operator
Did some bad spacing in recent commits, better to get rid of those so
they does not confuse those who're working on sources.
2015-04-07 00:25:54 +05:00
Sergey Sharybin
c1d8ddacaf Cycles: Avoid doing paranoid checks in filepath of builtin images
Originally we thought it's needed in order to distinguish builtin file from
filename which starts with '@', but the filepath is actually full path there
and it's unlikely to have file system where '@' is a proper root character.

Surprisingly this does not give visible speed differences, but it's still
nice to get rid of redundant check.
2015-04-07 00:11:47 +05:00
Sergey Sharybin
7c19239bf9 Cycles: Support bultin 3d textures with OSL backend 2015-04-06 23:29:29 +05:00
Sergey Sharybin
5ff132182d Cycles: Code cleanup, spaces around keywords
This inconsistency drove me totally crazy, it's really confusing
when it's inconsistent especially when you work on both Cycles and
Blender sides.

Shouldn;t cause merge PITA, it's whitespace changes only, Git should
be able to merge it nicely.
2015-03-28 00:15:15 +05:00
Sergey Sharybin
e224b5b9ca Cycles: OSL kernel now also ignores maybe-uninitialized
This is a bit of a mess because of the header dependency hell, but
since the tweak is small enough it's gonna be fine.
2015-02-02 22:15:33 +05:00
Thomas Dinges
ee36e75b85 Cleanup: Fix Cycles Apache header.
This was already mixed a bit, but the dot belongs there.
2014-12-25 02:50:24 +01:00
Campbell Barton
112032f2ff Cleanup: cycles whitespace 2014-11-08 13:37:42 +01:00
Sergey Sharybin
d5f978b3cc Cycles: Be ready for new OIIO and OSL libraries
Even tho it's not 100% clear when we'll switch to OSL-1.6 we'd better
start preparing earlier for this, so we don't spend time on this later.

Plus this code helps troubleshooting some OSL issues, which requires
testing with latest versions of OSL.
2014-11-04 16:19:45 +05:00
Campbell Barton
efee3be1d3 Cycles: enable double promotion warning /w gcc 2014-10-08 10:58:40 +02:00
Thomas Dinges
1b5ec32ed9 Cleanup: Avoid some defines for scene_intersect(), related to Min Width. 2014-09-24 11:32:29 +02:00
Sergey Sharybin
a192facd8c Fix T41276: OSL bug in getmessage ("trace", "geom:name" , output) 2014-08-05 17:54:08 +06:00
Thomas Dinges
dadf31f0b8 One more fix for new OSL libs. 2014-07-25 11:23:15 +02:00
Thomas Dinges
6582215f87 Cycles: Updates for new OSL 1.5 API.
Differential Revision: https://developer.blender.org/D662

Patch by Sergey and myself.
2014-07-24 23:07:49 +02:00
Sergey Sharybin
baa0f0ee1a Cycles: Support builtin images for OSL shading backend
This means packed images and movies are now supported when using OSL
backend for material shading.

Uses special file name to distinguish whether image is builtin or not.
This part might become a bit smarted or optimized a bit, but it's good
enough with this implementation already.
2014-06-13 20:42:28 +06:00
Sergey Sharybin
dc2daf7a67 Fix T40482: Cycles matlib file crashes
it's possible that runtime optimizer would call get_attribute
with NULL renderstate. As per documentation, it's valid to
return false in that cases and in worst case we'll just miss
some possible optimization.

Supporting such cases would require some bigger changes to
Cycles since attributes are only set to up for the kernel
after shader compilation.

Thanks Brecht for review!
2014-06-05 02:33:21 +06:00
Thomas Dinges
7fb33e5c43 Cleanup: Comments and unused variables. 2014-05-24 07:28:33 +02:00
80e137e826 Fix T39946: OSL + tangent space normal maps not working in Cycles. 2014-05-06 16:39:50 +02:00
Campbell Barton
d828d44d7a Cycles: use LIKELY/UNLIKELY macros
Gives overall ~3% speedup in own tests for BMW scene.
2014-05-05 03:49:22 +10:00
Campbell Barton
dc13969e48 Style cleanup: indentation, braces 2014-05-05 02:19:08 +10:00
Campbell Barton
e86dbf6877 Code cleanup: avoid int/uint mixup in cycles 2014-05-05 01:30:02 +10:00
Carlo Andreacchio
7765b73f6d Cycles: add Transparent Depth output to Light Path node.
This can for example be useful if you want to manually terminate the path at
some point and use a color other than black.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D454
2014-04-21 14:44:36 +02:00
27043b8e40 Cycles code internals: add support for mesh voxel grid attributes.
These are internally stored as a 3D image textures, but accessible like e.g.
UV coordinates though the attribute node and getattribute().

This is convenient for rendering e.g. smoke objects where data like density is
really a property of the mesh, and it avoids having to specify the smoke object
in a texture node, instead the material will work with any smoke domain.
2014-03-29 13:03:48 +01:00
393216a6df Cycles code refactor: move more code to geom folder, add some comments. 2014-03-29 13:03:48 +01:00
e8b1cfed0a Cycles code refactor: replace magic ~0 values in the code with defines. 2014-03-29 13:03:47 +01:00
6020d00990 Cycles: add support for mesh deformation motion blur. 2014-03-29 13:03:47 +01:00
0509553b5e Cycles code refactor: changes to make adding new primitive types easier. 2014-03-29 13:03:46 +01:00
84470a1190 Cycles code refactor: move geometry related kernel files into own directory. 2014-03-29 13:03:45 +01:00
3eabe064ab Fix T38900: cycles OSL crash running getmessage("trace", "geom:name", name) 2014-03-01 14:58:05 +01:00
502f9312d8 Attempt to fix OSL build error on Linux with latest OSL master. 2014-02-04 22:50:11 +01:00
9cd2b19999 Cycles Volume Render: generated texture coordinates for volume render.
This does not support staying fixed while the surface deforms, but for static
meshes it should match up with the surface texture coordinates. Implemented
as a matrix transform from objects space to mesh texture space.

Making this work for deforming surfaces would be quite complicated, you might
need something like harmonic coordinates as used in the mesh deform modifier,
probably will not be possible anytime soon.
2013-12-31 17:38:26 +01:00
89cfeefab5 Cycles: experimental OSL ptex reading code.
This code can't actually be enabled for building and is incomplete, but it's
here because we know we want to support this at some point and there's not much
reason to have it in a separate branch if a simple #ifdef can disable it.
2013-11-28 02:11:42 +01:00
Brecht Van Lommel
60e5abe71f Fix a few issues reported by coverity scan. 2013-09-03 22:39:21 +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
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
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
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
Brecht Van Lommel
c53b20b683 Cycles: window texture coordinates now work with orthographic cameras, this
was an old issue since the first version.
2013-06-08 10:51:33 +00:00
Thomas Dinges
d12a5d8d63 Cycles:
* Fix OSL compilation for scene_intersect(), when __Hair__ was disabled.
2013-05-18 22:40:21 +00:00
Brecht Van Lommel
561cf26c2f Fix #35306: cycles normal mapping not working with flat shading. 2013-05-11 09:31:58 +00:00
Brecht Van Lommel
168bcfb46b Cycles OpenCL: fix other build issues when enabling more features. 2013-05-09 15:28:38 +00:00
Brecht Van Lommel
dee74c299f Attempt to fix #35041 and #34725: cycles crash with OSL and both a 3D viewport
and preview running at the same time.

It seems there's something in OSL/LLVM that's not thread safe, but I couldn't
figure out what exactly. Now all renders share the same OSL ShadingSystem which
should avoid the problem.
2013-04-22 14:27:12 +00:00
Antony Riakiotakis
e93f00d73d Compile fixes for recent commits 2013-04-16 00:56:24 +00:00
Thomas Dinges
d319d68c65 OSL 1.3x / Windows 64:
* Added missing define into SConscript file. This also makes r54232 obsolete, so removing this again.
2013-01-31 17:38:09 +00:00
Brecht Van Lommel
122a2084b5 Attempt to fix cycles OSL link error on windows 64 bit. 2013-01-31 13:44:03 +00:00
Brecht Van Lommel
ad10cbf04a Cycles: multiple importance sampling for lamps, which helps reduce noise for
big lamps and sharp glossy reflections. This was already supported for mesh
lights and the background, so lamps should do it too.

This is not for free and it's a bit slower than I hoped even though there is
no extra BVH ray intersection. I'll try to optimize it more later.

* Area lights look a bit different now, they had the wrong shape before.
* Also fixes a sampling issue in the non-progressive integrator.
* Only enabled for the CPU, will test on the GPU later.
* An option to disable this will be added for situations where it does not help.

Same time comparison before/after:
http://www.pasteall.org/pic/show.php?id=43313
http://www.pasteall.org/pic/show.php?id=43314
2013-01-09 21:09:20 +00:00
Brecht Van Lommel
bf25f1ea96 Cycles Hair: refactoring to store curves with the index of the first key and the
number of keys in the curve, rather than curve segments with the indices of two
keys. ShaderData.segment now stores the segment number in the curve.
2013-01-03 12:09:09 +00:00
Brecht Van Lommel
57cf48e7c6 Cycles Hair: refactoring to support generic attributes for hair curves. There
should be no functional changes yet. UV, tangent and intercept are now stored
as attributes, with the intention to add more like multiple uv's, vertex
colors, generated coordinates and motion vectors later.

Things got a bit messy due to having both triangle and curve data in the same
mesh data structure, which also gives us two sets of attributes. This will get
cleaned up when we split the mesh class.
2013-01-03 12:08:54 +00:00
Thomas Dinges
6b05c887d3 Cycles Hair:
* Implemented the Hair Info Node for OSL.
2012-12-29 01:57:32 +00:00
Brecht Van Lommel
80d22a3f12 Cycles OSL: handle new getattribute constant folding with renderstate NULL check,
and fix #33654, distance to line segment function is not implemented but compiled
anyway, now it should give a compile error.
2012-12-22 15:15:11 +00:00