Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by mtdrume · Aug 18, 2015 at 08:11 PM · shadershadowcutout

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.

alt text

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!

shadowcutout.jpg (115.0 kB)
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zach-r-d · Aug 18, 2015 at 08:31 PM 0
Share

What happens when ZWrite is disabled ("ZWrite Off")?

avatar image mtdrume · Aug 18, 2015 at 09:32 PM 0
Share

It doesn't change anything :( however I have just noticed that the real time shadows are going through other objects as well.

avatar image zach-r-d · Aug 18, 2015 at 10:19 PM 0
Share

Gotcha. Is Cast Shadows turned off in the $$anonymous$$esh Renderer of the depth masking object?

avatar image mtdrume · Aug 18, 2015 at 10:24 PM 0
Share

yeah it is turned off, i made a new project and shadows still go through game objects. Is this happening to you?

avatar image mtdrume · Aug 19, 2015 at 02:04 PM 0
Share

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?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

(SOLVED) How to bake lightmaps with transparent cutout shader ? 2 Answers

Shader: Cutout behavior mixed with masking behavior 0 Answers

Particle Cutout that cast shadow ? 2 Answers

Is there any double sided shadow casting transparent cutout shader? 3 Answers

Unity Custom CutOut Shader 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges