Commit Graph

229 Commits

Author SHA1 Message Date
Lukas Toenne
674d295df3 Fix for attribute lookup in OSL. This uses a map in the OSL globals instead of the device texture. 2012-09-05 17:08:56 +00:00
Lukas Toenne
f3a91f461c Fix for OSL memory leak. The context creation for OSL is now done in the shader_setup_* functions, since it should specific to the sample being worked on. The the context release then happens in the kernel_shader functions after shader evaluation is done. Care has to be taken to ensure the shader_release function is also called in cases where the path integration is cancelled early, this was the main cause for unreleased contexts and subsequent new allocations. 2012-09-05 08:12:22 +00:00
Thomas Dinges
65b214ed04 * Forgot to commit CMake change for the Brick texture. 2012-09-05 00:59:04 +00:00
Thomas Dinges
ebe29c3f84 OSL:
* Noise Texture is rendering now.
2012-09-04 23:34:08 +00:00
Thomas Dinges
0206d7d02b Cycles / OSL:
* Ported the Brick Texture to OSL. Renders fine :)
2012-09-04 22:33:11 +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
Thomas Dinges
0e3f3a0aef OSL:
* Holdout shader is now working in OSL.
2012-09-04 16:54:32 +00:00
Lukas Toenne
64a4a05d31 Fix for OSL input parameter name mapping. When assigning input constants to shader parameters, use the compatible_name function to strip whitespace. 2012-09-04 16:47:00 +00:00
Lukas Toenne
f51eb99faa Minor syntax error in musgrave osl texture. 2012-09-04 16:46:56 +00:00
Thomas Dinges
f2caaaec9b OSL:
* WIP commit of fixes for musgrave and wave.
2012-09-04 16:00:12 +00:00
Brecht Van Lommel
adea12cb01 Cycles: merge of changes from tomato branch.
Regular rendering now works tiled, and supports save buffers to save memory
during render and cache render results.

Brick texture node by Thomas.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Brick_Texture

Image texture Blended Box Mapping.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Image_Texture
http://mango.blender.org/production/blended_box/

Various bug fixes by Sergey and Campbell.
* Fix for reading freed memory in some node setups.
* Fix incorrect memory read when synchronizing mesh motion.
* Fix crash appearing when direct light usage is different on different layers.
* Fix for vector pass gives wrong result in some circumstances.
* Fix for wrong resolution used for rendering Render Layer node.
* Option to cancel rendering when doing initial synchronization.
* No more texture limit when using CPU render.
* Many fixes for new tiled rendering.
2012-09-04 13:29:07 +00:00
Thomas Dinges
bf8d695234 OSL:
* Gradient texture renders now.
2012-09-04 11:41:48 +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
71871463a4 Fix for bad memory leak in OSL: the context created for each OSL sample did not get released properly. 2012-09-04 08:53:44 +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
Brecht Van Lommel
a2515f3ca0 Fix #32089: non-progressive integrator issue with semi-transparent surfaces. 2012-09-03 17:41:49 +00:00
Thomas Dinges
bf395ff0b8 OSL / Cmake:
* Holdout shader was missing in cmake.
2012-09-03 14:08:03 +00:00
Brecht Van Lommel
bfa82b074d Fix #32097: cycles window texture coordinate wrong, happened after 2.63. 2012-09-03 14:07:49 +00:00
Lukas Toenne
ad551c1ec6 Enable compilation of the SVM backend for Cycles even when OSL is enabled. The switch between SVM/OSL is decided at runtime, so the SVM code cannot simply be ignored when OSL is enabled.
Currently all shader functions check the OSL/SVM flag to dispatch to the appropriate backend. If this turns out to be a significant overhead (unlikely) this test should be moved out of the inner loop.
2012-09-03 13:56:40 +00:00
Lukas Toenne
2f70800923 Fix for OSL shader install paths. 2012-09-03 11:38:22 +00:00
Lukas Toenne
c0a3657e7a Added library linking for cycles_kernel_osl to OSL libraries and added cycles_kernel_osl to the list of blender libs in creator. 2012-09-03 11:38:18 +00:00
Lukas Toenne
c9cd150f43 Cycles compile fix: only use std::isfinite when OSL is enabled. 2012-09-02 18:11:28 +00:00
Thomas Dinges
dfec5a3655 * Removed last occurrence of get_pointcloud_attr_query. 2012-09-02 17:39:07 +00:00
Thomas Dinges
add7ca12d9 * OSL can't overwrite input parameters, use a local variable instead. 2012-09-02 16:37:58 +00:00
Thomas Dinges
b26d19a7b8 Cycles / OSL:
* Updates for noise_turbulence, to match svm function.
2012-09-02 16:06:18 +00:00
Lukas Toenne
e1bca6cfc4 Fixed a number of OSL syntax errors from the updated 1.2 API. Microfacet functions now all take an eta parameter, set to 1.0 if no IOR is given. 2012-09-02 15:41:35 +00:00
Thomas Dinges
28d02bc056 Fix for r50314:
* oren_nayar is not part of the default stdosl, added it back.
2012-09-02 15:26:13 +00:00
Lukas Toenne
092f6344c3 Fixed remaining syntax errors in OSL files. node_sepcomb_rgb.osl is split into 2 parts, since OSL only allows one shader per file. 2012-09-02 15:07:51 +00:00
Thomas Dinges
f1d279912f Cycles / OSL:
* Add oslutil.h, from osl 1.2.
2012-09-02 13:34:12 +00:00
Thomas Dinges
6c02a8fc8c OSL / Cycles:
* Update the stdosl header file, from official osl 1.2.
2012-09-02 13:23:44 +00:00
Thomas Dinges
25fc454ce0 Cycles / OSL:
* Remove declaration of node_blend_weight_texture from cmake, does not exist, and match node_blend_weight name in nodes.cpp with the actual file.
2012-09-02 12:46:54 +00:00
Thomas Dinges
23dca13691 Cycles / OSL:
* First batch of compile fixes for several shaders, mainly syntax errors.
2012-09-02 12:24:04 +00:00
Thomas Dinges
748582f49e Cycles / OSL:
Fixes for API changes in OSL RendererServices:

