diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-10-28 23:01:01 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-10-28 23:01:01 +0400 |
commit | 70e9191e15825fb7af6d5ed2e71b239ce601922d (patch) | |
tree | 5afae51f6ccc98021233d90a8b3a7b2f25a2619a /intern | |
parent | d10abe6d4d6792bf0f9d6dbeed75acb9e46f210f (diff) |
Fix #37184: film exposure + transparency not working well in cycles viewport.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/kernel_film.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_film.h b/intern/cycles/kernel/kernel_film.h index 721eceabc37..370c550a515 100644 --- a/intern/cycles/kernel/kernel_film.h +++ b/intern/cycles/kernel/kernel_film.h @@ -72,9 +72,20 @@ __device void kernel_film_convert_to_half_float(KernelGlobals *kg, __global float4 *in = (__global float4*)(buffer + index*kernel_data.film.pass_stride); __global half *out = (__global half*)rgba + index*4; - float scale = kernel_data.film.exposure*sample_scale; - float4_store_half(out, in, scale); + float exposure = kernel_data.film.exposure; + + if(exposure == 1.0f) { + float4_store_half(out, in, sample_scale); + } + else { + float4 rgba = *in; + rgba.x *= exposure; + rgba.y *= exposure; + rgba.z *= exposure; + + float4_store_half(out, &rgba, sample_scale); + } } CCL_NAMESPACE_END |