Jump to content
  • Advertisement
Sign in to follow this  
intrest86

Adding Windows to Wall

This topic is 4838 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

Hey everyone, The game I am working on uses rooms which are autogenerated, and then have windows/doors added to them. Obviously, windows and doors mean that holes need to be added to the wall somehow. There seem to be a few possibilites for how to go about this: 1) The mesh of the window can also include the wall it is set in, and then the piece of wall that the window is placed on is removed and replaced with the window mesh. This is definately simple, the main downside is that there must be more geometry to subtract out the whole in the wall. I don't know how much of an issue that may be. 2) Create the wall with the subtracted window at runtime when the rest of the wall is created. Keeps all of the geometry that is rendered with the wall texture in one buffer (good batching). The downside is that Writing an algorithm to deal with arbitrary door and window shapes could be hell. 3) Use another texture for each window that is used to alpha-test when rendering the wall so that there is an opening for the window when it is rendered. I think this would mean that each wall section that has a window must be rendered seperately with the texture (bad batching). But no extra geometry for this. What do you think? Is there a better way? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
is it possible to do something so that the window mesh is drawn over the wall? I havent used OGL in a long time but I seem to remember that you can do this with the stencil buffer, I think you would write the window to the buffer and then draw the wall on top of it and the wall would not draw where the window was. I could be wrong it has been a while

Share this post


Link to post
Share on other sites
You may want to take a look at CSV - constructive solid geometry. It allows you to model complex shapes by combining two existing ones. CSV uses boolean operators, such as union, intersection, or subtract. If you have used a modelling studio before, you may have used them.

Try searching google for it. I know there are some OpenGL libraries out there for it, so they are probably quite similiar. Since this will be a load-time operation, you probably can extract a lot of code, since the rendering doesn't matter.

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!