* Added two new required get_matrix methods, from OSL RendererServices (otherwise the constructor fails). The two new matrix methods probably still need an implementation. 
* Removed deprecated "get_pointcloud_attr_query" and "pointcloud". There are two new routines for pointclouds, function headers for those are there.

* Removed the (unused) PARTIO code parts from OSL. It was marked as not tested / not working, and due to the api changes here broken for sure. Code is still in svn history if needed.
2012-09-02 01:10:31 +00:00
Thomas Dinges
779ecb06dd Cycles / OSL:
* Compile fix for the "direction_to_panorama" issue.
Added kernel_projection.h to kernel_triangle.h.
2012-09-01 15:30:35 +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
Thomas Dinges
7ac0dd2953 Cycles / OSL:
* OSL namespace fixes for osl_shader.cpp.
2012-08-31 20:08:55 +00:00
Thomas Dinges
01815d83fb Cycles / OSL:
* Fixes for changes in r40163. Removed unused code and fixed emissive_eval function.
2012-08-31 19:59:50 +00:00
Lukas Toenne
9e3fa15d4b Added a bunch of additional particle state attributes to the Cycles particle info node:
* Location: Basically the same as the location from Object Info node for object instances on particles, but in principle there could be additional offsets for dupli objects, so included for completeness.
* Size: Single float scale of the particle. Also directly translates to object scale for current dupli objects, but handy to have as a single float to start with instead of a scale vector (currently not even exposed in Object Info).
* Rotation: This is a quaternion, which are not yet supported by Cycles nodes. The float4 is copied to internal Cycles data and stored in the particles texture data, but the node doesn't have a socket for it yet and the data is not yet written to the stack. Code is just commented out so could be enabled quickly if/when rotation support is added to cycles.
* Velocity: Linear velocity vector of particles.
* Angular Velocity: Angular velocity around principle axes.

The texture data is currently packed tightly into the particles texture, which saves a few bytes, but requires an additional texture lookup for some vector attributes which spread over two float4s. Could also add another float4 to particle size to avoid this.
2012-08-31 19:38:59 +00:00
Dalai Felinto
ded5e9cd23 clamp for Mix node
the implementation was following my early commit for Math node
I haven't had a chance to run those through Brecht, but would like to do eventually. (they work fine though)
2012-08-30 06:31:02 +00:00
Dalai Felinto
c052ebda8e Cycles bugfix: [32431] Cycles Math Node : Clamp does not work
the OSL solution is slightly different than the svm, but I think it's fine.

thanks Lukas Toenne for helping with a fix on the original patch
2012-08-29 17:30:14 +00:00
Jens Verwiebe
9ee3a8655f Fix for fix, now nested 2012-08-07 12:09:48 +00:00
Jens Verwiebe
d4029de0d6 Fix for endiantest, xcode condition interferred with other os 2012-08-07 12:03:43 +00:00
Jens Verwiebe
5bcdecd72b OSX: disable kernels in cycles gpu again, would only work in 10.8 afaik 2012-08-07 10:10:03 +00:00
Jens Verwiebe
b9c441536c OSX/cmake: Mountain-Lion (10.8 )adaptions, skip unsupported endianess etc., todo: deployment target management 2012-08-07 10:02:34 +00:00
Sergey Sharybin
7ffa42075e Fix #32205: Holdout shader + transparent background stays black with Alpha = 1
It was read of initialized memory around holdout_weight in cases when
holdout material is used. Seems that it should be assigned to result
of shader_holdout_eval here.

If Brecht could double check this it'll be great.

This could potentially fix #32224: Holdout Error with CUDA Cycles Render
2012-08-01 12:59:47 +00:00
Campbell Barton
a199ae5368 style cleanup: whitespace, also add '?' to save over popup since it wasnt totally clear it was a question (user pointed this out, they thought it was just notification and lost their work). 2012-07-31 23:06:12 +00:00
Lukas Toenne
fec872ef9c Added a particle index output to the Particle Info Cycles node. This is required to get consistent ID numbers for particles. The Object ID is not usable since it's a user defined value of the instanced object, which does not vary per instance. Also the random value from the object info node is not consistent over time, since it only depends on the index in the dupli list (so each emitted or dying particle shifts the value).
The particle index is always the same for a specific particle. Randomized values can be generated from this with the use of a noise texture.
2012-07-26 11:40:58 +00:00
Campbell Barton
5412389af6 fix for cycles bug in localview: see r48269, bits used for localview gave collisions with PathRayFlag's 2012-07-23 14:48:19 +00:00
Campbell Barton
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
Campbell Barton
158a70c8a3 the mutex struct seems to be different across systems, use memset rather then an initializer value.
also quiet warning in cycles.
2012-06-25 11:19:38 +00:00