Just wondering about lighting on ps2

pixelbox

Regular
How many lights can the system handle when it is maxed out. I just don't get why lighting is impossible on ps2. Also if the vu0 was used more/right, could it increase the number of dynamic lights. Oh, and one more thing, why is dynamic lights so taxing on ps2? please please reply!!!!!:oops: :D
 
pixelbox said:
How many lights can the system handle when it is maxed out. I just don't get why lighting is impossible on ps2. Also if the vu0 was used more/right, could it increase the number of dynamic lights. Oh, and one more thing, why is dynamic lights so taxing on ps2? please please reply!!!!!:oops: :D

Impossible? Taxing? Says who?

The lighting on PS2 is entirely done in software, so you can do as many or as few lights as you have time for. Even brand new architectures effectively have the same trade-off as vertex and pixel shading isn't free beyond a certain (usually very low) amount of ops.

If you're just using VU1 for all the T+L (typical) and you're trying for maximum poly usage, there's probably no time for vertex lighting calculations at all. However if you're just aiming at a "healthy" number of polys you can probably do 4 directional lights pretty cheaply (i.e. still over 15M polys/s).

Using VU0 could be one way of increasing the complexity of lighting without impacting performance, but as with most things the difficulty of getting stuff out of VU0 would probably restrict its usefulness.
 
Thanks! Almost all of my ps2 library of games don't have dynamic lights. RE4 can't even afford a muzzle flash and usually if a game does have lighting, polys counts are cut in half. I guess the comment you made on no time for vertex lighting calculations fills that void. I wonder what the others have to say...
 
pixelbox said:
Thanks! Almost all of my ps2 library of games don't have dynamic lights. RE4 can't even afford a muzzle flash and usually if a game does have lighting, polys counts are cut in half. I guess the comment you made on no time for vertex lighting calculations fills that void. I wonder what the others have to say...

I'd be very surprised to find that your games don't have dynamic lighting - I've seen very few that don't... none spring to mind. You must have managed to collect all the ones that don't.

I don't think many games would sacrifice lighting for max-poly amounts for lighting, and frankly the ones that do probably won't be all that noticably "higher poly" so I doubt you're really seeing a lower amount in your "lit" games.

Maybe you should give some examples, because I can't help feeling you're imagining things.
 
You make a thread and fill it with unverified claims and statements based on pure hearsay and use big sweeping words such as 'impossible' and 'cut in half', then you ask for input and expect anything useful to come out of it?

*shakes head*
 
They are not hearsay or claims. They are mere approximations and beliefs. Most of my threads involves questions to you guys to either verify or discredit those beliefs of mine. I want to learn, not start trouble. And what better place to learn than beyond3d forums, home of developer!;) :D
 
MrWibble said:
I'd be very surprised to find that your games don't have dynamic lighting - I've seen very few that don't... none spring to mind. You must have managed to collect all the ones that don't.

I don't think many games would sacrifice lighting for max-poly amounts for lighting, and frankly the ones that do probably won't be all that noticably "higher poly" so I doubt you're really seeing a lower amount in your "lit" games.

Maybe you should give some examples, because I can't help feeling you're imagining things.
ok, im going to list the games i believe to have no dynamic lights...

All the jak and daxter games
red faction
re4
getaway 1 and 2
transformers
tomb raider aod
onimusha 1,2,and 3

even if a ps2 game has dynamic lights, in some games it seems to only light the character like npc's. point in case...sotc. the symbols you stab emit a green light that only lights you and around the area of the symbol. or in some cases, dynamic lights on ps2 causes frame tearing, a byproduct of a dropping frame rate and to get technical lack of vsync. over all, it seems taxing to have in a game on ps2.
 
pixelbox said:
ok, im going to list the games i believe to have no dynamic lights...

All the jak and daxter games
red faction
re4
getaway 1 and 2
transformers
tomb raider aod
onimusha 1,2,and 3

even if a ps2 game has dynamic lights, in some games it seems to only light the character like npc's. point in case...sotc. the symbols you stab emit a green light that only lights you and around the area of the symbol. or in some cases, dynamic lights on ps2 causes frame tearing, a byproduct of a dropping frame rate and to get technical lack of vsync. over all, it seems taxing to have in a game on ps2.

