-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Refactor MeshTexture #102028
base: master
Are you sure you want to change the base?
Refactor MeshTexture #102028
Conversation
2a53350
to
94c0c6a
Compare
The description is to match Nothing in |
I have tested a bit and found some issues.
( having created selection systems in my game i think this is probably because areas do not generate properly with negative numbers, but i could be wrong ) -The orange selection rectangle scales appropriately with changes to "image size" but not with the "scale" parameter. |
I just realize that the type is Vector2 although get_width and get_height are int. I'll change the type back then. |
The image size matches the true size of the texture and the orange selection. Negative size are not allowed. I will make changes to avoid negative numbers. |
scene/resources/mesh_texture.cpp
Outdated
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "image_size", PROPERTY_HINT_RANGE, "0,16384,1,suffix:px"), "set_image_size", "get_image_size"); | ||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "image_size", PROPERTY_HINT_RANGE, "1,16384,1,suffix:px"), "set_image_size", "get_image_size"); |
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.
The range hint seems do not work in editor. I consider replacing it with width
and height
, the same with gradient texture and noise texture.
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.
Ignore the editor issue for now. Keep the image_size
for compatibility.
94c0c6a
to
d26590f
Compare
In addition to the scale property, I think offset is also worth adding, but the drawing area cannot be cropped and may exceed the texture size. I wonder if it is allowed for texture2d to draw beyond its size. |
Fixes properties changing issue. Makes the mesh draw in the center of this texture. Adds `scale` and `offset` property
d26590f
to
2b605ec
Compare
It cannot be used in 3D, nor can it use get data. Perhaps we can use ViewportTexure internally to render to real texture, which also supports region drawing, but may reduce performance. |
4164197
to
4a17c75
Compare
4a17c75
to
aeb49d0
Compare
Issues with the latest version :
PS. sorry for being so nitpicky but meshtexture barely gets any love so i think its worth making sure we get it right this time |
In addition, when using GradientTexture2D as |
Fixes #101965, fixes #87159, fixes #81213
Makes the mesh draw in the center, and exposes the scale property. In the editor, I limit the scale to -1 to 1 to prevent drawing beyond its own size,
but don't limit it in script.