Ambient Occlusion, Global Illumination



Important for realism but painful to bake when I really want to layout everything inside PlayCanvas, not inside another editor. So many ways to do it, baked on server etc.

You said before " GI needs way small texture size, but takes way longer to bake. We are looking into option of baking it in Editor into atlas textures, and they will be downloaded on loading times. As GI will be in atlases and way smaller resolution, it wont be that big comparing to lightmaps." - at Runtime Lightmap Generation

There’s lots of ways to do ? refer to SAO:

Google SAO fragment shader

(I suffer from not knowing enough about computer graphics, so I understand AO can be different to GI but AO can approximate GI?)

edit - ok I guess lightfield probes as you suggested elsewhere seems pretty good.



AO - is fully fake effect, it does not tries to actually replicate any real-world light behaviour, rather tries to fake something is a bit more complex - is the way photons bounce around geometry. In narrow areas less light will be able to land on obstructed surfaces, as it is less open and is obstructed. This is what AO tries to replicate - is to identify how things are “obstructed” by geometry around. So in corners you see less light and in open planes more light.

The links you’ve provided describe SSAO technique, which is Screen Space Ambient Occlusion, the core thing here is “screen space”. Some effects you can do in run-time from camera screen using some available information: normals, depth, position, etc.

To render stuff for whole scene, you need to do it not in screen space, but in world space and store it in AO texture, which is usually on the same UV channel as Lightmap.
AO usually uses same resolution as lightmap too.

There are many techniques around, most of them in short: build some mathematical representation of scene, for example as octree, an then runs raycasting algorithms through this octree to compute the required data. Then as you have relationship from octree back to geometry, you put back data from octree into texture.

AO is unrelated to GI.

Global Illumination - is the way to simulate light bouncing around the environment. Although this can be computed using very similar mathematical structures: octrees and many others. The traversion algorithm through data is different, but in overall system is very similar.

Probes we will be working on are different. We will be making light probes system that allows developer to put light probes around environment, which then affects dynamic and potentially static geometry, so they get shaded relatively based on environment around. But this is loads of work, and quality will differ, and it won’t meet all cases. Positioning probes around environment will be another thing to be done by developer.