Skip to main content
Game Development

Timeline for Why does a sprite with a larger texture render faster?

Current License: CC BY-SA 4.0

11 events
when toggle format what by license comment
Aug 13 at 17:35 comment added Kevin Note that the file size of a texture only affects how long it takes to load the texture, not how long it takes to render the texture. Also, I don't know about Pygame, but in most engines an image file will be converted into a texture format usable by the GPU, which often will have a very different file size than the original image.
Aug 4 at 16:18 comment added DMGregory Seconding Pikalek's recommendation to include your code as an edit to the question and post your solution as an answer. Not only does this make it easier for other game creators struggling with similar issues to find the solution you shared, it also lets them give you reputation by up-voting your answer. 😁 You may also find this past Q&A about the convert() function useful for reference.
Aug 4 at 13:46 comment added Pikalek Please use Post your answer (should be on the screen below the question) to share your solution rather than answering in the comments. Similarly, edits to your question can be made by clicking Edit link under your question. Comments aren't a good place for answers or edits because their not covered by the site's search / discoverability tools and also more subject to removal.
Aug 4 at 12:28 comment added Just Nick I'll answer my own question, as I accidentally found a solution. I should have used convert() when loading. This solved the problem, thank you all.
Aug 4 at 12:26 comment added Just Nick def draw(self): if -1 < self.field_x < 16: if -1 < self.field_y < 10: self.window.blit(self.image, self.rect) pg.draw.rect(self.window, self.board_color, self.rect_board, 2)
Aug 4 at 0:08 comment added Applekini Please submit the relevant code snippet where you are drawing the textures.
Aug 3 at 15:27 comment added Pikalek Possibly related: when I looked at the image info using IrfanView the larger one had its DPI set to 72 x 72 whereas the smaller one didn't have a DPI set. I don't know if that would impact pygame or not, but if it had to rescale it, I would expect that to hurt performance. You could try manually setting the DPI to see if that changes anything.
Aug 3 at 15:22 comment added Pikalek In both cases are you comparing loading & placing a single sprite? If you're tiling to cover the screen for instance, it seems like it would take more draw calls when using the smaller sprite.
Aug 3 at 11:20 history edited DMGregory CC BY-SA 4.0
Wording and alt text fixes
S Aug 3 at 9:55 review First questions
Aug 5 at 10:13
S Aug 3 at 9:55 history asked Just Nick CC BY-SA 4.0

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /