doom3 w r300/nv30

tEd

Casual Member
Veteran
I read the Q+A with john Carmack about doom3 here. I ask me if it is even possible to do more than 1 per-pixel-light in 1pass with the doom3 engine?the r300 and nv30 should theoretical be able to do more than 1ppl in 1pass with the ability of 16textures/pass. i have the impression that the way the doom3 engine render the scene you need at least 5passes for 5lights even if the hardware could do it in less passes.

may be someone could enlighten me on this.
 
I have to think about it, but in order to do more lights per pixel in one pass u have to clear the stencil buffer and to lay down it another time for the 'next' light. Dunno if you can do this in DX9 style shaders..

ciao,
Marco

p.s. it could be even counter-productive if a group of polys is not directly influenced by a light...
 
tEd said:
the r300 and nv30 should theoretical be able to do more than 1ppl in 1pass with the ability of 16textures/pass. i have the impression that the way the doom3 engine render the scene you need at least 5passes for 5lights even if the hardware could do it in less passes.

You could compress (expand, actually ;) ) the stencil for several lights into a texture. For example, into a four-component texture you could easily store the stencil for 4 lights, so the texture component is 255 for stencil equals 1 and 0 for stencil equals 0.
Then, instead of using stencil tests, you modulate each light contribution using the right component of that texture.

The problem is that even if you can access 16 different textures, you only have 8 vec4 texture interpolators (this is what DX9 requires and what r300 has, can't remember NV30 :?), so it will also depend on how many texture interpolators doom3 needs per light and how many can be shared among different lights. I guess that each light needs an independent interpolator fot the projective lightmap, but the normalised tangent space can be shared among lights. The light vector and half-angle will also be different for each light.

So more than having enough different textures, the main problem is the number of different interpolators: You can always pretend you have more textures by compacting them into a 3D texture (with some limitations), but you will still be limited by the number of texture interpolators.
 
have to think about it, but in order to do more lights per pixel in one pass u have to clear the stencil buffer and to lay down it another time for the 'next' light. Dunno if you can do this in DX9 style shaders..

This is where the R300 will really shine with Doom III. It has Twin Stencil registers for Each Pipeline. Dont know what the Nv30 will have.
 
Hellbinder[CE said:
]
This is where the R300 will really shine with Doom III. It has Twin Stencil registers for Each Pipeline. Dont know what the Nv30 will have.
Umh..I was not speaking about that...and anyway..all the new hw will have that feature, maybe even old one can have it with some driver trick.

ciao,
Marco
 
that is just not the case. It is Physical hardware.. and It cuts in 1/2 the number of geometry passes. John carmack makes mention of it in the new R300 video...

No GF4 does NOT have dual HARDWARE stencil registers PER pipeline.
 
Hellbinder[CE said:
]that is just not the case. It is Physical hardware.. and It cuts in 1/2 the number of geometry passes. John carmack makes mention of it in the new R300 video...
Hellbinder, I hope you at least understand what you are speaking about, cause to me, imho, you are not.
No GF4 does NOT have dual HARDWARE stencil registers PER pipeline.
?! I have not said a single word about GF4 !?
The new hw have just to set a different stencil op if a triangle is front
or backfacing.
When a triangle is front/back facing all its points are front/backfacing so there isn't any work to do per pixel, but just per poly.

ciao,
Marco
 
Back
Top