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 Aniaas · Sep 30, 2014 at 03:26 PM · lightingshadowslightmap

Lighting on a room-by room basis

Ok, I've been wandering about looking for something that meets my need, but I can't find it so here goes:

I currently have a setup of modular rooms. Each room is it's own mesh and contains lights which must be able to be toggled on and off using that room's light switch. The problem I encounter is running the lights is that I need the light to only light the room that they are in.

There are many solutions I've seen but I can't seem to make them work for my setup, so I'll rattle off what I've tried:

Shadows: If I set the lights to cast shadows, yes, it solves this problem, but it takes a hefty toll on my fps. If there were a way of turning lights off when you can't see their illumination, that would probably work, but I can't find a decent way of doing that

Layers: Unfeasible due to the number of layers I'd need to use. Even if I'm clever and set rooms whose lights don't touch to the same layer, I'm still using a great many layers, possibly more than the engine allows

Lightmaps: If I just had on/off lighting maps for each room, and the ability to switch between them, that could also work, though it would be least preferred as it would still require dynamic lights to illuminate moving objects. Problem is lightmaps are applied per scene, and I'd need a method to combine light maps, or I'd have to make a lightmap for every possible combination of rooms being lit/unlit, and that's just dumb.

So there we have it, if you can solve my problems with any of these methods, or even point me at something else that would work, I'd be very grateful. Thanks,

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by yekush · Sep 30, 2014 at 06:08 PM

If each room is a gameobject in the Hierarchy, and the Lights are children of that room, you could write a simple script that checks the parent of the switch, and toggles its light siblings

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 Aniaas · Sep 30, 2014 at 07:32 PM 0
Share

I'm sorry, but I don't think you understood my question, I'm not asking how to create a light switch, what I need is to prevent lights in one room lighting things up through walls, but just having shadows on everything is too expensive and there are too many rooms for layers

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How to add shadows in Game Environment 1 Answer

Shadowmask shadows not showing 0 Answers

Lightmaps and inspector view different lighting 0 Answers

Shadows and ambient occlusion post processing don't work... until I click on the shader 1 Answer

Skybox Tenkoku is not lighting properly 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