AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Ok now I got that out of my system, welcome to what I've been obessing and stressing over for the last week or so. Some of you might remember a little while back I asked for help with optimising my game, specifically about rendering the islands that had a pixellated style to them. The main suggestion was to use meshes with a repeating texture rather than canvases, which made sense to me but it would be hard to make these meshes in the right style.
While there were some suggestions about how to create this mesh, I eventually realised that there was only really one method that made sense - Bresenham's line algorithm, but like, harder. I won't get into the details on how this works, but just know that drawing pixels is way easier than placing points on the outside of those pixels.
So I present to you, the Pixel Polygon Creator 2000!
Probably horribly inefficient, but it was the best I could do, and will hopefully improve performance on my game (which I have been longing to work on for the last week or so). Feel free to use it yourself, lord knows I spent enough time working on it.
Bobblesoft - inefficiently making the wrong things since 2022.
Pixel Polygon Creator 2000
Pixel Polygon Creator 2000
Dragon
Re: Pixel Polygon Creator 2000
I use this every day! It's great!
- Gadget Gabe (2023)
- Gadget Gabe (2023)
Re: Pixel Polygon Creator 2000
Why not use both together? You can draw multiple meshes to a scaled up canvas.
I would do something like this. For more vertices and more complex polygons, you could easily calculate a vertexMap to get them in the right order
Re: Pixel Polygon Creator 2000
The main reason I avoided using canvases was so that I could have multiple grids at different angles and scales. I'm just happy I got something that works™
Dragon
Re: Pixel Polygon Creator 2000
Sorry, not sure why I said that yesterday, I was already using canvases before to do exactly that. The actual main reason I was avoiding canvases was because people said they were getting poor performance, which I think was because some of the canvases had to be massive, hence why I'm trying this approach.
Dragon
Re: Pixel Polygon Creator 2000
You don't need to use massive canvases. They only have to have the size of the screen. You can do the scrolling by streaming new vertex coordinates to your meshes.
Who is online
Users browsing this forum: No registered users and 5 guests