View Full Version : Subdividing/Tesselating GL_QUADS

05-19-2006, 09:43 AM
I'm trying to add some more vertices to a wall for lighting purposes. Im currently using GL_QUADS as the walls. Any suggestions would be appreciated!

05-19-2006, 11:30 AM
you could look at a recursive subdivision scheme. As long as a dimension of your quad is bigger than desired, split it. Rinse and repeat. I'll leave the details as an exercise ;) .

However, with today's pixel processing power, I'd look at per-pixel lighting as an alternative to brute-force subdivision. It looks better, and in many cases it's faster, too. There are dozens of demos in this area, for both the fixed function and programmable pipelines.

05-19-2006, 11:31 AM
Hmm I'll check it out. But at least now I have some direction, thanks!

05-19-2006, 11:47 AM
Here's a great place to start with the per-pixel lighting:

The Nvidia and Ati developer sites are brimming with demos, all complete with source code and some even have a white paper attached (good stuff).

05-19-2006, 12:22 PM
Hmmm, well, like that link is a bit dated, uses register combiners. I was thinking it was something else. Anyways, the concepts are still relevant, and it still may be of some interest to you. You know, if you just google for "per pixel lighting" you'll get a blizzard of hits, so I'll just leave it at that. The technique you use will obviously depend on your hardware, so I hope you're loaded for bear :) .