Shaders performance/optimization in OpenGl ES 2.0

Hi there,

I was making some performance test using the built in shaders (normal maps, cubemaps…) and as expected the performance drop when having more that one light is huge. Anyone knows how to tweak the shaders to force it to calculate the lighting from a unique light (the one who gives the object the more intensity)?. The best example of this is a straight street with lamppost. An object moving along the streets would only compute the light from the nearest lamppost (if all the lamppost have the same intensity). This is the approximation that Epic uses in the “Epic Citadel” demo.

Thx!

Epic does not use a single dynamic light in the citadel demo its all prebaked.

So if you want a similar level of performance use lightmapping only and don’t touch pixel lights cause they will always be a performance hit and bake a static “normal light direction” to use with correspondingly optimized new normalmap shaders that read from that texture instead of real lights

In the Epic demo most of the lights are baked. But also they use the simplification I speaked before. If you whant to test this take a look at the specular of the rocks that are under the lights inside the city. Also you can take a look at their shaders if you have dowloaded it (they are not encrypted)

Well the easiest thing you can do is use the quality settings and reduce the settings to only make a single light affect a material.
Also its important to keep in mind that the citadel demo uses the max the device has to offer (which is why it fucked out on itouch 4th gen as epic just assumed “retina = 512mb ram” and similar stuff.

but even with the quality settings, unless you start doing your own shaders and correspondingly opted art you will not get there.
The epic citadel is a combination of a solid technology, great art and superb work on the mobile optimization and the later two are to 100% your work to do :slight_smile: (unity offers you the solid technology to do so)
with your work to do I really mean you have to do it now. Because there aren’t any old shaders to use, prior to U3, the iOS side had no programmable pipeline support

Thx draemora. Change the quality settings has been the first step (I don’t know how can I forget that :frowning: ). Now its time to get dirty with the shaders.

Thx again!