Hi!
I’m trying to get a good glass shader with cubemap reflections.
There’s no real light source in my scene, it’s all lightmapped.
I tried this shader from the forum
Shader "Glass" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Transparency (A)", 2D) = "white"
_Reflections ("Reflection cubemap", Cube) = "skybox" { TexGen CubeReflect }
}
SubShader {
Tags {"Queue" = "Transparent" }
Pass {
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Material {
Diffuse [_Color]
}
Lighting On
SetTexture [_MainTex] {
combine texture * primary double, texture * primary
}
}
Pass {
Blend One One
Material {
Diffuse [_Color]
}
Lighting On
SetTexture [_Reflections] {
combine texture
Matrix [_Reflection]
}
}
}
SubShader {
Tags {"Queue" = "Transparent" }
Pass {
Blend SrcAlpha OneMinusSrcAlpha
Material {
Diffuse [_Color]
}
Lighting On
SetTexture [_MainTex] {
combine texture * primary double, texture * primary
}
}
}
}
… my problems are:
- I am an idiot when it comes to writing shaders
- I’m just starting out…
- all the stuff behind my glass material gets brightened up which is kinda unrealistic
- the above shader doesn’t have a color when there’s no light in the scene
Now what I need is a transparent blueish material with a cubemap that gets reflected…
I’d be so glad if someone could help me a little in finding a solution
Thanks a lot in advance !