mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
fix for bug#10196
Compute half if LOCAL_VIEWER is enabled and the light is a directional source.
This commit is contained in:
parent
69e57cf6ae
commit
61ec23cc63
2 changed files with 16 additions and 2 deletions
|
|
@ -988,7 +988,14 @@ static void build_lighting( struct tnl_program *p )
|
|||
*/
|
||||
VPpli = register_param3(p, STATE_LIGHT, i,
|
||||
STATE_POSITION_NORMALIZED);
|
||||
half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
|
||||
if (p->state->light_local_viewer) {
|
||||
struct ureg eye_hat = get_eye_position_normalized(p);
|
||||
half = get_temp(p);
|
||||
emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat);
|
||||
emit_normalize_vec3(p, half, half);
|
||||
} else {
|
||||
half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
|
||||
}
|
||||
}
|
||||
else {
|
||||
struct ureg Ppli = register_param3(p, STATE_LIGHT, i,
|
||||
|
|
|
|||
|
|
@ -939,7 +939,14 @@ static void build_lighting( struct tnl_program *p )
|
|||
*/
|
||||
VPpli = register_param3(p, STATE_LIGHT, i,
|
||||
STATE_POSITION_NORMALIZED);
|
||||
half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
|
||||
if (p->state->light_local_viewer) {
|
||||
struct ureg eye_hat = get_eye_position_normalized(p);
|
||||
half = get_temp(p);
|
||||
emit_op2(p, OPCODE_SUB, half, 0, VPpli, eye_hat);
|
||||
emit_normalize_vec3(p, half, half);
|
||||
} else {
|
||||
half = register_param3(p, STATE_LIGHT, i, STATE_HALF);
|
||||
}
|
||||
}
|
||||
else {
|
||||
struct ureg Ppli = register_param3(p, STATE_LIGHT, i,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue