• 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
Question by Murad-Khafizov · Sep 06, 2017 at 07:21 AM · lightingrenderingglobal illuminationemissive

Set emission for Realtime GI separately from rendered material

Hi guys and girls!

I have indoor scene with baked Realtime GI. Also there is lightmapped emissive object(TV Screen) with "Prioritize Illumination" enabled. VideoPlayer component sets Emissive chanel of Standard Shader material from the source video. Every frame renderer updated with next line:

         RendererExtensions.UpdateGIMaterials(MyRenderer);

So everything around starts blinking like it's real TV screen. Also it matters what on the pixels of screen. So if I fill left side of screen with green and right with red, object at left side will be lighten with green and on the right with red color. Realtime area light from texture!!! Ambilight! Just look how it works:

So what is the trouble? As for me the light is too dark: Default emissive

I want to make light brighter and add brightness to HDR emissive color picker. But it makes screen overbrighten: Exposed emissive

I know that middle value could be suitable in this situation, but I have also other scenes, where it does not. Anyway I have goal now! So I tried to search for some workarounds. At first I've tried next method:

         MyRenderer.material.SetColor("_EmissionColor", brightHDRColor);
         RendererExtensions.UpdateGIMaterials(MyRenderer);
         MyRenderer.material.SetColor("_EmissionColor", defaultHDRColor);

A made that in Update(), LateUpdate() and in Coroutine but that doesn't worked. Color applied only from default color. Then I've found a way to set emissive for a renderer:

         DynamicGI.SetEmissive(MyRenderer, brightHDRColor);

Look! This way closer than anything, but there is one issue.. Setting static color

This operation statically sets GI emissive color for Renderer instead of material and shader outputs. Should work for static light sources. But I have a dynamic video with a complex realtime baked emission map: Baked emissive on static object

I'm lost and out of ideas. Does anyone know how Unity Engine works internally and is there any way to set emissive brightness for GI separately from rendering surface?

Comment

People who like this

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

Answer by Vestergaard · Sep 06, 2017 at 07:09 PM

Create a new layer called "Culled Lighting"

Create a new copy of your emissive screen with a new material that you can control brightness on separately, flag this new object with the culled lighting layer and nothing else.

On your game camera disable the "Culled Lighting" layer in your culling mask drop down.

The game camera will now cull your new lighting proxy object, but it should still contribute to real-time GI.

Comment
Kuba
Murad-Khafizov

People who like this

2 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 Murad-Khafizov · Sep 07, 2017 at 06:30 AM 0
Share

Yeah, nice way. Also, Valentin Simonov gave advice to add a meta pass to shader where indirect emissive will be overbrighten

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.

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

Follow this Question

Answers Answers and Comments

86 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image 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

Updating Global Illumination at Runtime 2 Answers

Disable all objects on a layer from recieving any light. Make object inside an object recieve lighting/ not be totaly dark? 1 Answer

Lightmap Brightness Bug in Build (Unity 5.2 and 5.1.3) 1 Answer

How to apply my custom shader to scene lightmap/light probes 2 Answers

Android not render like Editor, Windows [Screenshots] 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