Well from what I remember of some of those titles, they most definitely have what I'd call dynamic lighting.

Perhaps you either have a different definition, or some unrealistic expectations of what it would do....
 
MrWibble said:
Well from what I remember of some of those titles, they most definitely have what I'd call dynamic lighting.

Perhaps you either have a different definition, or some unrealistic expectations of what it would do....
No! No i don't have an unrealistic expectation of what it would do. Dynamic lights=moving light sources. None of those games have moving light sources. maybe re4. i put that game in because it has no muzzle flash.
 
pixelbox said:
No! No i don't have an unrealistic expectation of what it would do. Dynamic lights=moving light sources. None of those games have moving light sources. maybe re4. i put that game in because it has no muzzle flash.

Dynamic lighting, to me at least, means that the lighting changes when stuff moves. The stuff can either be the light itself or the geometry - really there isn't much difference.

Some of the titles you list might well not move the light-sources around, but the geometry is certainly dynamically lit.
 
PixelPox: if a game suddenly 'switch on' a light that doesn't move and that is lighting a static object, that's called dynamic lighting :)
 
I think he means, for example doom3 when the demon throws a fire ball it lights up a room and cast shadows

but I think he maybe talking more about dynamic shadows and getting the two mixed up
 
pegisys said:
I think he means, for example doom3 when the demon throws a fire ball it lights up a room and cast shadows

but I think he maybe talking more about dynamic shadows and getting the two mixed up
Yea, that is what im talking about. I thought a light that doesn't move and that is lighting a static object is static lights.
 
There are many reasons for avoiding dynamic lighting (other than a simple directional + ambient term). For example, if you have lots of dynamic objects and lights, it can be quite expensive just to gather the influencing lights for each model. (to combat this, you can fade out lights after a certain distance/screenspace-threshold, ala gta)

