diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-01-27 18:34:27 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-01-27 18:34:40 +0300 |
commit | 332cf291e4b8b104252f34383193aed2f4c814e0 (patch) | |
tree | a2d683b361648b4f22017ac57ddee8e6423e20b7 /source/blender/gpu | |
parent | 2d86f58e0f773207eb7a3ff8ccbd58b85263fbe3 (diff) |
Fix T43250, lamp node did not use energy when used with nodes in blender
internal.
Similar to fix for T42074 we need to multiply with energy -after-
texture application.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 5 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index a65a123c768..eef07fdb783 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -270,7 +270,7 @@ void GPU_lamp_update_colors(GPULamp *lamp, float r, float g, float b, float ener void GPU_lamp_update_distance(GPULamp *lamp, float distance, float att1, float att2); void GPU_lamp_update_spot(GPULamp *lamp, float spotsize, float spotblend); int GPU_lamp_shadow_layer(GPULamp *lamp); -GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow); +GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow, GPUNodeLink **energy); #ifdef __cplusplus } diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 20f8f5f099e..4638ad216e0 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -2096,13 +2096,14 @@ int GPU_lamp_shadow_layer(GPULamp *lamp) return -1; } -GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow) +GPUNodeLink *GPU_lamp_get_data(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **col, GPUNodeLink **lv, GPUNodeLink **dist, GPUNodeLink **shadow, GPUNodeLink **energy) { GPUNodeLink *visifac; *col = GPU_dynamic_uniform(lamp->dyncol, GPU_DYNAMIC_LAMP_DYNCOL, lamp->ob); + *energy = GPU_dynamic_uniform(&lamp->dynenergy, GPU_DYNAMIC_LAMP_DYNENERGY, lamp->ob); visifac = lamp_get_visibility(mat, lamp, lv, dist); - /* looks like it's not used? psy-fi */ + shade_light_textures(mat, lamp, col); if (GPU_lamp_has_shadow_buffer(lamp)) { diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index a79bb239801..a7bb4fe16f7 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -169,9 +169,9 @@ void camera(vec3 co, out vec3 outview, out float outdepth, out float outdist) outview = normalize(co); } -void lamp(vec4 col, vec3 lv, float dist, vec3 shadow, float visifac, out vec4 outcol, out vec3 outlv, out float outdist, out vec4 outshadow, out float outvisifac) +void lamp(vec4 col, float energy, vec3 lv, float dist, vec3 shadow, float visifac, out vec4 outcol, out vec3 outlv, out float outdist, out vec4 outshadow, out float outvisifac) { - outcol = col; + outcol = col * energy; outlv = lv; outdist = dist; outshadow = vec4(shadow, 1.0); |