Just wondering about lighting on ps2

MrWibble said:
Jak 2+3 annoyed me for tearing constantly just because they pushed the engine a little too hard.
They should have made it run at 30fps. The game could have looked better at 30 because of the boost in poly counts and extra memory for effects.

And you're right about the day and night shift in jak2/3 being dynamic. I completely forgot about it im so use to it. And having a light source that big lighting all of those polys i would imagine that to be taxing. No wonder they have no other moving light source. And MrWibble, i thought alpha blending was darn-near free on ps2. That being said how many effects could ps2 do to textures before it starts eating the fillrate to death?
 
pixelbox said:
They should have made it run at 30fps. The game could have looked better at 30 because of the boost in poly counts and extra memory for effects.
Most of the time, AFAIK, jak2 is gamecode limited, not 3D engine (GS + VU0/VU1) limited..

No wonder they have no other moving light source
They have moving lightsources and static lights with dynamic intensity (and precalculated palettes for the day/night cycle)

i thought alpha blending was darn-near free on ps2.
It is
 
MrWibble said:
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...
At the risk of sounding stupid, what is the "multiply" in multiply blending?
I always imagined that alphablending was just the weighed average of the two values being blended.
I know signed multiply blend from Photoshop, it seems like it stops the blending at certain value, but what is the difference between that and colour clamping?
 
Last edited by a moderator:
nAo said:
Most of the time, AFAIK, jak2 is gamecode limited, not 3D engine (GS + VU0/VU1) limited..
what do you mean? jak2 is optimised?

nAo said:
They have moving lightsources and static lights with dynamic intensity (and precalculated palettes for the day/night cycle)
where was the dynamic lights/moving light sources?
 
pixelbox said:
They should have made it run at 30fps. The game could have looked better at 30 because of the boost in poly counts and extra memory for effects.

And you're right about the day and night shift in jak2/3 being dynamic. I completely forgot about it im so use to it. And having a light source that big lighting all of those polys i would imagine that to be taxing. No wonder they have no other moving light source. And MrWibble, i thought alpha blending was darn-near free on ps2. That being said how many effects could ps2 do to textures before it starts eating the fillrate to death?

Jak1 had a day/night cycle too. No, it would not be "taxing" to have everything lit by a single light source, no matter how "big" it was. In fact if anything sunlight is probably the easiest kind of lighting to apply - but if it doesn't *matter* that lighting is fully realtime or not, why bother?

Alpha blending is indeed "free". Free in this context means that if you render a polygon the pixels get output at the same rate whether or not you turn alpha blending on, up to the maximum rate of 8 pixels per clock for textured or 16 pixels per clock for untextured.

Every time you want another pass, you render the polygon again.

The PS2 has roughly enough fillrate for 70+ passes over the screen if texturing, or 140+ passes if applying untextured polys (estimate based on fairly typical progressive resolution).

In reality it'll be a bit less.
 
pixelbox said:
what do you mean? jak2 is optimised?
It is, but they're pushing it at its limits.
Nonetheless Jak2 has one of the best PS2 3d engines out there..

where was the dynamic lights/moving light sources?
Everywhere, maybe you should pay attention :)
What about fires, explosions, etc..?
 
Squeak said:
At the risk of sounding stupid, what is the "multiply" in multiply blending?
I always imagined that alphablending was just the weighed average of the two values being blended.
I know signed multiply blend from Photoshop, it seems like it stops the blending at certain value, but what is the difference between that and colour clamping?

The kind of simple alpha-blending available in a fixed-function pipeline usually has some kind of equation.

In the case of the PS2, its (a-b)*c + d.

You have a choice for what you can substitute for a,b,c or d, but it's not completely flexible. In the PS2 you cannot have a colour channel for c, only for a, b or d. This means you can only multiply by alpha or a constant value (i.e. a single value for all of RGB).

Your "weighted average", which is typical for fading stuff in or out (semi-transparent effects) then you can use:

output = (Fragment - Framebuffer) * Alpha + Framebuffer

Rearranging this:

output = Fragment * Alpha - Framebuffer * Alpha + Framebuffer
output = Fragment * Alpha + Framebuffer - Framebuffer * Alpha
output = Fragment * Alpha + Framebuffer * (1-Alpha)

Which is a basic linear interpolation:

If Alpha=1, the output is Fragment.
If Alpha=0, the output is Framebuffer.
Anything in between is a smooth blend.

However the most basic lighting typically needs to use an equation like:

output = fragment colour * lighting colour.

So if lighting is dark, you get a dark version of the texture, if lighting is brightly coloured you get a tinted version of the texture.

You can do that per-vertex (the fragment colour is a product of the linearly interpolated vertex colours and the texel colour), but you cannot do it in the alpha blend unless you use monochromatic lighting and encode the light value in the alpha.
 
Last edited by a moderator:
pixelbox said:
what do you mean? jak2 is optimised?
It means they should have used assembler for the gamecode and not LISP. :p ;)

