- Home /
Can I turn off realtime shadows and use a shader to cast realtime shadows?
Update
I am understand shadows alot more now, if an object is not set to cast or receive shadows other objects shadows move right through them. So I guess, my question now is, are depth shaders ment to cut out the shadow, or can i make it so shadows drawn after all other draw calls?
im using depth shader mask to cut into a wall, from what i read it is meant to cut the shadow aswell, but it doesn't. So is it possible to turn off shadows on my wall, let the window shader run on x renderqueue than apply the shadows after? I can't seem to find a script that just renders the shadows, or if its even possible without them turned on, on the gameobject.
The pic should say remove cutout shadow :)
This is my script attached to the window, i setup renderqueue with a script based on camera position. i had shadows being cast from it but i have removed all shadows from it until i get the wall shadow cutout.
Shader "Depth Cutout" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.1
}
SubShader {
Tags {"RenderType"="TransparentCutoff"}
LOD 200
Blend Zero SrcColor
Lighting Off
ZTest LEqual
ZWrite On
ColorMask 0
Pass {
}
}
Fallback "Transparent/Cutout/VertexLit"
}
Maybe I am missing something obvious to make the cutout work for shadows?
Any help or nudge would be awesome!
It doesn't change anything :( however I have just noticed that the real time shadows are going through other objects as well.
Gotcha. Is Cast Shadows turned off in the $$anonymous$$esh Renderer of the depth masking object?
yeah it is turned off, i made a new project and shadows still go through game objects. Is this happening to you?
I am understand shadows alot more now, if an object is not set to cast or receive shadows other objects shadows move right through them. So I guess, my question now is, are depth shaders ment to cut out the shadow, or can i make it so shadows drawn after all other draw calls?