Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Hybrid

Real-time CSG

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

Has anyone here attempted CSG in real-time? I saw a tech demo by Stan Melax of real-time CSG and was impressed by it''s speed, and am looking into doing it myself. I understand people always say use BSP trees for CSG, though I''m sure some sort of other tree would also give decent results if done properly. Has anyone got any tips or tricks for real-time CSG? Are there any common problems to be aware of?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
If you do not need the resulting mesh from a CSG operation but only want the visualization, it can be achieved using a multipass approach involving both depth and stencil buffer. If you google for realtime CSG I believe you can find an OpenGL implementation of the algorithm.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i''ve been thinking about trying out real time CSG...

I found this but haven''t tested it out...

http://ciel.me.cmu.edu/soji/ysclass/ysclass.html

it''s a library and the blendshell seems like it would do the trick...


NAME:YsBlendShell
DEFINITION:
YSRESULT YsBlendShell
(YsShell &NEWSHELL,
const YsShell &SH0,
const YsShell &SH1,
YSBOOLEANOPERATION BOOL=YSBOOLBLEND);
RETURN:
YSOK Successfully blended
YSERR Failed
DESCRIPTION:
This function blends two shells, SH0 and SH1. Not only blending,
this function also can perform boolean operations, OR(UNION),
MINUS(DIFFERENCE) and AND(INTERSECTION).

You can specify the type of boolean operation by the parameter BOOL.
The value of BOOL can be chosen from:

YSBOOLBLEND
YSBOOLAND
YSBOOLOR
YSBOOLMINUS

YSBOOLBLEND just blends two shells. All intersecting polygons are
slashed along intersecting lines.

YSBOOLAND takes the intersecting part of two shells.

YSBOOLOR adds two shells into one shell. All unnecessary polygons
,those are inside the new shell, are eliminated.

YSBOOLMINUS will subtract SH1 from SH0.

All operations other than YSBOOLBLEND does not work if one or both
of two shells are not solid.

The result is set to NEWSHELL.




Share this post


Link to post
Share on other sites
Thanks for the replies. I need the resulting mesh not just the visualisation of it.

I''ll have to take a closer look at that YS class one, it certainly looks interesting.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Don''t know if you are still checking this...but I did get around to testing the YsClass...

Way too slow for real time...oh well, back to the drawing board...

Share this post


Link to post
Share on other sites
CSG sadly isn''t simply, but have you considered making the mesh changes with a thread in the background and faking the images via depth/stencil buffer while the mesh hasn''t been finalized yet.

I wrote functions for CSG once and that stuff definitely wasn''t real-time capable. As soon as CSG gets interesting - complex objects intersecting each other in non-trivial ways - you end up in a world of pain. Numerical inaccuracies, poly-counts beyond your worst fears.

As long as nobody puts a gun to my head and tells me "do it in CSG" I will try everything in my power to avoid it.

Share this post


Link to post
Share on other sites
Ideally the CSG operation would take place in 1 frame, but other less essential stuff could take place in the immediate frames after - such as detecting floating geometry or remaking the vertex and index arrays for rendering.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://john.slagel.com/Geomods.html

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!