News for hackers. Stuff that matters.
Re:Three.js editor by jeremiep on Monday January 02, 2017 @07:29PM (#13305672)
Latest.

Here's the string concatenation to set the active texture unit. (By the way the fastest way to do it is "gl.TEXTURE0 + channel" instead of creating the string to index in the proper constant).

https://github.com/BabylonJS/Babylon.js/blob/master/src/baby...

As for the broken cache, I think it was Engine._activeTexturesCache; sometimes its indexed by texture channel other times by GL enum values (this makes the cache array explode to 30k elements and causes cache misses in half the code paths.)

From what I remember, lots of caches are needlessly trashed many times per frame.

There's also noticeable overhead to all of those "private static <constant> = value;" with public getters.

Re:Three.js editor by deltakosh on Monday January 02, 2017 @09:05PM (#13306100)
Just pushed an update to remove the string concat. No evidence of broken cache as all references to activeTextureCache use texture channel index.
Re:Three.js editor by jeremiep on Tuesday January 03, 2017 @09:19AM (#13309256)
You won't see it in the code. Run it through the debugger; the value of "channel" is sometimes the value of the GL enum rather than the index of the texture unit.

It could've been fixed since as well.