[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Re: Long shader compiles



On 04/11/2011 07:58 PM, John Davis wrote:
> Win7, Chrome 10.0.648.204, Angle
>
> What was the fix?  With complex shaders, I'm not sure there is any
> getting away from this one.  A friend of mine told me that at Lucas
> Arts it would take ~12hrs to build the optimized shaders for xbox.  As
> long as the DirectX optimizer is on, I'm afraid we'll have this issue.

On a large-scale game title, there will be many hundreds of shaders -
each one compiled half a dozen different ways for depth pass, beauty
pass, shadow pass, etc.  When we were doing cross-platform work on an
"open city" game using the UnrealEngine, we built for Xbox, PC and PS-3
platforms at once - it could take 20 minutes to an hour do the lot.  12
hours seems like an awful lot...but it's not utterly impossible.

However, it's unlikely that a game written in JavaScript and downloaded
over the web is going to come close to that degree of complexity.

There is a fundamental problem though - the only way to cope with games
of that complexity is to store shaders in a pre-compiled form - but
AFAIK, that's not supported in OpenGL-ES or even desktop OpenGL.   So no
matter whether the time is 12 hours or 12 minutes (or even 1 minute),
you just hit a technological limit.  You just can't build things that
complicated.

However, for relatively small games that don't take a week to download
over HTTP and stand a chance of running on things like netbooks and pads
- you just have to lower your sights and shoot for something a little
less grandiose.   Heck, the game market is heading in the $1.99 end of
the scale anyway - you're not going to be able to fund a multi-million
dollar development that way.  The kind of game that produces enough
shaders to require more than a few seconds to compile is the kind of
game that consumes the efforts of 100 artists and another 100
programmers and designers for several years and sells for $60 in
WalMart.  That's not the kind of thing you use WebGL for.  We're talking
"Angry Birds" and "Farmville" - not "Halo" and "GTA IV".  A handful of
shaders in a couple of versions.

We should try to understand why looped texture lookups are unreasonably
slow - but I don't think that's a major concern.  Just unwrap the loop
yourself for chrissakes.

  -- Steve

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------