Git Product home page Git Product logo

Comments (4)

derpyzza avatar derpyzza commented on May 29, 2024 1

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.

Madour avatar Madour commented on May 29, 2024

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.

Madour avatar Madour commented on May 29, 2024

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.

derpyzza avatar derpyzza commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.