XNA creating hole in wall
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 ?
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
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement