
22 2. Mozilla’s Implementation of WebGL
uninitialized texture data would be unacceptable for security and portability reasons.
So WebGL avoids exposing uninitialized memory and instead species that null texture
images must behave as if all bytes were set to 0 (i.e., as transparent black textures).
e straightforward implementation would be to allocate a buer, ll it with zeroes,
and pass it to glTextImage2D. at works, but adds overhead, so Mozilla’s implementa-
tion avoids this approach insofar as possible. e key observation is that in WebGL ren-
dering, all such transparent black textures are indistinguishable from each other. us,
one ca ...