Open Timmy-the-nobody opened 10 months ago
weirdly there's no bug in the code 🤔 the X is being set as the X and the Y in the Y properly
all the behavior you are seeing is caused by unreal the ratio stretching is a expected behavior when using "SizeIsScreenSpace" as it will get relative to the resolution.
weirdly there's no bug in the code 🤔 the X is being set as the X and the Y in the Y properly
Well then it's a weird choice to put X for height and Y for width
all the behavior you are seeing is caused by unreal the ratio stretching is a expected behavior when using "SizeIsScreenSpace" as it will get relative to the resolution.
Allright, will keep doing (billboard height * (viewport width / viewport height))
when dealing with responsive sizes then 🤷♂️
Prerequisites
Your Environment
Description
There's 2 problems with the
Billboard
class, both coming from the class constructor1:
size
issue:When dealing with
X
andY
inVector2D
to express a size you'd expectX
to be the width andY
the height, but in thesize
parameter they're inverted2:
size_in_screen_space
issue:This parameter makes the width/height of the billboard relative to the width/height of the viewport It is not ideal since results will differ depending of your viewport ratio (16:9, 4:3, etc..) To prevent this the size should only be relative to the viewport height
Steps to reproduce the behavior
1st issue:
Billboard(Vector(), "nanos-world::M_Default_Masked_Unlit", Vector2D(10, 10), false)
Billboard(Vector(), "nanos-world::M_Default_Masked_Unlit", Vector2D(10, 5), false)
2nd issue:
Let's make a billboard that have 10% of the screen size
Billboard(Vector(), "nanos-world::M_Default_Masked_Unlit", Vector2D(0.1, 0.1), true)
With a 16:9 ratio (1920x1080), it'll look like this
While in 4:3 ratio (1024x768) it'll look squarer
Expected behavior
1st issue:
X/Y of the
size
parameter should be width/height (instead of height/width)2nd issue:
The billboard w/h with
size_in_screen_space
should only be relative to the viewport's heightActual behavior
1st issue:
The width/height parameters are inverted
2nd issue:
The billboard w/h with
size_in_screen_space
is relative to the viewport width/height