Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 BerggreenDK · Jan 02, 2012 at 10:09 PM · shadertransparencyfadeobstacle

Making the objects infront of the primary hero translucent?

I am trying to figure out what approach would be the best for this scenario:

I have a group of heroes in the middle of eg. a forest. The trees closest to the camera (those between the group and the camera) are blocking the clear sight for the player and I would like to make those trees more or less transparent.

But - as they are single sided polys, like a tree consists of a "pole" that has branches. How would you "fade them out" ?

IF shader is the only solution, what shader or where do I code that?

Eg. I have a defuse with alpha transparent leafs and if I also have to make it half transparent sometimes, doesnt that give some new problems... argh!...

The simple question is:

How do I hide/fadeout the in scene objects that obstructs my view. Its not the calculation of which to hide, but HOW to hide them nicely so they dont "blink" when I move on with the heroes.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by syclamoth · Jan 02, 2012 at 11:55 PM

You need to have a special shader for all the 'fading' things. Use some kind of semi-transparent shader (that you can set the alpha value in code for), and then it's as simple as drawing raycasts between the player and the camera and fading out anything that is caught in-between.

There's no simple way around it, I'm afraid. For most things, there shouldn't be a problem hacking in a simple alpha blend into foliage shaders (since they usually have transparent parts anyway). As long as you check to make sure that the value exists before trying to modify it, you shouldn't have any problems with the actual fading part (I'm pretty sure that's the easy bit).

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 BerggreenDK · Jan 03, 2012 at 08:32 AM 0
Share

Thanks, thats also what I've been trying so far. I'm just not too good with shader language yet.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to fade a game object with all its children (Sprite Renderer / Image)? 0 Answers

Shader is not displaying alpha correctly 0 Answers

Metallic/Specular map broke fading in build 0 Answers

Shader with both Transparent and Fade as render mode 0 Answers

Transparent/Specular Shader - I want alpha to control spec, not transparency 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