Toggling Baked Lamps in Three.js Without Reloading Textures

A developer tested switching baked lighting layers on a garden bench scene in Three.js without reloading textures. Blender Cycles baked the overhead fill, amber lamp, and blue lamp contributions onto a shared second UV atlas, and a shader blended the three linear textures using adjustable weights. The 116-triangle fixture kept the bench and path in a single draw call while the lamps were toggled. The layered textures totaled 72,528 bytes, compared with 83,004 bytes for an independent all-on bake, though the layered version added two cold-load requests. On a desktop with Chrome, WebGL 2, Three.js r187 and an RTX 5070 Ti, 24 switches took a median of 13.9 milliseconds from handler entry to the next render call, excluding GPU execution and display latency.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in