Commit Graph

12 Commits

Author SHA1 Message Date
Brecht Van Lommel
06888b7beb Cycles OSL minor optimizations: recycle shading context, don't do memory
allocations for trace data, avoid some virtual function calls. Only helps
a few percentages.
2012-12-15 10:18:42 +00:00
Brecht Van Lommel
7c0a0bae79 Fix #33375: OSL geom:trianglevertices gave wrong coordinates for static BVH.
Also some simple OSL optimization, passing thread data pointer directly instead
of via thread local storage, and creating ustrings for attribute lookup.
2012-12-01 19:15:05 +00:00
Brecht Van Lommel
fd619cd7f1 Fix #33177: OSL render difference with missing textures and HSV nodes. 2012-11-20 17:40:21 +00:00
Brecht Van Lommel
16f1c86953 Fix OSL build error on linux. 2012-11-14 22:45:44 +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
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
Campbell Barton
a425790065 style cleanup 2012-09-14 23:11:47 +00:00
Lukas Toenne
95b85a8c37 Revert "Use one context per OSL thread. Not sure if this actually works, but the simple renderer example in OSL does it this way."
This does not actually work: The context must not be shared between threads, but using the same context between different samples actually seems to prevent OSL from switching between shaders. The proper solution would be to ensure memory pooling works correctly.

This reverts commit 69f87e69258d6266dcb20f09f7e3d4021e663432.
2012-09-04 17:28:36 +00:00
Lukas Toenne
6805db676d Use one context per OSL thread. Not sure if this actually works, but the simple renderer example in OSL does it this way. 2012-09-04 08:53:47 +00:00
Lukas Toenne
f8c29c999f Fix for Cycles OSL: The RenderServices pointer in ShadingSystem is no longer accessible from the interface class (presumably because it is just the base class pointer anyway and would have to be casted). The OSLRenderServices pointer to our own implementation is now stored alongside the ShadingSystem in the kernel globals, so it can be accessed in thread_init. 2012-09-03 18:51:02 +00:00
Thomas Dinges
fda711a851 Cycles / OSLGlobals:
* Fixes for changes in the Open Shading Langauge API from version 0.6.0: 11ce51418b

* Removed the need for ShadingSystemImpl.
2012-08-31 20:31:21 +00:00
Ton Roosendaal
da376e0237 Cycles render engine, initial commit. This is the engine itself, blender modifications and build instructions will follow later.
Cycles uses code from some great open source projects, many thanks them:

* BVH building and traversal code from NVidia's "Understanding the Efficiency of Ray Traversal on GPUs":
http://code.google.com/p/understanding-the-efficiency-of-ray-traversal-on-gpus/
* Open Shading Language for a large part of the shading system:
http://code.google.com/p/openshadinglanguage/
* Blender for procedural textures and a few other nodes.
* Approximate Catmull Clark subdivision from NVidia Mesh tools:
http://code.google.com/p/nvidia-mesh-tools/
* Sobol direction vectors from:
http://web.maths.unsw.edu.au/~fkuo/sobol/
* Film response functions from:
http://www.cs.columbia.edu/CAVE/software/softlib/dorf.php
2011-04-27 11:58:34 +00:00