- Home /
How to change the reflection according to skybox-material?
Hi guys!
I have the problem that the shader i attached to a material on an object in my scene doesn't update when i change the skybox at runtime. The shader has a really high glossiness value and so the environment (it's only the skybox) is reflected. But when i change the color of the skybox or even the whole skybox, the object still shows the skybox that was active when the scene started. Important is that it has to happen at runtime.
Thanks for reading!
A wide range of different shaders as the program is a shader-creator for unity. Right now its only a standard shader that has a color and glossiness.
This isn't the best fix, but as a test; Try adding a realtime reflection probe.
In my scene i have exactly one object that has a material and the custom shader that is influencable over sldiers and checkboxes on the GUI. The skybox is for testing purposes changeable. The colors of the default skybox (procedual skybox shader) are changeable but the user can also select a completely different skybox that has the skybox/6 sided shader
So is it a physically based shader, or does it use cubemaps?
Using cubemaps? Like for the reflextion or what does that mean?
Answer by sacee · Apr 07, 2016 at 05:43 PM
Ok I found a more or less limited solution for changing the skybox reflection by creating cubemaps. The process is described in this tutorial: https://igorsgames.wordpress.com/2015/05/11/how-to-change-reflection-skybox-from-script-in-unity-5/
But I still have the problem that i cant change the colors of the skyboxes and their reflections at runtime...
Answer by Namey5 · Apr 22, 2016 at 09:57 AM
Ah, I've looked into it more myself, and I know what the problem is. It's more the ambient lighting than the reflections, as the ambient is baked and isn't done in realtime. The only way I can really see getting around this is creating your own version of the standard shader (surprisingly not that hard) and using reflection probes as the ambient lighting within the shader.
Your answer
Follow this Question
Related Questions
Reflections not working on IOS 2 Answers
How do I get rid of the black line in Unity Sky 1 Answer
How to combine several Materials into one? 0 Answers
How to made a normal skybox with a rectangle part of solid color 0 Answers
reflective glass shader 3 Answers