Skip to main content
gamedev.net
🔒 Locked

CSG + GPU + shader language

Started by x452Alba Feb 15, 2007 at 1:41 AM 1 replies 1.9k views
Original Post
x452Alba
x452Alba
Hi all, Just wondering if it was possible to perform CSG (constructive solid geometry) exclusively on the GPU using a shading language, for example, GLSL or HLSL? I've never seen it done before using a shading language on the GPU, but I have seen it done using the stencil buffer with the FF (fixed function) pipeline. Would it be simple or complex with headaches? I'm just wanting to use simple spheres with the basic union, addition and subtraction operations. Any ideas or suggestions? Thanks in advance.
Zipster
Zipster
Anything you do on the fixed-function pipeline can easily be implemented in the programmable pipeline. The most basic CSG ray-tracer only requires Z-ordered intersection information (as well as the desired boolean operation) to properly shade each pixel, so using the stencil buffer I see no reason why you wouldn't be able to perform CSG so long as you render front/back faces in the right order.

Also, addition is synonymous with union since we're only interested in shaded surfaces.
x452Alba
x452Alba
Sorry, I ment to say union, *intersection* and difference (subtraction).

Any more advice?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.