Getting Bounding Box For Sphere on Screen

Started by
10 comments, last by Hodgman 9 years, 4 months ago


Either flip the culling mode when the viewpoint is inside the sphere, or else just use a regular full-screen quad for that case.

Nah, there's an easier way...


EDIT: Tried it and just remember why I decided not to use it. I rendered the geometry with additive blending and it doubled up because the back was showing through. I enabled back face culling, but when Im inside the sphere, it then culls out the sphere, so nothing is rendered. Any ideas?

Draw the back faces, not the front faces.

That worked perfectly. Thanks everyone for their help, this works really well for what I'm going to need.

Advertisement

Last time I did this, I just rendered a sphere :D I mean you're issuing a draw call anyway, who cares about a couple dozen extra polys...

All those poly-edges will reduce your pixel-quad efficiency though.

In the *artificial* worst case, there could be 75% wasted computation time (high poly sphere covering only a few pixels).
Some new cards support an extension for drawing axis-aligned 2D quads, as tiled based processing is getting popular, and regular methods always incur the penalties from triangles intersecting with the 2x2 pixel-quads.

On the flipside, drawing a quad instead of a sphere will have about 25% wastage too, from the corners that are outside of the sphere...

This topic is closed to new replies.

Advertisement