Subdividing/Tesselating GL_QUADS

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!

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 :wink: .

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.

Hmm I’ll check it out. But at least now I have some direction, thanks!

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).

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 :slight_smile: .