Home > Archive > Xbox forum > February 2006 > The Art of PS3 Programming





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author The Art of PS3 Programming
video-game dude

2006-02-25, 10:29 pm

http://blogs.guardian.co.uk/games/a...rogramming.html

By Keith Stuart / Next Gen/ PlayStation/ Smart Stuff 05:24pm

"I spent much of last December writing a preview of PS3 zombie shocker,
Possession, for the Official PlayStation 2 magazine. The game is a
mouth-watering mix of survival horror adventure and squad-based
shooter, with you commanding a ravenous undead army against a city
stuffed with civilians, cops and soldiers.

The magazine is now out on the shelves, so I can finally talk about
meeting up with Possession developer, Volatile, and chatting about what
it's like to write games for Sony's next-gen hardware. At the time, the
team were working with an emulator rather than a full PS3 dev kit, but
already seemed comfortable with the peculiarities of the
multi-processor behemoth.

Of course every developer is going to have a different take on PS3, but
this is what one of them had to say...


First of all, as with Killzone developer Guerrilla in a recent online
Q&A sesh, they were happy to point out that PS3 is not as complicated
to write for as we've all been led to believe. Apparently, the
machine's use of Open GL as its graphics API means that anyone who's
ever written games for the PC will be intimately familiar with the
set-up. In fact, PS3 employs a cut-down version named Open GL ES, which
is even simpler - as Volatile's lead PS3 programmer, Lyndon Homewood
explained:

"ES is designed for things like set-top boxes and mobile phones, where
you want the fundamental graphics but don't need some of the fringe
stuff that Open GL has. Because you've got that on PS3, it's going to
be much easier than the PS2 to get something up and running - there are
hundreds of books out there for it, so you can do your background
reading. All the documentation is there."

We also got onto talking about how PS3 will deal with Cg - a version of
the programming language C, which allows developers to code for
advanced graphics processing units, specifically in the area of 3D
shaders. (You can read more about Cg here and here). You may be
completely up to spec on how this works, but Lyndon gives a decent
beginners guide if not:

"Cg gives you a standard documented API for programming graphics chips.
The main two segregations of Cg programming are the vertex shader and
pixel shader. With the vertex shader you can act on 3D models at the
vertex level, so for each triangle you can do something on each corner
and then everything in-between is interpolated. So if you want to make
your whole shape bigger, you can just push all the vertices out a bit.
In this way you could, say, morph your character into a giant just by
scaling up all the verts. It's a lot easier to get to that point in the
graphics pipeline.

"And then you've got the pixel shaders. When you render each triangle
on screen the GPU asks whether you want to do something to each
individual pixel you render... so at this point you could run some sort
of mathematical algorithm on each individual pixel - perhaps a lighting
effect like high dynamic range lighting (a rough Wikipedia entry on HDR
lighting can be found here). And that wasn't possible on PS2.

"All of this is already available and won't be a massive leap from what
you're seeing on PCs with high-end graphics cards. But obviously on
PS3, you've got eight chips to spread the processing cost over - the
main PowerPC chip and seven SPE chips. In a PC, there's just one CPU,
two in a dual processor machine. Having an eight CPU multi-processor
system in your living room is pretty flash.

"At the end of the day it's just a multi-processor architecture. If you
can get something running on eight threads of a PC CPU, you can get it
running on eight processors on a PS3 - it's not massively different.
There is a small 'gotcha' in there though. The main processor can
access all the machine's video memory, but each of the seven SPE chips
has access only to its own 256k of onboard memory - so if you have,
say, a big mesh to process, it'll be necessary to stream it through a
small amount of memory - you'd have to DMA it up to your cell chip and
then process a little chunk, then DMA the next chunk, so you won't be
able to jump around the memory as easily, which I guess you will be
able to do on the Xbox 360.

"The graphics capabilities of PS3 will, I think, be slightly above the
absolutely top-end graphics cards on the PC, but you've got much more
processing power in the box so you're going to see a lot more physics,
a lot more generated geometry. With water ripples, for example -
they're pretty much algorithms, you have a flat plane of triangles and
you run some sort of mathematical algorithm over it to generate a
surface rippling effect - well, you will have the processing power to
do these sorts of generated geometry effects On PS3. You could actually
put one chip aside just to do that..."

