Simplest way of doing per-pixel lighing, How far you can go?

RacingPHT

Newcomer
Old topic. but Assuming your hardware has:
NO normalization, NO dot product, NO power(), NO reciprocal, NO cubemap.
just mul, add, tex2D(dependent fetch is OK), clamp to (0-1), all in 8 bit precision. a few instruction slots.

But you want:
not just "correct" local light, local viewer Per-pixel Diffuse Lighting, per-pixel Blinn lighing with arbitary shiness, but also anisotropy lighting. And moreover, I don't want to see any specular banding artifacts.

So...?
 
Yarr, that's ye olde Gamecube, is it not? (EDIT: And the Wii, of course).

And no, it can't really be done well.
 
Yarr, that's ye olde Gamecube, is it not? (EDIT: And the Wii, of course).

And no, it can't really be done well.

I just talking about idea, not actual hardware...But I believe the cube should have the ability.

In fact, I found THAT pixel shader could be as simple as this:
Code:
		PixelShader = asm{
			ps_1_1
			def c0, 0, 0, 0, 0.3
			tex t0
			texbem t1, t0
			tex t2
			texbem t3, t0
	
			mad t3, t3, v0, c0.w
			mul r0, t3, t2
			mad r0, t1, v0, r0
		};
 
You can cheat... but only to a cerain level. You wont be able to do normal mapping in the conventional way, but you can use Dependant texture reads to preform dot products per pixel. You can then use carefully designed environment maps to simulate highlights. If things are done well using EMBM you can also make the surface look bumpy.
 
You can fake a dot product with unextended OpenGL with multipass (12 passes IIRC). I did it once in a sample I wrote for the Imageon 2300. It looked pretty nice actually.
 
AttachFile-372947

That's what it looks like.

You can cheat... but only to a cerain level. You wont be able to do normal mapping in the conventional way, but you can use Dependant texture reads to preform dot products per pixel. You can then use carefully designed environment maps to simulate highlights. If things are done well using EMBM you can also make the surface look bumpy.

Dot product is not necessary, since the final result is fetched directly.
Technically, it's assuming linear differential of the whole function. It's not true, but good enough.
The real problem is when there is a big polygon, the vertex-correct half-way function is not interpolated correctly. The same problem with old nvidia paper.

You can fake a dot product with unextended OpenGL with multipass (12 passes IIRC). I did it once in a sample I wrote for the Imageon 2300. It looked pretty nice actually.

I know that trick, I think it's what Cass Everitt suggested long time ago. but I think it's better to get final result directly, rather than bothering dot product stuff.
 
Tesselate your polygons in screen space so that each poly covers exactly 3 pixels then vertex lighting = pixel lighting and simple gouraud shading will give you per-pixel lighting.

But thats not really in the spirit of the original question was it ;-)
 
Back
Top