- Home /
Runtime cubemap generation from 1x256 gradient image?
If you import such an image with Advanced settings and select "Cylindrical" for "Generate Cubemap", then apply that cubemap to a material with a "RenderFX/Skybox Cubed" shader, you can assign that material as the skybox in the Render Settings. This produces a lovely static gradient skybox if that's all you're after!
Trouble is, I want to alter my 1x256 gradient image at runtime. Calling SetPixels() and Apply() on that image reflects the changes in the inspector, but doesn't affect the cubemap or what it's drawing. I tried calling Apply on the cubemap object just to be sure, and that doesn't have a measurable result either.
I understand that the Asset Importer is part of the Editor, which means I probably can't use its very, very handy Generate Cylindrical Cubemap function to get this job done in real time. Can I somehow port that code into a runtime environment? What are my alternatives? Besides a skydome with vertex colors, of course.
As always, I'll share my code if someone can successfully aid me. Thanks for reading!
I'll probably switch to a skydome model and write a nice shader for it. I'll avoid expensive CPU gradient evaluations and calls to SetPixel(), and I'm sure the GPU can take the hit.
However I'd still like to hear any feedback on my question in case this comes up again. Thanks!
Your answer
Follow this Question
Related Questions
Using Render Textures To Create a Cubemap 0 Answers
How to change material skybox at runtime ? 2 Answers
Run-time lightmap generating for procedural terrain 1 Answer
Custom procedural skybox 0 Answers
Procedural NavMesh Instantiating 0 Answers