According to Homewood, the management of the SPE chips is going to be a
major consideration. One way is to assign specific roles to each of the
chips - get one handling physics, one working on AI, etc. This might
sound tidy, but Volatile are not convinced - partly because certain
gameplay events, like a massive shoot-out, are going to create spikes
in demand for, say, animation, collision detection and rag doll
physics. One SPU working alone on each of these elements won't be able
to deal with such spikes efficiently. Also, there's the question of
co-ordination:

"The way we're thinking of doing it ourselves is via a job queue. We'll
stick the jobs we want to do into a queue on the main processor and
then we'll get the SPEs to pull off a queue entry and process it
whenever they're free. You want to make sure all of your processors are
always running. If you give the chips specific jobs, you'll end up with
a lot of them being idle - you won't get the maximum out of PS3 doing
that unless you time everything perfectly, so that the time it takes to
do the animation on the first chip is exactly the same amount of time
to do the physics on the next chip, which is exactly the same length of
time it takes to do all your AI on the next chip - I think that would
be extremely problematic."

One last thing. Volatile reckon PS3 is going to be much better for HD
cinematics than Xbox 360, thanks to its Blu-Ray storage medium. 20
minutes of HD-TV footage takes up around 4.7GB, so an Xbox 360 game
would quickly run out of space. This is going to matter more in the
coming years as movies and games merge and we see more film elements
being brought across to games.

