DEV Community

Cover image for 3D stylized rendering engine
No_Arms_studio
No_Arms_studio

Posted on

3D stylized rendering engine

< I have made a very, very simple rendering engine for the game engine scratch and keep in mind that It is extremely simple. I do like the end result of what has come out of it being a stylized 3D rendering engine in scratch, a 2d game engine.
The way that this works is that there is a base image and the sprite goes down by a variable called height then goes back up to where it was stamping itself as it goes up. This drawing function is called with a message making it so that the screen can be reset without artifacts such as certain parts not being drawn as they were erased.
The code for this looks like:

   Draw
          brightness = -20
          Y positions = Y - (height)
          repeat (height)
                 Y position = Y + (1)
                 stamp
          end
          brightness = 0
          stamp
Enter fullscreen mode Exit fullscreen mode

< And that's basically it, very simple yet very effective. There is no problem with this method though, when you layer sprites under and on top of another, you get weird artifacts when the spite is under the wall it should be in front of because its just a layered image. I fixed this by making sure that this artifact wouldn't happen by level design or making it so that it's all just the same image and at the same height is boring. you could make something where the sprite has individual costumes for certain heights.
Well this brings us to the end yet again, see y'all later and have a great rest of your day :)

Top comments (3)

Collapse
 
no_arms_studio profile image
No_Arms_studio

I did add the end suggestion but there is a weird artifact that I'm still working out the kinks for before I show people.

Collapse
 
no_arms_studio profile image
No_Arms_studio

Instantly after I said that I fixed the problem, it looks like this

Collapse
 
no_arms_studio profile image
No_Arms_studio