Comments (4)
ohhhhhh that makes so much sense! i've always wondered what people meant by drawing a map in one draw call, it always seemed impossible to me, thanks!
also, by why not just blow up the textures themselves in code, i meant instead of rendering everything to a render texture and making it fit the screen, just scaling up every individual tile texture to fit the screen
from ldtkloader.
Hi ! I am not sure I understood the "why not just blow up the textures themselves in code" question, but about the render texture, there are multiple advantages to drawing the map on an off screen render texture first before drawing it to the window :
It helps getting rid of visual artifacts (like vertical or horizontal white line) that can appear when scrollling the map.
It also allows to apply post process effects on the whole map.
And of course, prerendering the map on a render texture allows to draw it in a single draw call (instead of one per tile) and results most of the time in better performance (well, at least it when you have big maps)
from ldtkloader.
Well, if your tile map changes a lot (like in a terraria like game), you can probably batch draw only the visible tiles instead of using a render texture.
In the examples, I prerender to an offscreen texture because the map doesn't change, if we had animated or interractable tiles then drawing the visible tiles one by one can be a solution :)
(I'll let you close the issue if your question is answered)
from ldtkloader.
ah, i understand now! thank you :D
i think i can close this issue now, right? im not sure how github works 😅
from ldtkloader.
Related Issues (13)
- Loading external level files does not take world directory into account HOT 1
- Texture coordinates are hardcoded to 16x16 tiles HOT 1
- Compile times, in particular external includes HOT 5
- Compile error: "Cannot use 'throw' with exceptions disabled" HOT 7
- Can't parse LDtk 1.2.0 HOT 1
- Fail to load EntityFields that can be null HOT 1
- Undefined reference to... HOT 7
- SDL Example does not build HOT 2
- Update third party JSON. HOT 5
- How to parse intgrid and autotile layers? HOT 4
- Layer::getCoordIdAt calculation flawed HOT 1
- No Way to Get List of All Entities HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ldtkloader.