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 customphase · Aug 25, 2012 at 07:01 AM · lightinglightlights

Exclude certain objects from getting lit

Hi there guys. Im trying to implement the instant radiosity technique in unity, and im having a problem. I need to make so, that each emissed photon(pointLight) wouldnt light the surface its hitting. Since i have about 300 photons(pointLights) and about 100 object in the scene its impossible to use Culling Mask on lights, i just wont have enough layers to cover all the objects. So, is it possible to exclude the one object (not layer) from being affected by light? And if possible, how can i do this?

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

Answer by Bunny83 · Aug 26, 2012 at 04:25 AM

No, afaik there's no way to implement this. That's nothing you can do on shader level since it's different per object in your case.

Your question title is a bit confusing since it asks for the opposite. You asked to exclude "certain objects" from being lit, but you actually want exclude a certain light (per object). Lighting happens the other way round. The object is drawn and all lights that are in range are taken into account inside the shader. Maybe there's a way to write a custom shader and intercept a given light "position", but i've never done something like that :)

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 customphase · Aug 26, 2012 at 04:33 AM 0
Share

I guess it makes sense in both ways :) I was talking about something, like in 3d max - there is a button in the light properties, which opens the menu, where you can exclude objects from getting lit. The thing about shaders: i dont know anything about shaders, and i find this kinda difficult for me to understand how they work, and coding it into every shader i use is a lil bit too much work. I found this thread in forums http://forum.unity3d.com/threads/12752-having-a-light-only-affect-one-object. when they have similar to my problem, but opposite. And there the unity developer said that theres no way to implement it, besides coding the shader. Thats upsetting.

avatar image Bunny83 · Aug 26, 2012 at 11:03 AM 0
Share

$$anonymous$$aybe you could use OnWillRenderObject in a script attached to each object and disable the "own" light. However, i'm not sure if there's a way to enable the lights right after the object has been rendered. Also i never tried something like that with OnWillRenderObject. $$anonymous$$aybe batching could interfere with it as well.

avatar image
0

Answer by flokkienathur · Aug 25, 2012 at 06:01 PM

Well if you use the selfillumative (i think it calles :x) shader it does not get lit. But that is sometimes a little annoying if you are using a custom shader.
Hope it helps

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 customphase · Aug 26, 2012 at 04:10 AM 0
Share

This is not what i exactly need. I need the object to be affected by all the lights as usual, except those light, that lie on his surface. I guess you cant do that with selfillu$$anonymous$$ative shader. But thanks for the answer.

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

9 People are following this question.

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

Related Questions

The light is not blending 0 Answers

Prefab asset lights differently in different scenes 0 Answers

How can I make lighting in scene shine at every part of objects 0 Answers

URP Point light range doesn't increase light range? 2 Answers

Change fade distance of shadows on pointlight through script in HDPR 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