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
0
Question by HazilTheNut · Aug 23, 2017 at 10:05 PM · transparencyshader programmingmodels

How to change the transparency so that a set of objects display as one?

In a game I'm working on, multiple objects are placed next to each other that have a modifiable transparency. More specifically, I want one section of a scene to turn translucent when another is put into focus behind it.

I have a ceiling cuboid connected to a wall cuboid, but the side face of the ceiling is being rendered under the wall, creating a dark parallelogram depicted in the top image. Here is what the current problem looks like (above), and a manually corrected image of what the final effect should look like (below):

alt text

I've considered three solutions to the problem:

1) Use just one model
Create a new model that is both the ceiling, floor, and wall combined into one model. The problem itself is avoided, but creating a new model for every section of every scene would be tiresome.

2) Shader magic
Make a shader that corrects the problem. This probably requires an incredibly in-depth knowledge of shaders that I simply don't understand, and it may not even be possible.

3) ZWrite manipulation
This may be involved in solution 2, but it may also not be. A script would keep the different elements rendering properly.

Which of these solutions would be the most plausible / effective at resolving the issue, or would another solution I haven't thought of actually be best?

combined.png (355.1 kB)
Comment
Add comment · Show 1
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 Cherno · Aug 24, 2017 at 02:28 PM 0
Share

Well, a shader woule be the easiest solution I figure... If you already have some basic know-how. I kinda had to dive into that topic myself a while ago but after a few days I got the hang of it and now I am able to write custom shaders for my projects. It is a very nice set of skills to have and opens up a lot of possibilities so if you are willing to spend some time with the good amount of in-depth informationavailable online I'd say definitely go for it, you won't regret it. Unity's own shader tutorials in the User $$anonymous$$anual can be a viable starting point.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Fydar · Aug 24, 2017 at 03:00 PM

Make a shader that renders on the transparency pass that writes to the depth buffer to stop anything behind it that's transparent render. That means your transparent pass will have to be a forward render.

You could also create a script that dynamically joins the meshes together into one.

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

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

70 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 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 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

Visual Artifacts from my Custom Transparent Shader 0 Answers

Shader that renders pixel with highest alpha value? 0 Answers

Silhouette overlay shader 0 Answers

Shader to turn materials transparent based on y axis 0 Answers

Help Adding Transparency to 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