Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Old style 2.5D engine

This topic is 1121 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all!
I hope I can find help I need for my ideas :-D
It's a long time that I'm making a lot of prototypes for 2.5D game engine with 2D backgrounds and 3D actors (such old resident evil, alone in the dark, final fantasy etc...)
I the past I could create a good framework using JMonkey, but it's a bit heavy in my opinion and I would to make a lighter and quicker versioni using pure OpenGL.
Now, I'm still new to pure OGL and I've many stuffs to learn yet. But I still have the ideas in my mind, and after a lot of test I discover that best way for obtaining this is reduced to 2 ways:

1. Render background + depth map of this.
2. Render background, approximated geometry (only depth), and stencil for make finest the occlusion.

Now, I tried with first, but is a bit difficult because of depth buffer non linearity and it s very difficult to render depth map from blender (from background scene) that can fill the Z buffer in a right way. So I thought for the second.

In this case the idea is to render a very simple geometry for occludes a "superset" of midground object, and then a stencil to follow the 2D object boundary (for example if I have a table in the room, the geometry can be a simple cube, and stencil follow the table details). In this way I have a precise rendering and simple geometry. My idea was this, is it possible?

1. Render a quad with background
2. Write only depth for geometry
3. Render 3D actors.
3.1. For each actor pixel, if depth test passes, so render the pixel, otherwise (3.2).
3.2. make the stencil and test stencil, if passes render the pixel, otherwise NOT render.

But as I understood by default if Z test failed there's no possible to render the pixel... is it possible to bypass this issue? And render pixel if at least on between Z test and stencil test passes?

Thanks a lot.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!