Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_bake.h
| Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | ccl_device_inline float bake_clamp_mirror_repeat(float u) | ||||
| * to the same value, gives ugly patterns */ | * to the same value, gives ugly patterns */ | ||||
| float fu = floorf(u); | float fu = floorf(u); | ||||
| u = u - fu; | u = u - fu; | ||||
| return (((int)fu) & 1)? 1.0f - u: u; | return (((int)fu) & 1)? 1.0f - u: u; | ||||
| } | } | ||||
| ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, ccl_global float4 *output, | ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input, ccl_global float4 *output, | ||||
| ShaderEvalType type, int i, int offset, int sample) | ShaderEvalType type, Transform *tfm, int i, int offset, int sample) | ||||
| { | { | ||||
| ShaderData sd; | ShaderData sd; | ||||
| uint4 in = input[i * 2]; | uint4 in = input[i * 2]; | ||||
| uint4 diff = input[i * 2 + 1]; | uint4 diff = input[i * 2 + 1]; | ||||
| float3 out; | float3 out; | ||||
| int object = in.x; | int object = in.x; | ||||
| Show All 32 Lines | |||||
| #endif | #endif | ||||
| /* triangle */ | /* triangle */ | ||||
| int shader; | int shader; | ||||
| float3 P, Ng; | float3 P, Ng; | ||||
| triangle_point_normal(kg, object, prim, u, v, &P, &Ng, &shader); | triangle_point_normal(kg, object, prim, u, v, &P, &Ng, &shader); | ||||
| /* transformation matrix for dupli objects */ | |||||
| if (tfm) { | |||||
| P = transform_point(tfm, P); | |||||
| Ng = normalize(transform_direction(tfm, Ng)); | |||||
| } | |||||
| /* dummy initilizations copied from SHADER_EVAL_DISPLACE */ | /* dummy initilizations copied from SHADER_EVAL_DISPLACE */ | ||||
| float3 I = Ng; | float3 I = Ng; | ||||
| float t = 0.0f; | float t = 0.0f; | ||||
| float time = TIME_INVALID; | float time = TIME_INVALID; | ||||
| int bounce = 0; | int bounce = 0; | ||||
| int transparent_bounce = 0; | int transparent_bounce = 0; | ||||
| /* light passes */ | /* light passes */ | ||||
| ▲ Show 20 Lines • Show All 242 Lines • Show Last 20 Lines | |||||