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 CaffeinConverter · Oct 04, 2012 at 05:15 PM · 2dlight

How to restrict directional light to a band?

Hi to All,

Is is possible to restrict directional light to a band? Some gameobjects are lighted based on their position, some are not? (out of area) I am using ortho camera

Thx for answers

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

Answer by Screenhog · Oct 04, 2012 at 05:16 PM

Not without using shadows.

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 Eric5h5 · Oct 04, 2012 at 05:19 PM

You could potentially use a light cookie.

Comment
Add comment · Show 6 · 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 CaffeinConverter · Oct 05, 2012 at 01:30 PM 0
Share

Thx, I tried to understand what is it, but surely my lighting and 3D skills are very basic.

Can I apply this for multiple objects? I mean I would like to say 10 gameObject to be lighted by a Directional_Light_1, and other 10 gameObject to be lighted by a Directional_Light_2.

If this is can not possible with Directional Light is there any method which has similar effect? The object group one is within 30 unit in X and Y, camera looks to Z, light direction also Z, and the other group has 100 unit far in direction X. (with other camera and light) I do not want to summed the lights when both lights are on, with other words I do not want to lit group1 with light 2 and group2 with light 1

(In reality I have 5 groups :-)

Thx for answers

avatar image Screenhog · Oct 05, 2012 at 03:19 PM 0
Share

Ohh... well now, that's easier. If you put 10 objects onto one layer, and 10 objects onto a different layer, you can tell a directional light to only light up a specific layer.

Note, though, that the number of layers is limited. This technique definitely won't work if you want more than 32 layers (and, since some layers are reserved, you really shouldn't use it for more than about 20). For 5 layers of objects, it will work fine.

avatar image Muuskii · Oct 05, 2012 at 03:48 PM 0
Share

But don't you then have to detect when objects enter/leave the area of effect and make them change layers?

And how would this technique work on the floor, which would probably exist in both areas.

avatar image Screenhog · Oct 05, 2012 at 04:15 PM 0
Share

This technique wouldn't work on the floor, but yes, as long as you had a way to detect when objects entered/left an area, you could make them change layers and the light on them would change.

avatar image Muuskii · Oct 05, 2012 at 04:42 PM 0
Share

Eww, in that case wouldn't they be flipping from fully lit to full darkness? Admittedly you could gradient the change but it unfortunately doesn't give the "cut in half" effect that using a light cookie could potentially help with.

I think Eric's idea is the solution.

Show more comments

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

12 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

Related Questions

2D Animation does not start 1 Answer

2d Lighting - Weird light triangles 0 Answers

2D. Point light not working on Android 0 Answers

I can't use 2D lights 2 Answers

Light of Sight - 2D Dynamic Lighting (Field of View) 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