Advanced per-pixel lighting

Hi all,

I’m looking at implementing per-pixel lighting in my current project. I’ve come across "Advanced Real-Time Per-Pixel Lighting in OpenGL
using nVidia Register Combiners
" by Ron Frazier which is pretty close to what I want to achieve. It seems however that he’s using a lot of passes (around 4) and register combiners. Can I find code which is similiar to his which is aimed towards GF3 etc, i.e. using pixel/vertex shaders. He updates the light and half angle vectors on CPU and transferring this to the GPU is better.

10x for your help

My articles were meant to teach the concepts, not provide cut and paste code (though Im sure that works for some people). What I have in that tutorial most certainly applies to newer graphics cards. If you understand the stuff I talk about, it should be pretty easy to see how you can take what I did (pass1 * pass2) and put it into a single 4-texture pass. There are tricks you might be able to do if you are clever (like maybe realizing you only have to calculate the distance attenuation once per light instead of twice), but hopefully you will start to see those when you take a good look at the algorithm as a whole.

Of course, you are welcome to just copy code if someone else gives you a relevant link, but please dont feel like what I tought there is only for “dinosaur” cards.

Ron Frazier

Mi Lord

Yes I do plead guilty to wanting to copy code which works. Your paper is brilliant and I can never hope to reach that level any time soon, let alone convert the whole thing to an optimised shader solution. So I was asking for a wee bit of help

10 for your reply

Oh man. That was beautiful.

BTW, Ron, Your website HATES Opera browsers, or Opera browsers hate your site. Whichever, but I get stuck in what appears to be an endless chain of redirects.

My website hates no browser. It only teaches the lessons of love (…and pretty graphics, gotta have pretty graphics). It must be your browser that hates my site.

Seriously, I never realized that. I think I know why…its probably the browser caching the page when I automatically reload the same script with a different set of URL parameters. I did a web site at work last year and I had the same problem with Opera. I’ll see if I can do something for you and your 1% when I get the chance.

P.S. I just downloaded Opera 6 and it doesnt have this problem.

[This message has been edited by LordKronos (edited 06-22-2002).]