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 Grimmy · Oct 15, 2010 at 12:52 PM · lightsvisible

How do I make a mesh visible only under a certain light?

Ie for UV/infrared lights.

I already know how to get a particular mesh to be affected only by a specific light, but this can't affect its visibility (just how much it reflects the light).

Basically- I want its visibility (alpha) to change, depending on how much light(from a specific source) it has recieved.

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
1

Answer by AlbeyAmakiir · Nov 02, 2010 at 05:50 AM

I'm fairly new to Unity, so I don't know if this is possible, but could you perhaps render once without the UV light, then make the object visible and render again, this time only using the UV light, and overlay the second image on the first?

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 Grumblekeen · Oct 15, 2010 at 12:55 PM

I'm sure there is a neat technical way to do this, but I'd just fake it with some triggers.

If you want an object to appear near certain lights, fade it in when it is near them and out when it isn't.

If you want the player to see them when wearing goggles or something, that's even easier. You can just flip them visible when he/she activates the item.

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 Grimmy · Oct 15, 2010 at 01:00 PM 0
Share

Its slightly more complicated than that. Imagine a first person game where the player moves a infrared torch around the room. Anything within that beam of light needs to show up.

In saying that, I could fake it with a long collision box which encompases the light beam and anything in the box alphas in?

Sound good enough?

avatar image Grumblekeen · Oct 15, 2010 at 08:37 PM 0
Share

That should work.

$$anonymous$$y first thought was to cast a ray (or four) from your light source every half second or so (no need to do this every frame), and make anything it collides with visible, and anything it doesn't invisible.

http://unity3d.com/support/documentation/ScriptReference/Physics.Raycast.html

You might try both and see which works better in practice. I can see potential problems with the ray cast idea, such as smaller items popping in and out because they just happen to dodge rays, etc.

avatar image
0

Answer by Matthew Crawford · Dec 09, 2010 at 07:48 PM

You can look at a specular shader for an example. Instead of increasing or decreasing reflection strength, you can increase or decrease alpha strength. You would have to make a map for it, depending on what you want the player to see, weather you want to view the object as a colored heat signature or just as a regular diffuse looking textured object.

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

No one has followed this question yet.

Related Questions

How to make always visible(rendering) weapons in FPS? 2 Answers

Making a Game object appear and dissapear 3 Answers

i need script c# scrollview object hide/unhide 0 Answers

EditorWindow is visible 2 Answers

3D Text visible from/in x distance/place 0 Answers


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