-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Fixed rotate_y property of particle shaders #46687
Conversation
doc/classes/TileMap.xml
Outdated
@@ -326,6 +326,9 @@ | |||
<member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" default="1"> | |||
The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). | |||
</member> | |||
<member name="show_collision" type="bool" setter="set_show_collision" getter="is_show_collision_enabled" default="true"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your commit was wrongly rebased into another unrelated commit it seems.
350238a
to
8133307
Compare
@akien-mga darn you were faster to notice my git spaghetti than i was to clean it up. Sorry! |
if (flags[FLAG_ROTATE_Y]) { | ||
code += " TRANSFORM = mat4(vec4(cos(CUSTOM.x), 0.0, -sin(CUSTOM.x), 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(sin(CUSTOM.x), 0.0, cos(CUSTOM.x), 0.0), vec4(0.0, 0.0, 0.0, 1.0));\n"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation issue. You may want to set up clang-format / pre-commit hooks to avoid this in future commits :)
https://docs.godotengine.org/en/latest/community/contributing/code_style_guidelines.html
That bugfix should also be made in the
|
8133307
to
ffbb81e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Would like to have a quick review from rendering folks if possible, but I think it's fine to include in 3.2.4 even if it changes the behavior (any bugfix does if one relied on the buggy behavior).
@akien-mga I'm not in favor of merging for 3.2.4, this is a good fix, but it would break a bunch of things (even some of the particles that I made for the tps demo) In order to obtain random y rotation before, one had to select rotate y and then set an angle of ~0.01 degrees. This would give you a nice, almost static, random rotation. But with this fix, all the particles will be aligned in the same direction, because a 0.01 angle is very small .. |
Codewise it looks fine, but the question seems whether the particles should behave in that way and I'm not at all familiar with particles so can't help on that currently (it's going to be a bit hectic till the RC is released). @clayjohn may be more familiar with particle behaviour? And as @QbieShay says maybe this fix will break something else, so maybe we need to fix several things at once. |
@lawnjelly the way that the parameter works right now is completely broken. The rotation is stored in CUSTOM.x, so the rotation of the matrix should be set directly from the CUSTOM.x value. What happens instead is that the TRANSFORM is multiplied by the rotation matrix, which means that if in your custom.x you have accumulated 90degress, at frame1 you will have 90deg, frame2 you will have 180, frame3 270, frame4 360, even if, by the value stored in CUSTOM.x, you should be only rotated by 90deg. The addition of velocity is all handled in the way that rotation is added to the CUSOTM.x component, which should just be plainly applied as-is to the transform. |
Ah I see that makes lots of sense. So it is the right fix but we might have to fix some other bits of the engine that relied on the buggy previous behaviour? Or was it just the demos (and people's projects)? If it is just demos they should be ok to break hehe 😈 ! |
But if we can't merge it in 3.2.4, we're unlikely to merge it in the But yeah we could also merge it for 3.2.5 beta 1, see if anyone complains about their particles having changed behavior, and then assess if we want to add compatibility code. |
What I meant is that we're already in RC stage, so I'd rather give people time to fix their particles with a beta, rather than dropiing the bomb like this :P again I don't think that many people use the property because it's very broken, but who knows :( |
@QbieShay I can confirm that I've avoided the property due to its behaviour. |
Thanks! |
Rotate_y flag had an issue which made it almost unusable (see #33357).
I'd like some testing on this one, I haven't found any issue with it, but it'd help if someone else can take a look.
This breaks compat because in order to achieve a random, stable, y rotation, one had to pick super small values in the angle property.
Closes #33357