Monday, April 14, 2008

GLSL Array Index Problems & Software Mode

I was revisiting my per-pixel lighting code, just making sure it was simple and clear. I pulled out the attenuation (and spot attenuation) code and tossed it into its own function.

Bam. Software Rendering.

So what happened? Originally I had specified literal light-array indices. Once I added in the functions for attenuation, I passed the indices as const ints. Apparently the GLSL driver on my mac can't deal with this, and decides that the best way to handle the situation is to drop to software rendering mode. It would be nice if GL told you it was dropping to a software renderer; I would prefer crashing to failing silently.

I'm getting to a point where I'm seriously considering DX10 again. I've already installed Vista via Boot Camp....

No comments: