Implements Y billboard
Y billboard wasn't hooked up. This commit implements it.
This commit is contained in:
parent
2dd83e28b9
commit
c3b9ef8229
1 changed files with 16 additions and 1 deletions
|
@ -6778,7 +6778,7 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e->instance->billboard || e->instance->depth_scale) {
|
if (e->instance->billboard || e->instance->billboard_y || e->instance->depth_scale) {
|
||||||
|
|
||||||
Transform xf=e->instance->transform;
|
Transform xf=e->instance->transform;
|
||||||
if (e->instance->depth_scale) {
|
if (e->instance->depth_scale) {
|
||||||
|
@ -6809,6 +6809,21 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
|
||||||
|
|
||||||
xf.basis.scale(scale);
|
xf.basis.scale(scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e->instance->billboard_y) {
|
||||||
|
|
||||||
|
Vector3 scale = xf.basis.get_scale();
|
||||||
|
Vector3 look_at = p_view_transform.get_origin();
|
||||||
|
look_at.y = 0.0;
|
||||||
|
Vector3 look_at_norm = look_at.normalized();
|
||||||
|
|
||||||
|
if (current_rt && current_rt_vflip) {
|
||||||
|
xf.set_look_at(xf.origin,xf.origin + look_at_norm, Vector3(0.0, -1.0, 0.0));
|
||||||
|
} else {
|
||||||
|
xf.set_look_at(xf.origin,xf.origin + look_at_norm, Vector3(0.0, 1.0, 0.0));
|
||||||
|
}
|
||||||
|
xf.basis.scale(scale);
|
||||||
|
}
|
||||||
material_shader.set_uniform(MaterialShaderGLES2::WORLD_TRANSFORM, xf);
|
material_shader.set_uniform(MaterialShaderGLES2::WORLD_TRANSFORM, xf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue