Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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
1
Question by Henrique Vilela · May 10, 2011 at 10:53 PM · shadershadowalpha

Semi-transparent shader with Shadows

I need a shader that supports semi-trasparent objects and cast shadows, it doesn't need to receive it. Anybody knows one or knows if is possible to write one?

Next, only opaque objects cast and receive shadows; that means if you use built-in Transparent or Particle shaders then you'll get no shadows. In most cases it's possible to Transparent Cutout shaders (for objects like fences, vegetation etc.). If you use custom written Shaders, they have to be pixel-lit and use Geometry render queue. Objects using VertexLit shaders do not receive shadows either (but can cast shadows just fine).

Source: http://unity3d.com/support/documentation/Manual/Shadow%20Troubleshooting.html

I just need to cast the shadow from the transparent object, I don't need to receive it.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · May 11, 2011 at 12:05 AM

Just with shaders that's not really possible, but there might be a way if you have only some of those transparent objects and you have the time (and knowledge) to implement your own stencil shadow renderer. But it's a nasty piece of work (i did it one time just for educational purpose). If it needs support for multiple lights it gets even more complicated. A high light or object count will have a great impact on your performance. Also I'm not sure if a stencil buffer is available in Unity (i guess you can't change the device context parameters).

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
1

Answer by Eric5h5 · May 10, 2011 at 11:07 PM

It's not really possible. http://forum.unity3d.com/threads/9909-No-shadows-visible-on-Transparency-Shaders-!!?p=71027&viewfull=1#post71027

Comment
Add comment · Show 2 · 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 Henrique Vilela · May 11, 2011 at 01:43 AM 0
Share

Documentation make sounds like it is possible.

"...If you use custom written Shaders, they have to be pixel-lit and use Geometry render queue. Objects using VertexLit shaders do not receive shadows either (but can cast shadows just fine)."

Source: http://unity3d.com/support/documentation/$$anonymous$$anual/Shadow%20Troubleshooting.html

avatar image Eric5h5 · May 11, 2011 at 02:17 AM 1
Share

@HVilela: There's nothing you quoted that makes it sound possible. Did you read the link I posted? Aras wrote the shadow system; it's a bit possible he knows what he's talking about....

avatar image
0

Answer by Linmst · Mar 23, 2013 at 08:23 PM

http://wiki.unity3d.com/index.php?title=TransparentShadowReceiver

Hey, just check this out. However, it still shows some warning when I get it into my project even if it works.

So I still need someone who is good at Shader stuff for me to figure this out. (( I'm now doing a project and I just cannot be sure if I could use this shader script if I build it as a .apk file.

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 Estevominador · May 14, 2014 at 06:04 PM 0
Share

looks good

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

2 People are following this question.

avatar image avatar image

Related Questions

Blur the alpha part of a shader 1 Answer

Shadows with Alpha, fade out shadow. 2 Answers

Fade-In/Out shadows for a specific object 0 Answers

Shader with zwrite, shadows and alpha (special alpha) 2 Answers

Transparent Diffuse Specular Normal Shader problem 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