Billboards were being displayed upside down when drawn to a render texture
Render texture's view transforms seem to be inverted, so when drawing billboards, the 'up' vector given to set_look_at() is also inverted and so the billboard gets drawn upside down.
This commit is contained in:
parent
48f1d02da4
commit
d807a22981
1 changed files with 7 additions and 1 deletions
|
@ -6683,7 +6683,13 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans
|
|||
if (e->instance->billboard) {
|
||||
|
||||
Vector3 scale = xf.basis.get_scale();
|
||||
|
||||
if (current_rt && current_rt_vflip) {
|
||||
xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), -p_view_transform.get_basis().get_axis(1));
|
||||
} else {
|
||||
xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), p_view_transform.get_basis().get_axis(1));
|
||||
}
|
||||
|
||||
xf.basis.scale(scale);
|
||||
}
|
||||
material_shader.set_uniform(MaterialShaderGLES2::WORLD_TRANSFORM, xf);
|
||||
|
|
Loading…
Reference in a new issue