Software Per-Pixel Lighting

Nick

Veteran
I've created some new software rendering demos. This time it's completely based on ps/vs 2.0: PhongCar.

You might recognise the model; it's from the ATI car demo. PhongCar uses per-pixel diffuse and specular bump mapping. BumpCar uses only diffuse bump mapping. SmoothCar is just to show the difference without bump maps. The light is located at the camera position and there's no attenuation yet, though I'll make a new version with more features soon.

If you notice any bugs or other strange behaviour, please report them! It's crucial to me and the Alias25 Game Library it is being integrated in.

(Part of the credit for the demo goes to Scali. He provided me with the original implementation on the old, publically available version of swShader.)
 
great work. nice to look at. too bad your prescott didn't worked out really, right?

oh, and.. haven't found a bug.. sorry. :D
 
Phong Car works like a charm.

Nick, go to SCEE and/or SCEA ( both, maybe even SCEI :) ) and pitch this technology to them: they will be interested IMHO.
 
It looked OK on my athlon 2400+, but it seemed to have pixel popping at the edges, though maybe that was expected.
 
Hi, it's Nick. I somehow lost my password while updating my profile information...
RussSchultz said:
It looked OK on my athlon 2400+, but it seemed to have pixel popping at the edges, though maybe that was expected.
It's 'only' rendered at 640x480 resolution. For software rendering that can even be considered a high resolution because it's constantly fillrate limited. CPUs are getting more powerful but I can't do miracles. ;) You can change the resolution in the swShader.ini file if you want.
Sabastian said:
Got a fairly solid 14 fps on my old P3.
I've got exactly double on my Pentium M 1.4 GHz. On my desktop Celeron 1.2 GHz I get 21 FPS.

Anyone with a 3 GHz Pentium 4? 8)
 
Nice demo. With an Athlon XP 2600+ I get ~30 FPS at the default camera perspective. If I get really close to the car that drops to ~12 FPS.
 
Is it just my machine or does changing values in the *.ini files not actually change the settings in the application when you run it? I've tried changing the resolution, Fullscreen, as well as the texture and mipmap filtering quality. Nothing seems to change.
 
p4 2.8gig ht:

PhongCar: 22fps
BumpCar: 32fps
SmoothCar: 67fps

does that help a bit, nick? don't have any faster system here.. though the pentium M is amazing! :D
 
btw, you have some interpolation-issues when you have to clip the polygons against the viewport, and you split them into several triangles. zoom _REALLY_ close to the car (nearly clipping on the nearplane), and look around over the surface (as if you would be standing on a HUGE worldsize car:D). you will see how the triangles get arranged at the clipping boundaries, and linear interpolation of something issues false-shadings.

if i need to, i can frap it at home, and show you the video..
 
Bumpcar 36.5 FPS
Phongcar 24 FPS
Smoothcar 81 FPS

P4 2.4C @ 2.83
 
PhongCar: ~20.2
BumpCar: ~24.6
SmoothCar: ~40.3

On a P3M 1.2 GHz.(133 FSB)
Im wondering why the PhongCar demo isn't faster on Bludd's system compared to mine. What's holding the speed back? Floating point opperations? Lots of branches? (Sorry dont know anything about Phong lightning)
 
It may be my system. I suspect I had too many programs running when I ran the demos.

I'm going to re-run the demos after I've rebooted and disabled some stuff.
 
I've uploaded a new PhongCar version: PhongCar.zip

It now loads the .ini file so you can change some settings. The light position is also controllable now, using the numpad keys. Shader syntax is also stricter, closer to ps/vs 2.0 specifications. Performance is a little higher now on my systems. My Pentium M 1.4 GHz runs it at 32 FPS! Apparently Pentium 3 based processors are better at MMX/SSE instructions.

I noticed a bug though... when I normalize the light or half vector per-pixel, the lighting of one half of the car is different. I don't think this should be happening. My nrm implementation appears to work correctly.
 
davepermen said:
btw, you have some interpolation-issues when you have to clip the polygons against the viewport, and you split them into several triangles.
I think it's because I don't interpolate with perspective correction yet. It's not hard to implement but I've just been too busy getting the difficult things working. ;)

Else it might be caused by not normalizing the vectors per-pixel. But since it also occurs at flat surfaces it's not likely the cause...
 
Back
Top