per-pixel lighting without pixel shaders?

john 102 Sep 23, 2004 at 02:43

Just wondering, is there a way to implement per-pixel lighting without the use of pixel shaders? I’m just thinking of a fall-back method for cases when hardware support is lacking.


9 Replies

Please log in or register to post a reply.

JSoftware 101 Sep 23, 2004 at 04:05

GL_ARB_texture_env_dot3 instead of using fragment programs?

SnprBoB86 101 Sep 24, 2004 at 15:03

Even if you can pull off per pixel lighting w/o shaders, I think the software solution would be slow as hell on a machine without tech new enough to run shaders.

You wouldn’t run XP on a 486… at least I wouldn’t…

Seems kinda like a lost cause.

Mihail121 102 Sep 24, 2004 at 18:39

dynamic lightmapping is always an option, although the implementation of such system is quite complex.

SimmerD 101 Oct 08, 2004 at 20:08

In DirectX8, you can use the texture stage setups to do simple per-pixel diffuse lighting in 2 or 3 texture stages, which works on GeForce1 and higher.

Here are some slides that help explain.


houdy 101 Oct 17, 2004 at 05:54

Nehe’s Lesson #22 is a good example.
In this lesson, Extensions like Multitexture, Cube Mapping, GL_ARB_texture_env_dot3, are used to do bump mapping.

Reedbeta 167 Oct 20, 2004 at 17:49

I wrote a program awhile back that does dynamic per-pixel lighting including normal mapping (no specular) using ARB_texture_env_combine and related extensions. It takes 4 texture units to do in 2 passes, but I think you can also make it work (using destination alpha to cache intermediate results) in 3 passes, using only 2 texture units. I can post if you want to look at some sample code.

z80 101 Oct 20, 2004 at 20:26

This IOTD comes to mind…

XORcist 101 Oct 29, 2004 at 19:16

Using Pixel Shaders is the most convenient & customizable way for Per-Pixel Lighting Fx like diffuse & Specular Normal Mapping.

The next thing that comes to my mind is with Register Combiners. We can use them to achieve proper real-time lighting by configuring the multi-texture combiners to perform the per-pixel math. Main disadvantages are that they are nVidia only & D3D does not support them directly. But, on nVidia cards, Register-Combiner paths are faster than Pixel-Shader paths. This is the reason why engines like Abducted use Reg-Combiners for their real-time lighting engine on nVidia cards. For ATI cards they use Shaders.

I think it is similar with Doom3 Engine as well.

FarooqMela 101 Nov 04, 2004 at 22:07

Check out for Cass Everitt’s work on per-pixel shading without anything more than OpenGL 1.1 compliant hardware.