Search found 2058 matches
- Tue Mar 03, 2020 5:08 am
- Forum: Support and Development
- Topic: [SOLVED] Lua math.cos issue
- Replies: 8
- Views: 17975
Re: [SOLVED] Lua math.cos issue
Lua uses C standard library (by design) and it usually provides fairly good scientific functions, horrendously slow though. LuaJIT uses hardware acceleration whenever available (by design) and hardware accelerated floating point math tends to not be very accurate, particularly the transcendental fun...
- Tue Mar 03, 2020 1:55 am
- Forum: Support and Development
- Topic: [SOLVED] Lua math.cos issue
- Replies: 8
- Views: 17975
Re: [SOLVED] Lua math.cos issue
Nevermind that math.cos function itself only returns approximate cosine values (and of not particularly great accuracy, FYI).
- Mon Mar 02, 2020 9:24 pm
- Forum: Support and Development
- Topic: [SOLVED] Lua math.cos issue
- Replies: 8
- Views: 17975
Re: [SOLVED] Lua math.cos issue
Welcome to the world of floating point numbers. It patently sucks but it's the best we have.
- Mon Mar 02, 2020 1:08 am
- Forum: General
- Topic: Can you give me advice?
- Replies: 3
- Views: 8906
Re: Can you give me advice?
A game doesn't need to have pretty source code, it just needs to work. Metatables are your go-to syntax sugar for calling methods on objects. Doing it the C way is faster but that's C way, so not ideal. What __index does is, basically, hooks up another table to your existing table as a backup. It's ...
- Fri Feb 28, 2020 7:09 pm
- Forum: Support and Development
- Topic: How do I efficiently update an image?
- Replies: 16
- Views: 23303
Re: How do I efficiently update an image?
I'm giving you PC architecture lesson because you fail to understand limitations of the hardware. There's no way to shovel large amounts of data over PCI bus without it being crazy-slow (compared to RAM-to-RAM anyway), particularly when GPU is involved because it's heavily bottlenecked by driver's t...
- Fri Feb 28, 2020 7:01 pm
- Forum: Support and Development
- Topic: How do I efficiently update an image?
- Replies: 16
- Views: 23303
Re: How do I efficiently update an image?
You don't. You need to push the contents to the GPU before they can be rendered. GPU is a physically separate extension board, remember? You push data to it, and you push commands to it, and it executes your commands on your data, and then you can fetch the results (by default it outputs results to ...
- Fri Feb 28, 2020 6:54 pm
- Forum: Support and Development
- Topic: How do I efficiently update an image?
- Replies: 16
- Views: 23303
Re: How do I efficiently update an image?
You changed the data that sits in RAM, of course this does nothing about the data that sits on the GPU. In case it's not clear, they're physically separate.
- Fri Feb 28, 2020 6:43 pm
- Forum: Support and Development
- Topic: How do I efficiently update an image?
- Replies: 16
- Views: 23303
Re: How do I efficiently update an image?
ImageData holds information in RAM. In order to render anything, it needs to be on the GPU. You see my point?
- Tue Feb 25, 2020 12:33 am
- Forum: Support and Development
- Topic: Any way to get canvases to be more efficient?
- Replies: 38
- Views: 36710
Re: Any way to get canvases to be more efficient?
480 draw calls eating 12% of the GPU power sounds about right, in by book that's pretty generous actually. Batching will reduce the amount of draw calls. If you were using version 11 or later there should be autobatching enabled; check the output of love.graphics.getStats.
- Mon Feb 24, 2020 11:24 pm
- Forum: Support and Development
- Topic: Any way to get canvases to be more efficient?
- Replies: 38
- Views: 36710
Re: Any way to get canvases to be more efficient?
You just shove your entire map into a spritebatch, in the order in which each tile would be rendered, accounting for layers and all. Particularly gigantic maps may need splitting into chunks but yours are very small. You can break up the batch if your effects necessitate a shader switch (or uniform ...