Jump to content
  • Advertisement
Sign in to follow this  
shifty89

XNA creating hole in wall

This topic is 2305 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 im really struggling to get info on how to tell a specific area of geometry not to draw. Basically for a project in looking at creating a hole in a wall via culling to stop a certain area being drawn. i cast a ray from the centre of the screen and i check to see if it has hit geometry e.g my wall model. When this happens i am trying to draw a shape which represents the area of the wall i want to cull. The problem is I have no idea how to tell the are contained within the shape not to draw to create the hole. Can anyone point me in the right direction ?

Share this post


Link to post
Share on other sites
Advertisement
Are you trying to do it this way for a reason? If not, why dont you just draw a bullet hole texture wherever you shoot

Share this post


Link to post
Share on other sites
Yes its for a project that exmaines weather or not punching a hole through a wall through entirely graphical means is a viable alternative to say a fracturing solution in certain situations.

Share this post


Link to post
Share on other sites
Really want I need to know is does xna have functionality to select an area not to draw, or if I could do it through shaders and attach them to an xna project.

Share this post


Link to post
Share on other sites
There are a few ways to do that.
I'd be currently inclined to associated each fragment with a world position and issue a clip volume such as a sphere for each hole, calling [font=courier new,courier,monospace]clip/discard/kill[/font] if the fragments ends being in the sphere. Something similar has been done in Left Dead 2 if memory serves.

Messing with alpha maps might also be a possibility. It natively allows for a much higher hole count, I guess it'll also be much faster to render but the machinery required is fairly more involved.

In general, no, XNA/Direct3D does not feature natively this degree of control. You have to build it on top of the provided features.

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!