mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
apply user alpha even for other alpha modes
This commit is contained in:
parent
fb53a328b4
commit
008a9e9197
@ -194,6 +194,7 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
|
|||||||
alpha_scalar = cur_particle->get_parameterized_age();
|
alpha_scalar = cur_particle->get_parameterized_age();
|
||||||
if (_alpha_mode == PR_ALPHA_OUT)
|
if (_alpha_mode == PR_ALPHA_OUT)
|
||||||
alpha_scalar = 1.0f - alpha_scalar;
|
alpha_scalar = 1.0f - alpha_scalar;
|
||||||
|
alpha_scalar *= get_user_alpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_node->set_attrib(ColorAttrib::make_flat
|
cur_node->set_attrib(ColorAttrib::make_flat
|
||||||
|
@ -193,7 +193,7 @@ create_color(const BaseParticle *p) {
|
|||||||
|
|
||||||
if(_alpha_mode != PR_ALPHA_NONE) {
|
if(_alpha_mode != PR_ALPHA_NONE) {
|
||||||
if(_alpha_mode == PR_ALPHA_USER) {
|
if(_alpha_mode == PR_ALPHA_USER) {
|
||||||
parameterized_age = get_user_alpha();
|
parameterized_age = 1.0;
|
||||||
} else {
|
} else {
|
||||||
if(!have_alpha_t)
|
if(!have_alpha_t)
|
||||||
parameterized_age = p->get_parameterized_age();
|
parameterized_age = p->get_parameterized_age();
|
||||||
@ -202,7 +202,7 @@ create_color(const BaseParticle *p) {
|
|||||||
parameterized_age = 1.0f - parameterized_age;
|
parameterized_age = 1.0f - parameterized_age;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
color[3] = parameterized_age;
|
color[3] = parameterized_age * get_user_alpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
|
@ -219,9 +219,10 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
|
|||||||
alpha = get_user_alpha();
|
alpha = get_user_alpha();
|
||||||
} else {
|
} else {
|
||||||
alpha = cur_particle->get_parameterized_age();
|
alpha = cur_particle->get_parameterized_age();
|
||||||
|
|
||||||
if (_alpha_mode == PR_ALPHA_OUT)
|
if (_alpha_mode == PR_ALPHA_OUT)
|
||||||
alpha = 1.0f - alpha;
|
alpha = 1.0f - alpha;
|
||||||
|
|
||||||
|
alpha *= get_user_alpha();
|
||||||
}
|
}
|
||||||
|
|
||||||
center_color[3] = alpha;
|
center_color[3] = alpha;
|
||||||
|
@ -326,9 +326,9 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
|
|||||||
float t = cur_particle->get_parameterized_age();
|
float t = cur_particle->get_parameterized_age();
|
||||||
|
|
||||||
if (alphamode == PR_ALPHA_OUT)
|
if (alphamode == PR_ALPHA_OUT)
|
||||||
c[3] = 1.0f - t;
|
c[3] = (1.0f - t) * get_user_alpha();
|
||||||
else if (alphamode == PR_ALPHA_IN)
|
else if (alphamode == PR_ALPHA_IN)
|
||||||
c[3] = t;
|
c[3] = t * get_user_alpha();
|
||||||
else {
|
else {
|
||||||
assert(alphamode == PR_ALPHA_USER);
|
assert(alphamode == PR_ALPHA_USER);
|
||||||
c[3] = get_user_alpha();
|
c[3] = get_user_alpha();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user