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 easilyBaffled · May 22, 2012 at 04:12 AM · shaderinvisibleoutline

Invisible block, Visible outline

The question of the hour is: How to make a transparent block with a visible outline? I am trying to make a platform who's outline is visible and it can't be stepped on. upon flipping a switch the block becomes solid. How can I make it invisible, but still have an out line? I've seen some solutions using shaders, but I have absolutely no clue how to manipulate that code. Or how I could turn it off when hitting a button. Any ideas?

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
3
Best Answer

Answer by Lo0NuhtiK · May 22, 2012 at 11:37 AM

A quick way be to just make a 32x32 image with a transparent background and a thin border (2px on mine) around the edges. Then make a material (transparent diffuse shader) and use that image for the texture. Then your box is transparent with a border. When looking 'through' the box, you won't see the other sides border's. Only see the borders on the outside of the box.

Comment
Add comment · Show 12 · 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 easilyBaffled · May 22, 2012 at 10:25 PM 0
Share

I tried making a texture in photoshop, the top layer being a dotted line for the outline, then the 2nd layer behind that had 0% fill. I added it to a transparent diffuse shader but the box still had a white fill on the face facing the camera, then a semi transparent for all the others, I can see inside the cube but I can't see through the cube. Any thoughts on that?

avatar image Lo0NuhtiK · May 22, 2012 at 11:38 PM 0
Share

Don't know. Worked fine for me.

avatar image easilyBaffled · May 22, 2012 at 11:50 PM 0
Share

How did you make the initial image?

avatar image Lo0NuhtiK · May 22, 2012 at 11:51 PM 0
Share

Used GI$$anonymous$$P, made a 32x32 image with transparent background, then lined the edges with 2px color border. Exported as .png .

avatar image easilyBaffled · May 22, 2012 at 11:59 PM 0
Share

So is it on 2 Layers or one?

Show more comments
avatar image
0

Answer by kirpigiller · May 22, 2012 at 03:05 PM

You can try to use Alpha mask. For example, render your mesh with ColorMask A and Blend One Zero, then render the same but slightly scaled with ColorMask RGB(A) and Blend DstAlpha OneMinusDstAlpha.

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 easilyBaffled · May 22, 2012 at 10:27 PM 0
Share

Based on the number of things in here that I didn't understand, it sounds like it could work. I'm going to assume this has to deal with writing a shader script, as of yet I have no clue how to do that, I am looking that up now. And not that I want to be spoon fed, but, could you please provide a slightly dumbed down example?

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

"invisible" shader that affects soft particles? 0 Answers

"double" outline shader? 0 Answers

How can I control a shader's colormask with a texture? 1 Answer

Set Color not working on Outline 0 Answers

Outline shader being shown only in the material editor 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