Big-radius point lights suffer from (or at least, it's more apparent) artifacting, which is a byproduct of the per-vertex color calculation. It can be so bad that it's just not worth the effort. (Think big tiles of ground, or other scenery, not characters, as those are usually well-enough tesselated to hide this problem)

All in all, it is far from impossible to do dynamic lighting on the ps2, the vu is quite capable of summing up a good number of lights, but it usually "hurts" somewhere else in the engine/visual design of the game.

(btw this is not at all ps2 related, every game will have to decide about its own tradeoffs when it comes to N*M operations)
 
I can point to one PS2 game that has dynamic lighting and shadowing. I think 3 shadows per character, and several dynamic lights at once. Anyone guess what it is? I pick from sooo many different games when I give examples, and I might not have mentioned this one before. It's called...wait for it...Champions of Norrath!
 
How many lights can the system handle when it is maxed out.
For paralel lights - nearly infinite :p, although most commonly games go with 3-4 light influences per object.

And speaking of your examples, I seem to recall Onimusha 3 having moving light sources that affected everything, including the background. 1,2 were a different story - but when using prerendered backgrounds there's only so much trickery you can do...
 
Tearing

pixelbox said:
even if a ps2 game has dynamic lights, in some games it seems to only light the character like npc's. point in case...sotc the symbols you stab emit a green light that only lights you and around the area of the symbol.

You will also find in many games that lit areas have a fixed intensity regardless of distance from light source but this is true for all platforms.

or in some cases, dynamic lights on ps2 causes frame tearing, a byproduct of a dropping frame rate and to get technical lack of vsync. over all, it seems taxing to have in a game on ps2.

Tearing also happens when frame-rate jumps above 60 hertz. The way to identify too high frame-rate (in most games) is if control response is not noticable diminished when tearing occurs. If tearing is due to too low frame-rate (below 30 hertz), then control reponse would be noticably diminished.
 
ihamoitc2005 said:
You will also find in many games that lit areas have a fixed intensity regardless of distance from light source but this is true for all platforms.



Tearing also happens when frame-rate jumps above 60 hertz. The way to identify too high frame-rate (in most games) is if control response is not noticable diminished when tearing occurs. If tearing is due to too low frame-rate (below 30 hertz), then control reponse would be noticably diminished.

Why wouldn't they cap the framerate at 60? That seems an obvious thing to do on a fixed platform with a fixed speed monitor refresh rate. Also, why would adding effects in a scene cause the framerate to increase? That does make any sense.

FWIW, my understanding is that the PS2 can only add one effect to a polygon per pass, such as lighting, texturing, and whatever else you can do. Having point light sources means that you're adding another layer to whatever polygons it's hitting, meaning you have to do another pass on at least those polygons. That's why in high-polygon games like J&D, R&C, etc, you just don't see a whole lot in the way of vertex/texture-level effects. The more effects you have, the more quickly your polygon count drops to something not terribly nice-looking.

Some stuff can be effectually precomputed or at least predicted as well. For instance, you know exactly how many polygons have to be lit as a muzzle flash reflects back on a character, but there might be too many polygons in the area to light them as well and keep your framerate up. So if you just light the character, you can avoid that framerate drop. You can probably avoid computing it realtime as well and just make it part of the animation.
 
Last edited by a moderator:
fearsomepirate said:
FWIW, my understanding is that the PS2 can only add one effect to a polygon per pass, such as lighting, texturing, and whatever else you can do.
That isn't entirely accurate. The GS can apply texture, fog and gouraud shading all in one pass - pretty much any 3D rendering hardware released the last decade can do that.

Having point light sources means that you're adding another layer to whatever polygons it's hitting, meaning you have to do another pass on at least those polygons.
That assumes you implement lighting via lightmaps, which isn't always the case. Hardware accelerated lighting in the much-fabled T&L acronym is always done as vertex lighting, ie, gouraud shading. Games stretching as far back as the N64 at least used this feature extensively; Turok, which was a launch game for all intents and purposes did this, as did Shadow Man, Rogue Squadron etc.

That's why in high-polygon games like J&D, R&C, etc, you just don't see a whole lot in the way of vertex/texture-level effects.
I never liked Jak2 very much (frustrating design), but I think it has vertex lighting. I'm too lazy to pull out the game from my shelf and boot it up just to check, someone else has to do that...

The more effects you have, the more quickly your polygon count drops to something not terribly nice-looking.
Actually, multipass effects is something the PS2 rather excels at and other platforms quickly tanks on performance-wise... ;)

You can probably avoid computing it realtime as well and just make it part of the animation.
That would require keyframe animation tho and I don't think too many games use ancient tech like that anymore. Bones/inverse kinematics seem to be the order of the day, and for that, you must do lighting realtime.
 
Lighting is not done multipass on the PS2 very much - for one this the PS2 lacks a multiplicative blending mode. Lightmapping can actually be a bit of a pain to do. Multipass effects are bread and butter for the PS2 considering its fillrate, but blend modes limit the use cases a bit...

Instead, like pretty much any platform which lacks pixel shaders, lighting is accumulated per-vertex before rasterisation and you can have as many lights as you want in a single pass, provided you accept a per-vertex cost.

For reflections/specular a second, additive, pass can be used (which the PS2 is fine with).

Jak has what I'd call dynamic lighting. Characters are definitely lit - and if you want to see the background lighting change dynamically, just stand in a single place and watch as the day changes to night and back. It's probably done by cross-fading precalculated values, but it's still applying calculations as it renders and I'm sure they could have some (probably less interesting) moving lightsources instead. Also shiny surfaces use a shiny specular map - which although it doesn't involve lighting calculations, does involve similar calculations to move the UV co-ordinates around.

The PS2 simply has no trouble with the kind of operations being talked about here and the examples given do not prove otherwise.

Incidentally I've never seen a game on PS2 run *higher* than 60Hz. Games that exhibit tearing do tend to be capped and only swap buffers outside of a sync if they've run over. They do that because in the case of games that don't drop frames very often it tends to be less jarring than occasional drops to 30Hz. If you're consistently less than 60 I'd suggest just going all the way to 30Hz and staying there (or optimising more). Jak 2+3 annoyed me for tearing constantly just because they pushed the engine a little too hard.
 
Back
Top