I have a scene with custom shaders, and they have some custom fog effects on them. These depend on player position, so they do not look right in the editor 3d view.
I would like to be able to adjust the shaders in the editor view, while having them run properly in the game view.
Something like:
if(inEditor)
upload this shader var
else
upload that shader var
Thanks!
Kjetil
www.blinkstudios.no
You could use Application.isRunnning and renderer.material.shader = someShader.
You would end up having some unneccessary overhead in your build though, I’d prefer to replace the shader of the Material when testing/building the game.
Well, I could perhaps setup it up within a debug define conditional and disable this on device build. They should be removed on compile.
#define DEBUGSHADERS //at the first line
[System.Diagnostics.Conditional( “DEBUGSHADERS” )]
–and do additional shader adjustments application.isrunning checks here.
Yeah, it could work. Thanks!
Btw, is there a way to make the shader render one way in the editor view, and another way in the game view?
Kjetil