So there you go. PS3 is relatively easy to program for if you have
experience with high-end PCs - certainly more straightforward than PS2
with its proprietary graphics APIs. We've also heard lots of talk -
from various studios - that Sony's developer support will be a lot
stronger with PS3 (it's already much, much better with PSP apparently).
Time will tell.

For now, we have screenshots, demos and promises, we have enthusiastic
developers taking their first glance at the next generation of Sony
hardware. We don't have games."

Temur

2006-02-25, 10:29 pm

hmm... whens the ps3 coming out though?
"video-game dude" <videogamedude@gmail.com> wrote in message
news:1138409205.703139.115490@g14g2000cwa.googlegroups.com...
quote:

> http://blogs.guardian.co.uk/games/a...rogramming.html
>
> By Keith Stuart / Next Gen/ PlayStation/ Smart Stuff 05:24pm
>
> "I spent much of last December writing a preview of PS3 zombie shocker,
> Possession, for the Official PlayStation 2 magazine. The game is a
> mouth-watering mix of survival horror adventure and squad-based
> shooter, with you commanding a ravenous undead army against a city
> stuffed with civilians, cops and soldiers.
>
> The magazine is now out on the shelves, so I can finally talk about
> meeting up with Possession developer, Volatile, and chatting about what
> it's like to write games for Sony's next-gen hardware. At the time, the
> team were working with an emulator rather than a full PS3 dev kit, but
> already seemed comfortable with the peculiarities of the
> multi-processor behemoth.
>
> Of course every developer is going to have a different take on PS3, but
> this is what one of them had to say...
>
>
> First of all, as with Killzone developer Guerrilla in a recent online
> Q&A sesh, they were happy to point out that PS3 is not as complicated
> to write for as we've all been led to believe. Apparently, the
> machine's use of Open GL as its graphics API means that anyone who's
> ever written games for the PC will be intimately familiar with the
> set-up. In fact, PS3 employs a cut-down version named Open GL ES, which
> is even simpler - as Volatile's lead PS3 programmer, Lyndon Homewood
> explained:
>
> "ES is designed for things like set-top boxes and mobile phones, where
> you want the fundamental graphics but don't need some of the fringe
> stuff that Open GL has. Because you've got that on PS3, it's going to
> be much easier than the PS2 to get something up and running - there are
> hundreds of books out there for it, so you can do your background
> reading. All the documentation is there."
>
> We also got onto talking about how PS3 will deal with Cg - a version of
> the programming language C, which allows developers to code for
> advanced graphics processing units, specifically in the area of 3D
> shaders. (You can read more about Cg here and here). You may be
> completely up to spec on how this works, but Lyndon gives a decent
> beginners guide if not:
>
> "Cg gives you a standard documented API for programming graphics chips.
> The main two segregations of Cg programming are the vertex shader and
> pixel shader. With the vertex shader you can act on 3D models at the
> vertex level, so for each triangle you can do something on each corner
> and then everything in-between is interpolated. So if you want to make
> your whole shape bigger, you can just push all the vertices out a bit.
> In this way you could, say, morph your character into a giant just by
> scaling up all the verts. It's a lot easier to get to that point in the
> graphics pipeline.
>
> "And then you've got the pixel shaders. When you render each triangle
> on screen the GPU asks whether you want to do something to each
> individual pixel you render... so at this point you could run some sort
> of mathematical algorithm on each individual pixel - perhaps a lighting
> effect like high dynamic range lighting (a rough Wikipedia entry on HDR
> lighting can be found here). And that wasn't possible on PS2.
>
> "All of this is already available and won't be a massive leap from what
> you're seeing on PCs with high-end graphics cards. But obviously on
> PS3, you've got eight chips to spread the processing cost over - the
> main PowerPC chip and seven SPE chips. In a PC, there's just one CPU,
> two in a dual processor machine. Having an eight CPU multi-processor
> system in your living room is pretty flash.
>
> "At the end of the day it's just a multi-processor architecture. If you
> can get something running on eight threads of a PC CPU, you can get it
> running on eight processors on a PS3 - it's not massively different.
> There is a small 'gotcha' in there though. The main processor can
> access all the machine's video memory, but each of the seven SPE chips
> has access only to its own 256k of onboard memory - so if you have,
> say, a big mesh to process, it'll be necessary to stream it through a
> small amount of memory - you'd have to DMA it up to your cell chip and
> then process a little chunk, then DMA the next chunk, so you won't be
> able to jump around the memory as easily, which I guess you will be
> able to do on the Xbox 360.
>
> "The graphics capabilities of PS3 will, I think, be slightly above the
> absolutely top-end graphics cards on the PC, but you've got much more
> processing power in the box so you're going to see a lot more physics,
> a lot more generated geometry. With water ripples, for example -
> they're pretty much algorithms, you have a flat plane of triangles and
> you run some sort of mathematical algorithm over it to generate a
> surface rippling effect - well, you will have the processing power to
> do these sorts of generated geometry effects On PS3. You could actually
> put one chip aside just to do that..."
>
> According to Homewood, the management of the SPE chips is going to be a
> major consideration. One way is to assign specific roles to each of the
> chips - get one handling physics, one working on AI, etc. This might
> sound tidy, but Volatile are not convinced - partly because certain
> gameplay events, like a massive shoot-out, are going to create spikes
> in demand for, say, animation, collision detection and rag doll
> physics. One SPU working alone on each of these elements won't be able
> to deal with such spikes efficiently. Also, there's the question of
> co-ordination:
>
> "The way we're thinking of doing it ourselves is via a job queue. We'll
> stick the jobs we want to do into a queue on the main processor and
> then we'll get the SPEs to pull off a queue entry and process it
> whenever they're free. You want to make sure all of your processors are
> always running. If you give the chips specific jobs, you'll end up with
> a lot of them being idle - you won't get the maximum out of PS3 doing
> that unless you time everything perfectly, so that the time it takes to
> do the animation on the first chip is exactly the same amount of time
> to do the physics on the next chip, which is exactly the same length of
> time it takes to do all your AI on the next chip - I think that would
> be extremely problematic."
>
> One last thing. Volatile reckon PS3 is going to be much better for HD
> cinematics than Xbox 360, thanks to its Blu-Ray storage medium. 20
> minutes of HD-TV footage takes up around 4.7GB, so an Xbox 360 game
> would quickly run out of space. This is going to matter more in the
> coming years as movies and games merge and we see more film elements
> being brought across to games.
>
> So there you go. PS3 is relatively easy to program for if you have
> experience with high-end PCs - certainly more straightforward than PS2
> with its proprietary graphics APIs. We've also heard lots of talk -
> from various studios - that Sony's developer support will be a lot
> stronger with PS3 (it's already much, much better with PSP apparently).
> Time will tell.
>
> For now, we have screenshots, demos and promises, we have enthusiastic
> developers taking their first glance at the next generation of Sony
> hardware. We don't have games."
>



Slitheen

2006-02-25, 10:29 pm


"video-game dude" <videogamedude@gmail.com> wrote in message
news:1138409205.703139.115490@g14g2000cwa.googlegroups.com...
quote:

> http://blogs.guardian.co.uk/games/a...rogramming.html
>
> By Keith Stuart / Next Gen/ PlayStation/ Smart Stuff 05:24pm
>
> "I spent much of last December writing a preview of PS3 zombie shocker,
> Possession, for the Official PlayStation 2 magazine.....


All fine n' dandy - but I couldn't give a rats arse for the numbers, my
money is waiting on the Revolution *and* a PS3 as they will have the titles
I want. I hope the developers don't let the technology drive their
creativity, as I heard one developer put it recently. The Revolution won't
even do HD, but it's aloft the top of my next gen shopping list, closely
followed by the PS3. The XBOX360 could be ten times the power of both
combined, and I wouldn't give a flying fumble for it. True next gen
Zelda/Mario and Metal Gear/Turismo.....now those words get me off to the
point of premature ejaculation......where processing calculations fail even
to raise a semi-erection. If you get my driftmans?


Xflop 360* Fahrenheit

2006-02-25, 10:29 pm

video-game dude wrote:

quote:

> "And then you've got the pixel shaders. When you render each triangle
> on screen the GPU asks whether you want to do something to each
> individual pixel you render... so at this point you could run some
> sort of mathematical algorithm on each individual pixel - perhaps a
> lighting effect like high dynamic range lighting (a rough Wikipedia
> entry on HDR lighting can be found here). And that wasn't possible on
> PS2.


Bullshit!

24, and SOTC both had HDR.
Even Splashdown:RGW used a form of HDR and BRDF shadding.

It was the Xflop that couldn't do HDR not the PS2.

proof:
http://home.earthlink.net/~mmchow/

Dub

2006-02-25, 10:29 pm

Xflop 360* Fahrenheit wrote:
quote:

> It was the Xflop that couldn't do HDR not the PS2.

quote:

> proof:
> http://home.earthlink.net/~mmchow/


Don't you even read the links that you send along?

MX vs. ATV (the VERY FIRST ENTRY, mind you):

"My contributions include: improved GPU based particle physics
simulations in MX, Fill-rate reduction techniques for particles,
***High-dynamic range on Xbox***, terrain and shadows improvements on
PS2 and Xbox, new shader development and engine optimizations."

HDR is an acronym for High Dynamic Range.

Andrew Ryan Chang

2006-02-25, 10:29 pm

listermonocle@hotmail.com <listermonocle@hotmail.com> wrote:
quote:

>Did Shadow of the Colossus have HDR? I don't think it did. I don't


They do a psuedo HDR effect as detailed here:

http://www.dyingduck.com/the_making...e_colossus.html

(or really, the next link on from there.)

As described there, I see no reason why any current-gen console
couldn't do the same thing. I'm pretty sure the light blooms in Halo 2
are done in a very similar manner.

--
Apples vs oranges: oranges win by a landslide!
Slitheen

2006-02-25, 10:30 pm


<listermonocle@hotmail.com> wrote in message
news:1138478053.661778.327100@g44g2000cwa.googlegroups.com...
quote:

> Did Shadow of the Colossus have HDR? I don't think it did. I don't
> think it had real dynamic lighting at all, though I'd have to play it
> again to be sure. Every single time a game has something blindlingly
> bright doesn't mean it's using HDR.


I hardly think it matters. SOTC is more akin to a work of art, or a
masterpiece, than a game, regardless. Also, on the 17th Feb, when SOTC and
Ico (re-release) launch......there will be a fair few miffed 360 punters. I
wouldn't swap my PS2 and those two games, one of which is years old, for a
360 and its full line up of games and coming release schedule. Which just
goes to prove the old adage, it's the games that matter.....not this geek
speak that you lot seem to get semi-erections over.


Copyright 2003 - 2008 gamesreviews.net Software forum  PC Hardware reviews