![]() ![]() So, I just read until I felt that I had enough knowledge to make a grid, which turned out to be when I got through the Checkerboard tutorial on the site. I was out on vacation and couldn’t code along with the tutorials. It presented the information in an incremental fashion and provided code so I could stop and analyze it. With a little bit of searching, I found a rather useful blog tutorial series ( ). It was quite in depth, but I felt like I would do better with something written. Now, months ago, I had watched Freya Holmér’s YouTube series on shader basics ( ). I decided that I just needed to learn how to make my own shader. I was almost to the point where I was going to just forget about drawing the grid altogether and live with it, but the problem stuck in the back of my mind. I found a short, seemingly helpful YouTube tutorial on making a grid shader, but that wasn’t good enough for my use case either. Long story made short, I found two other such shaders that had one shortcoming or another for my use-case. So, I set off in search of another shader. It could change the grid size, but it was done using a scale value that didn’t correspond to the world position. But it didn’t have the configuration options I needed. Well, the shader did draw a grid…sort of. That person even helpfully offered a link to a shader that drew a grid. ![]() Now, I had never written a shader, but I knew enough about what shaders are capable of to know that sounded like the right solution. I saw someone suggest that it was easy with shaders. Some people recommended tiling a sprite, but my grid might be relatively granular so that didn’t feel right. There were plenty of forum and posts asking the same thing. I found that I’m not the only person online to search for a solution to this problem. All I needed was a way to show a grid that had independently controllable horizontal and vertical step sizes, a configurable line width, and preferably a configurable line color. So, I did a quick Internet search for a solution. I’ve seen the feature in enough games to know that this must be a solved problem. Snapping the items to the grid size was the easy part. The level editor involves snapping drag ‘n dropped objects onto a grid. I was working on a simple level editor for a game I’m working on. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |