Game
2DLands
7 years ago

Rendering the world: Part 1


Today i wanna show you guys how i render the whole world with shaders.

Attempt №1

Imagine that you have a grid of blocks, you have their textures and other stuff like hardness, roughness and etc. Basically what you might do to render whole world is by adding a parent block, that will have a lot of parameters. But this way inefficient at least for GameMaker, even YYC won’t handle whole world that has a lot of objects.

Attempt №2

What will be your next try? How about arrays? Ye arrays can improve our performance, but how about ds_grids? They will work way faster with a lots of numbers since it has built-in functions like ds_grid_clear or ds_grid_set_region that can use something like memset in C++ version of their representation. But how will we ever render this whole grid? How about 2 for loops that will render it? Ye we can try that! But wait, the performance is still low, what did we do wrong? So apparently we rendered the whole world, instead of region that we can actually see! Aha! Just put view’s position and size and we ready to go! Still not satisfied with the performance? Well…

Attempt №3

Okay, how about shaders? They pretty powerful and can render whole world like 30 times faster that CPU can! We must use them! But… How we gonna pass the data that correspond our purposes? How about surfaces? We can create a surface, that can store all blocks in chunk, where pixel’s color will be represent Block ID(BID), we need to write all data from our grid about each block to that surface and render it somehow.



0 comments

Loading...

Next up

Just first post to say Hello World!

Shadow The Hedgehog X pixel art

Werehog transformation process. #sonicunleashed

Sometimes the suction cup get sticky. Small animation I made in Blender after doing my tutorial on picking up/dropping objects in animations. Crate model by jQueary (https://sketchfab.com/3d-models/game-ready-sci-fi-crate-d98deca6…).

Why walk when you can jump?

Regular exercise is key for healthy wings.

Try it out!

https://gamejolt.com/games/AeonNightmares/605184

Regional Bulbasaur. #Pokemon

Who's is this little cutey👸 here? Thanks🙏 for a gorgeous fanart @WheNa! Feel free to share your arts, screenshots, or videos with #playzelter or #zelter hashtags! #pixelart #animating #unity3d #animated #indiegames #unrealengine #animate #conceptart

Auto-chess meets Clash Royale in an intense strategic battle. Outsmart your opponent, hide your play and crush their armies! Empire Builder just got another major update, check it out! https://gamejolt.com/games/EmpireBuilder/558901

If you’ve played the Vault demo and enjoyed it, please consider ‘liking’ the game page here on Gamejolt and/or leave a comment!

Also please consider tossing Vault on your Wishlist, I really appreciate your support!

https://store.steampowered.com/app/1251800