Thank you for the excellent explanation MrWibble.
 
Last edited by a moderator:
MrWibble said:
The PS2 simply has no trouble with the kind of operations being talked about here and the examples given do not prove otherwise.

I don't recall seeing anything like muzzle flashes or light from flames in any of the Jak or Ratchet games. You had the day shifting to night, but as far as vertex lighting effects orlight maps from muzzle flashes and projectiles, there wasn't squat. What you did see in a few places was an explosion or other light source just having a massive transparent polygon pasted on top of a flat surface. This was kind of a clever trick, I thought.
 
fearsomepirate said:
I don't recall seeing anything like muzzle flashes or light from flames in any of the Jak or Ratchet games. You had the day shifting to night, but as far as vertex lighting effects orlight maps from muzzle flashes and projectiles, there wasn't squat. What you did see in a few places was an explosion or other light source just having a massive transparent polygon pasted on top of a flat surface. This was kind of a clever trick, I thought.

I would assume it's more a case of the developer in question not realising that the entire future reputation of the console depended on them implementing a relatively minor feature and decided instead to spend their CPU time on other effects.

Not sure what you're talking about with the latter effects - but it's pretty common to use transparent polygons where you're trying to reproduce some kind of volumetric lighting effect - thats an entirely different problem to surface lighting (and the PS2 is probably the best of the last generation of console at doing that sort of thing...)
 
One pretty obvious example of vertexbased lighting i can think of, is the flashlight in Silent Hill 3. You can very clearly see the light flicking between the vertices.
 
Ive seen more dynamic, moving light sources on ps1 games than any on ps2. why is that? sure you have static lights and light maps but never any muzzle flashes or vertex dynamic lighting much. jak games had all types of guns that would produce this but none did. I really think ps2 has a hard time with vertex dynamic lighting. Im sure one of you developers can correct me if im wrong about this.
 
Squeak said:
One pretty obvious example of vertexbased lighting i can think of, is the flashlight in Silent Hill 3. You can very clearly see the light flicking between the vertices.
Yea it was pretty ugly. they should of used a light map along with it.
 
fearsomepirate said:
I don't recall seeing anything like muzzle flashes or light from flames in any of the Jak or Ratchet games. You had the day shifting to night, but as far as vertex lighting effects orlight maps from muzzle flashes and projectiles, there wasn't squat. What you did see in a few places was an explosion or other light source just having a massive transparent polygon pasted on top of a flat surface. This was kind of a clever trick, I thought.
The Ratchet games, or atlease r and c 3 used per-vertex lighting. the whip caused the light athough im not sure about muzzle flashes.
 
pixelbox said:
Yea it was pretty ugly. they should of used a light map along with it.

It's realtime calculated. Lightmaps are precalc and PS2 doesn't do per-pixel lighting, so there isn't a whole lot of option.

First time I've heard Silent Hill 3 described as ugly though.
 
pixelbox said:
I really think ps2 has a hard time with vertex dynamic lighting. Im sure one of you developers can correct me if im wrong about this.
Dude, get over it already, you've already been corrected by a number of people, including at least two devs (faf, nao), how much more pounding your thick skull in do you need? ;) Your rep is already in freefall due to this silly thread you made, don't make it any worse by persisting to try to spread this faulty theory of yours, okay?!
 
MrWibble said:
It's realtime calculated. Lightmaps are precalc and PS2 doesn't do per-pixel lighting, so there isn't a whole lot of option.
Uhm, I'm not sure I would agree.
It's just a white diffuse light anyhow - a projected texture with attenuation would essentially do the same 'math', without the vertex artifacting.
After all, that's also what they used in XBox/PC version for the 'perpixel' flashlight.

I don't know what Silent Hill titles on PS2 are limited by most of the time though - so it's hard to say much about performance implications for doing this.
 
What is the purpose of this forum? Why does it exist? I ask these things because everytime i ask a question, i get bad rep points. Not that i care but you can't ask a question here. im trying to seek enlightenment so i ask questions. i wasn't sure you guys knew what i was talking about, since i don't know a lot of terms, so i repeated some comments. what the hell is wrong with that? im not trying to spam, flame, or propagate. it's whatever.
 
Fafalada said:
Uhm, I'm not sure I would agree.
It's just a white diffuse light anyhow - a projected texture with attenuation would essentially do the same 'math', without the vertex artifacting.
After all, that's also what they used in XBox/PC version for the 'perpixel' flashlight.

I don't know what Silent Hill titles on PS2 are limited by most of the time though - so it's hard to say much about performance implications for doing this.

No, you're right - there are other options, and lightmaps don't have to be static. You'd be looking at an extra pass over everything (or at least everything in the light volume) but otherwise that would work just fine, assuming a destination alpha buffer is available to accumulate the light and shadows.

Brain not turned on error.
 
Back
Top