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
This commit is contained in:
Brecht Van Lommel
2012-11-03 14:32:13 +00:00
parent 6b098d7406
commit 615fe0295f
74 changed files with 124 additions and 151 deletions

View File

@@ -68,6 +68,17 @@ __device_inline float3 triangle_normal_MT(KernelGlobals *kg, int tri_index, int
#endif
}
/* Return 3 triangle vertex locations */
__device_inline void triangle_vertices(KernelGlobals *kg, int tri_index, float3 P[3])
{
/* load triangle vertices */
float3 tri_vindex = float4_to_float3(kernel_tex_fetch(__tri_vindex, tri_index));
P[0] = float4_to_float3(kernel_tex_fetch(__tri_verts, __float_as_int(tri_vindex.x)));
P[1] = float4_to_float3(kernel_tex_fetch(__tri_verts, __float_as_int(tri_vindex.y)));
P[2] = float4_to_float3(kernel_tex_fetch(__tri_verts, __float_as_int(tri_vindex.z)));
}
__device_inline float3 triangle_smooth_normal(KernelGlobals *kg, int tri_index, float u, float v)
{
/* load triangle vertices */