Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
0
Question by Laurent_Lavigne · Dec 14, 2010 at 06:02 AM · shadershadowparticlecutout

Particle Cutout that cast shadow ?

What shader is required to cast shadows with particle cutout (in 3.x)?

Here is the shader I use :

Shader "Particles/Cutout" { Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) _MainTex ("Particle Texture", 2D) = "white" }

SubShader { Tags { "Queue" = "Transparent" } Cull Off Lighting Off ZWrite On //Fog { color (0,0,0,0) } AlphaTest Greater .5 ColorMask RGB BindChannels { Bind "Color", color Bind "Vertex", vertex Bind "TexCoord", texcoord } Pass { SetTexture [_MainTex] { constantColor [_TintColor] combine constant primary DOUBLE } SetTexture [_MainTex] { combine previous texture } } } }

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by AR_Rizvi · Aug 26, 2013 at 01:02 PM

This Shader is transparent and transparent object cant cast shadows in unity try making this shader and cutout shader it can casta nd recive shadows

try sumthing like this

_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5

Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="Transparentcutout"}

pragma surface surf Lambert alphatest:_Cutoff

and it should work i hope it helps :)

Comment
Add comment · Share
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
0

Answer by Jona-Marklund · Aug 26, 2013 at 07:51 PM

If you don't want to turn the shader into a surface shader, you could add another pass which takes care of the shadow casting, like so.

 Shader "JM/CutoffShadowCast" {
 Properties {
     _Cutoff ("Outline Thickness", Range(0.0,1.0)) = 0.5
     _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
     _MainTex ("Particle Texture", 2D) = "white"
 }
  
 SubShader {
     Cull Off
     Lighting Off
     ZWrite On
     //Fog { color (0,0,0,0) }
     AlphaTest Greater [_Cutoff]
     ColorMask RGB
     BindChannels {
         Bind "Color", color
         Bind "Vertex", vertex
         Bind "TexCoord", texcoord
     }
 
     Pass{
     Tags {  "LightMode" = "ShadowCaster" }
     SetTexture [_MainTex]
     }
 
 
     Pass {
 
     Tags { "Queue" = "AlphaTest" "RenderType"="Transparentcutout" }
 
         SetTexture [_MainTex] {
             constantColor [_TintColor]
             combine constant * primary DOUBLE
         }
         SetTexture [_MainTex] {
             combine previous * texture
         }
     }
 }
 Fallback "VertexLit"
 }

Best Regards

Comment
Add comment · Show 1 · Share
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 Yaqoob · Sep 15, 2019 at 09:10 PM 0
Share

How would I get this to work with Point Lights

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

4 People are following this question.

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

Can I turn off realtime shadows and use a shader to cast realtime shadows? 0 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