Jump to content
  • Advertisement
Sign in to follow this  
woya25

Create holes in plane dynamically

This topic is 902 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,

 

I have simple big plane and I like to dynamically dig holes into this plane.

Im not sure about my flow.

 

So I like to create texture, something like height map, where I will draw holes and their depth by CPU code.

After that I will emit new vertices based on this texture in geometry shader and draw it.

 

Is this good flow or is there other better ways how to achieve this?

Thank you for help.

Share this post


Link to post
Share on other sites
Advertisement
What's the ultimate purpose? Do you actually need the holes to exist in the geometry, or could you get away with using a texture on the plane, and writing your "holes" to the alpha channel to render those areas transparent?

Share this post


Link to post
Share on other sites

I working on "prototype" where player use shovel to dig holes into flat terrain. Lets say digging tresure or something like this.

So I need physically created holes which can be deepened further and further with some limit.

Share this post


Link to post
Share on other sites

Try searching for information about Constructive Solid Geometry.  That lets you do boolean operations of shapes, so you could setup a ground mesh then subtract the spheres from it.  You could also look into voxels, setup a big array of voxels for the terrain, then just start removing the voxels as the user digs.  With voxels, you'd still need to look into some way of calculating the mesh from the voxels though, but there should be a lot of information about that online as well.

Edited by xycsoscyx

Share this post


Link to post
Share on other sites

If you look up the term "marching cubes" or "marching spheres" you'll find some intersting info for 'voxel' methods. The term "voxel" is incorrect, since it's geometry, not pixels, but.. meh..

 

I'm not sure how usefull it would be though. I think it's really CPU intensive. I think this is one of the biggest barriers to dynamic terrain alteration - especially if you want wide open outdoor terrain.

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!