~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to intern/cycles/kernel/closure/bsdf_diffuse_ramp.h

  • Committer: Reinhard Tartler
  • Date: 2014-05-31 01:50:05 UTC
  • mfrom: (14.2.27 sid)
  • Revision ID: siretart@tauware.de-20140531015005-ml6druahuj82nsav
mergeĀ fromĀ debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
CCL_NAMESPACE_BEGIN
37
37
 
38
 
__device float3 bsdf_diffuse_ramp_get_color(const ShaderClosure *sc, const float3 colors[8], float pos)
 
38
ccl_device float3 bsdf_diffuse_ramp_get_color(const ShaderClosure *sc, const float3 colors[8], float pos)
39
39
{
40
40
        int MAXCOLORS = 8;
41
41
        
49
49
        return colors[ipos] * (1.0f - offset) + colors[ipos+1] * offset;
50
50
}
51
51
 
52
 
__device int bsdf_diffuse_ramp_setup(ShaderClosure *sc)
 
52
ccl_device int bsdf_diffuse_ramp_setup(ShaderClosure *sc)
53
53
{
54
54
        sc->type = CLOSURE_BSDF_DIFFUSE_RAMP_ID;
55
55
        return SD_BSDF | SD_BSDF_HAS_EVAL;
56
56
}
57
57
 
58
 
__device void bsdf_diffuse_ramp_blur(ShaderClosure *sc, float roughness)
 
58
ccl_device void bsdf_diffuse_ramp_blur(ShaderClosure *sc, float roughness)
59
59
{
60
60
}
61
61
 
62
 
__device float3 bsdf_diffuse_ramp_eval_reflect(const ShaderClosure *sc, const float3 colors[8], const float3 I, const float3 omega_in, float *pdf)
 
62
ccl_device float3 bsdf_diffuse_ramp_eval_reflect(const ShaderClosure *sc, const float3 colors[8], const float3 I, const float3 omega_in, float *pdf)
63
63
{
64
64
        float3 N = sc->N;
65
65
 
68
68
        return bsdf_diffuse_ramp_get_color(sc, colors, cos_pi) * M_1_PI_F;
69
69
}
70
70
 
71
 
__device float3 bsdf_diffuse_ramp_eval_transmit(const ShaderClosure *sc, const float3 colors[8], const float3 I, const float3 omega_in, float *pdf)
 
71
ccl_device float3 bsdf_diffuse_ramp_eval_transmit(const ShaderClosure *sc, const float3 colors[8], const float3 I, const float3 omega_in, float *pdf)
72
72
{
73
73
        return make_float3(0.0f, 0.0f, 0.0f);
74
74
}
75
75
 
76
 
__device int bsdf_diffuse_ramp_sample(const ShaderClosure *sc, const float3 colors[8], float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf)
 
76
ccl_device int bsdf_diffuse_ramp_sample(const ShaderClosure *sc, const float3 colors[8], float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf)
77
77
{
78
78
        float3 N = sc->N;
79
79