per-pixel lighting without pixel shaders?

3c6597370b476903ed475f70b4b3ce31
0
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.

Thanks.

9 Replies

Please log in or register to post a reply.

357c7b2935ccd2cb0913717186684394
0
JSoftware 101 Sep 23, 2004 at 04:05

GL_ARB_texture_env_dot3 instead of using fragment programs?

6e0b32504d31ae07efc17f3322cdb147
0
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.

2b97deded6213469bcd87b65cce5d014
0
Mihail121 102 Sep 24, 2004 at 18:39

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

2df744d739fa0e40597805545b8472ce
0
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.

http://developer.nvidia.com/attach/6741

modern_game_engine_design.html

F7ba50912e32c02e06da3470bb2bdf3b
0
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.

A8433b04cb41dd57113740b779f61acb
0
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.

254754b37f468a2926bffcd83bbbf1fa
0
z80 101 Oct 20, 2004 at 20:26

This IOTD comes to mind…

Ba3efeb9b32781fd70060e804beb0201
0
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.

280b3ca57720c1b1ad08dbc458325952
0
FarooqMela 101 Nov 04, 2004 at 22:07

Check out http://www.r3.nu/ for Cass Everitt’s work on per-pixel shading without anything more than OpenGL 1.1 compliant hardware.