envAtlas problems with StandMaterial
In class StandMaterial, property "prefilteredCubemaps" is defined with setter, witch generating envAtlas from prefilteredCubemaps. The result of generated Texture is just stored in the material instance, not shared with others. If there are multiple material instances, with save prefilteredCubemaps asset, same number of envAtlas texture (512 * 512) will be generated at runtime. That makes our projects crash on mobile device, such as iPhone.
The envAtlas texture, generated by generatePrefilteredAtlas, cannot be restored by uploading source, when context restore.
Hi @Casval111 ,
Just generate the envAtlas yourself from the cubemap and set it directly on StandardMaterial.envAtlas on all materials that need it?
The envAtlas texture, generated by generatePrefilteredAtlas, cannot be restored by uploading source, when context restore.
You are correct, this is a known issue. Ultimately the envAtlas should be pre-generated and stored in a PNG so reloading after restore would just work.
Thanks!
@Casval111 Just a note that the Texture Tool has been updated to allow you to generate the envAtlas texture.
The envAtlas texture, generated by generatePrefilteredAtlas, cannot be restored by uploading source, when context restore.
You could also hook up to 'devicerestored' event on the device, and regenerate atlas from the cubemap at that point.
We can close this as done, new prefiltering lighting in the Editor is stored as png.