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
0
Question by SterlingStudios · Jul 24, 2014 at 04:44 PM · colorfadetransparentpicturecave

How to make a gameObject's color fade to transparency (picture)

Hello, I have been working on a cave model, finished it, and textured it. I found out you can't make caves in the Unity Terrain System, so I found a way around it, similar to Skyrim's. I want the blackness to fade in so it looks more natural. Right now, it just looks bleh. Here is a picture:alt text

screenshot #1.png (281.3 kB)
Comment
Add comment · Show 4
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 Pendrokar · Jul 24, 2014 at 04:49 PM 0
Share

So currently the black is part of the terrain with a black texture?

avatar image SterlingStudios · Jul 24, 2014 at 04:52 PM 0
Share

No, it is an individual block with a black material on it.

avatar image Pendrokar · Jul 24, 2014 at 05:00 PM 0
Share

Is the cave itself behind this block or is it just meant as a region, which switches the scene when player goes into it?

If it is the latter then I understand you want a gradient(transparent-black) between the rock and black texture?

avatar image SterlingStudios · Jul 24, 2014 at 05:06 PM 1
Share

When you enter the trigger, it teleports you to a new transform that is inside the cave.

(The trigger is the black piece)

3 Replies

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

Answer by SterlingStudios · Jul 25, 2014 at 01:42 PM

Alright I figured it out. I edited the Alpha of the color on the Transparent Diffuse shader, which made it semi-transparent, then I took 0tucan approach and lined them up. I think it looks pretty nice now here it is:alt text

Thanks for all your help, Unity3D truly has a great community.


screenshot #2.png (245.8 kB)
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 0tacun · Jul 24, 2014 at 04:55 PM

enable fog in the render settings: http://docs.unity3d.com/Manual/class-RenderSettings.html

and adjust the fogdensity/linearFogStart/linearFogEnd values as you need them.

Another approuch would be to expand this block and texture it blackier the deeper it is.

Comment
Add comment · Show 3 · 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 SterlingStudios · Jul 24, 2014 at 04:57 PM 0
Share

First, I have the fog enabled. And I don't think that would solve my problem.

avatar image SterlingStudios · Jul 24, 2014 at 04:58 PM 0
Share

But thanks for the answer :D

avatar image Pendrokar · Jul 24, 2014 at 04:59 PM 0
Share

Visually it won't make a difference(for the now obvious transition), but I guess Otacun means that the fog would become stronger as you head deeper into the cave and once it is dark enough you switch to the cave scene.

avatar image
0

Answer by Pendrokar · Jul 24, 2014 at 05:18 PM

Assuming that the objects around the black block are GameObjects/Meshes then you could use a decal that would do the gradient transition. Otherwise make a few meshes that have the gradient texture and fit them on these meshes, though this might cause Z-fighting issues(objects randomly popping on top one another).

http://docs.unity3d.com/Manual/shader-NormalDecal.html

OR

Assuming that the objects around the black block is part of Terrain, you can use a black Terrain Texture and paint it with a soft brush on the parts that interact between the block and the terrain.

http://docs.unity3d.com/Manual/terrain-Textures.html

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 SterlingStudios · Jul 24, 2014 at 07:36 PM 0
Share

Sadly, the rocks around it are meshes. Is it possible to edit the transparency of a shader without using a texture?

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

24 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

Related Questions

Fade In _TintColor Over Time 2 Answers

Transparent Shader changing color after Ambient Light 0 Answers

Shader Edges Transparent Relative to Camera 0 Answers

Material doesn't have property '_Color' 4 Answers

Change Fog Color Smoothly 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