This is my first Shader Lab post. I’m finally biting the bullet and attempting to learn this!
I want a room with 2 doors that lead to 2 different worlds. Let’s say for ease of explanation that one door leads to Jurassic park and the other leads to Star Wars. Both doors are on the same wall so you can see the same area through each one. When looking through one door you should see a spaceship and when looking through the other door you should see a dinosaur.
Right now I’m using this for the dinosaur door:
Shader "Depth Mask" {
SubShader {
Tags{"Queue" = "Geometry-101"}
Colormask A
ztest Lequal
Zwrite on
Pass{
}
}
FallBack "Diffuse", 1
}
And this for the dinosaur’s material:
Shader "BumpedCave" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_BumpMap ("Bump (RGB) Illumin (A)", 2D) = "bump" {}
}
SubShader {
Tags{"Queue" = "Geometry-102"}
UsePass "Self-Illumin/VertexLit/BASE"
UsePass "Bumped Diffuse/PPL"
}
FallBack "Diffuse", 1
}
I’m using this for the spaceship door:
Shader "Door1" {
SubShader {
Tags{"Queue" = "Geometry-104"}
Colormask A
ztest Lequal
Zwrite on
Pass{
}
}
FallBack "Diffuse", 1
}
And this for the spaceship’s material:
Shader "Objects1" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
_BumpMap ("Bump (RGB) Illumin (A)", 2D) = "bump" {}
}
SubShader {
Tags{"Queue" = "Geometry-105"}
UsePass "Self-Illumin/VertexLit/BASE"
UsePass "Bumped Diffuse/PPL"
}
FallBack "Diffuse", 1
}
While looking through the Spaceship door, you can’t see the dinosaur and that’s good. But while looking through the dinosaur door, of course you can see the dino and the spaceship.
I need another method of making objects invisible. The Queue isn’t working for this.
Any ideas on how I can make this work??
Thanks!