~ 1 Minute Read.

I re­cent­ly port­ed the “Won­der­land En­gine”, Vhite Rab­bit’s in­house game en­gine, to web us­ing web as­sem­bly and We­bGL with Em­scripten.

Dur­ing this process the point light shad­ows that we cre­at­ed for VR Toy­room back then didn’t quite make it, they re­quired ge­om­e­try shaders and ren­der­ing to a frame­buffer with a cube map tex­ture at­tached to it, which are not sup­port­ed on We­bGL or We­bGL2.

The process was sim­ple: the ge­om­e­try shad­er would mul­ti­ply the ver­tex da­ta for ev­ery side of the cube map and use one of six shad­ow pro­jec­tion ma­trix­es to project it.

Now, though, I need to ren­der the en­tire scene six times to six dif­fer­ent frame­buffers with one of the six sides of the cube map at­tached to each.

This brings GPU ren­der­time from ~1300 µs up to ~1500 µs, which is “not that bad”, but CPU times take a ob­vi­ous heavy hit from ~500 µs up to ~2800 µs.

The clue, though: I don’t use any frus­tum culling yet. Look­ing for­ward to how that will im­prove those num­bers. I’m hop­ing that it will im­prove it even past the orig­i­nal per­for­mance.

Writ­ten in 10 min­utes, ed­it­ed in 5 min­utes.