example: unrot wiffle_attenuation

This commit is contained in:
Zack Buhman 2024-10-17 22:46:11 -05:00
parent 12bf231293
commit e1e63795c9
3 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ uint32_t transform(uint32_t * ta_parameter_buf)
quad_vertices[2].z, quad_vertices[2].z,
quad_vertices[3].x, quad_vertices[3].x,
quad_vertices[3].y); quad_vertices[3].y);
// curiously, there is no quad_veritices[3].z in vertex_sprite_type_0 // curiously, there is no quad_vertices[3].z in vertex_sprite_type_0
parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);

View File

@ -101,7 +101,7 @@ uint32_t transform(uint32_t * ta_parameter_buf,
b.x, b.y, b.z, b.x, b.y, b.z,
c.x, c.y, c.z, c.x, c.y, c.z,
d.x, d.y); d.x, d.y);
// curiously, there is no quad_veritices[3].z in vertex_sprite_type_0 // curiously, there is no quad_vertices[3].z in vertex_sprite_type_0
parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);

View File

@ -91,7 +91,7 @@ void transform(ta_parameter_writer& parameter,
auto l = lights[0] - point; auto l = lights[0] - point;
auto n_dot_l = dot(n, l); auto n_dot_l = dot(n, l);
if (n_dot_l > 0) { if (n_dot_l > 0) {
float distance = length(lights[0] - point); float distance = magnitude(lights[0] - point);
float attenuation = 1.0 / (1.0f float attenuation = 1.0 / (1.0f
+ 0.07f * distance + 0.07f * distance
+ 0.007f * (distance * distance)); + 0.007f * (distance * distance));
@ -103,7 +103,7 @@ void transform(ta_parameter_writer& parameter,
auto l = lights[1] - point; auto l = lights[1] - point;
auto n_dot_l = dot(n, l); auto n_dot_l = dot(n, l);
if (n_dot_l > 0) { if (n_dot_l > 0) {
float distance = length(lights[1] - point); float distance = magnitude(lights[1] - point);
float attenuation = 1.0 / (1.0f float attenuation = 1.0 / (1.0f
+ 0.07f * distance + 0.07f * distance
+ 0.007f * (distance * distance)); + 0.007f * (distance * distance));
@ -115,7 +115,7 @@ void transform(ta_parameter_writer& parameter,
auto l = lights[2] - point; auto l = lights[2] - point;
auto n_dot_l = dot(n, l); auto n_dot_l = dot(n, l);
if (n_dot_l > 0) { if (n_dot_l > 0) {
float distance = length(lights[2] - point); float distance = magnitude(lights[2] - point);
float attenuation = 1.0 / (1.0f float attenuation = 1.0 / (1.0f
+ 0.07f * distance + 0.07f * distance
+ 0.007f * (distance * distance)); + 0.007f * (distance * distance));