I’m currently experimenting using a vertex program on the 2nd pass, to do the specular. Means I can very easily specify the light direction, to have correctly facing speculars.
Yeah, I suppose the other blending mode, would make a good spotlight kind of effect!
I have this vertex program specular thing working fine now, but my faces keep interfering for some reason.
It seems I’ve found a bug in using both normal T&L pipeline, and vertex programs in dual pass rendering. Though thats not surprising, cosidering they’re leaked drivers, but I thought I’d comment about it anyway.
Doing a normal 2 stage pass (both passes on normal T&L) works fine. i.e. no interference of poly’s provided you use 2 different depth functions. i.e. GL_LEQUAL, and GL_EQUAL.
However, enabling a vertex program for the 2nd pass, results in much polygon interference, unless vertex programs are used for both passes.
Very odd indeed.
I’ll try and get a multi-texturing vertex program version up and running soon.
Actually I just realised, it’s not a bug as such, just the result of mixing hardware and software rendering passes. The maths is not identical, thus giving this problem.
Which means it wont occur when it’s done in hardware proper.
I’ve done another specular demo… and it looks awesome!
Uses vertex programs too.
Heres the gist.
I have a point light source moving around the space ship. I dot the normal, and light vector to apply lighting to the material color, I then multiply on a cube map, calculated in the vertex program also, then with the 2nd texture unit, I add on a specular highlight.
The vertex program is huge!! 38 instructions, might be able to squeeze it down a bit, haven’t tried yet.
Will upload it to my website tonight! (edit: Upload complete!!)
It’ll be in the vertex program section.
Requires dual texture units, 7.17 drivers, and cube mapping. Can’t wait for this to get released officially.
Enjoy!!
Nutty
[This message has been edited by Nutty (edited 02-20-2001).]
How exactly does one go about writing these vertex programs? What sort of thing is this? I’d sure like to know how to get started on stuff like this. BTW, great work, Nutty!