Skip to content
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

ebiten: impossible to get a specified size at DrawRectShader when no source image is specified #2166

Closed
hajimehoshi opened this issue Jun 27, 2022 · 7 comments
Labels
Milestone

Comments

@hajimehoshi
Copy link
Owner

If you don't use any source images, the value of texCoord doesn't make sense and then you cannot get the width and the height in DrawRectShader.

Reported by @sedyh

@hajimehoshi hajimehoshi added this to the v2.4.0 milestone Jun 27, 2022
@hajimehoshi
Copy link
Owner Author

hajimehoshi commented Aug 16, 2022

I forgot the details. Didn't imageDstRegionOnTexture() work? @sedyh @Zyko0

EDIT: I'm rereading our discussion https://discord.com/channels/842049801528016967/842056438632939570/990716664297422869

hajimehoshi added a commit that referenced this issue Aug 16, 2022
imageSrcRegionOnTexture should work even without any images.

Updates #2166
@hajimehoshi
Copy link
Owner Author

hajimehoshi commented Aug 16, 2022

I fixed DrawRectShader. On the contrary, there is no meaningful source regions in DrawTrianglesShader without source images. So I consider the case closed.

hajimehoshi added a commit that referenced this issue Aug 16, 2022
This reverts these commits:
- 9bd46cb.
- f8c4634.

This causes test failures on the Steam bot. See #2246.

Updates #2166
Closes #2246
@hajimehoshi hajimehoshi reopened this Aug 16, 2022
@hajimehoshi
Copy link
Owner Author

The fix failed on the Steam bot.

@hajimehoshi
Copy link
Owner Author

Though it is possible to fix texCoord and imageSrcRegionOnTexture to return pixels, these are semantically incorrect. I need more consideration for this fix.

@hajimehoshi hajimehoshi modified the milestones: v2.4.0, v2.5.0 Aug 17, 2022
@hajimehoshi
Copy link
Owner Author

#1431 is a blocker

@hajimehoshi hajimehoshi modified the milestones: v2.5.0, v2.6.0 Oct 26, 2022
@hajimehoshi
Copy link
Owner Author

If we allow various source image sizes (#1870), any values would not make sense...

@hajimehoshi
Copy link
Owner Author

DrawRectShader is a little odd API

  • The arguments width and height means the source image size
  • And, at the same time, the width and height means the destination's region size before the geometry matrix is applied.

This is because DrawRectShader is a shader version of DrawImage.

hajimehoshi added a commit that referenced this issue Jul 31, 2023
texCoord can be used as source position only when the unit is pixels.

Closes #2166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant