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 dyankov · Nov 27, 2013 at 01:06 PM · shaderlightingmaya

How does Unity apply a lightmap?

Hi,

I'm trying to bake my own lightmaps in Maya, partly because I want more control and partly because I can't afford Unity Pro. So I baked a lightmap with just "Illumination" as a render pass:

alt text

So I wrote a simple surface shader which blends two textures together and applies the result to the Emission property of the material. The problem is, I can't figure out how to properly blend the lightmap with the object's color:

  • I tried using multiply - the shadows are correct, but the highlights are washed out

  • Using screen - Way too much light and no shadows

So how does Unity do it? Or is there an easier way to tell Unity "apply this texture to this object as a lightmap"?

Thanks!

[SOLVED] RESULT Read my comment from the accepted answer for more details. Here is a screenshot from Unity with the lightmap correctly applied. The advantages of using this method is that I can completely customize the look of my scene with area lights/shadows, advanced GI and AO settings and more.

alt text

test.jpg (189.6 kB)
lightmap-maya.jpg (168.9 kB)
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
1
Best Answer

Answer by MaT227 · Nov 27, 2013 at 01:33 PM

I think that you need to write your own Lighting function as explained here.
There is a built-in legacy shader that authorize manual lightmaps. Maybe you could look at the source of this shader.

You can also replace the lightmaps in the lightmap panel by your own like explained here.

Here are other good resources:
A Truly Lightmap Shader
Vray lightmapping workflow in 3dsmax
Using externally baked lightmaps in Unity 3.5

Comment
Add comment · Show 5 · 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 dyankov · Nov 27, 2013 at 02:11 PM 1
Share

Found the answer in the third link, thanks! I also had to render the lightmaps as EXR files and select Lightmap from the import settings.

avatar image MaT227 · Nov 27, 2013 at 02:14 PM 0
Share

Glad to help ! There are different ways to achieve what you want. Don't forget to validate the answer. ;)

Edit: Good looking results !

avatar image dyankov · Nov 27, 2013 at 02:16 PM 0
Share

Yup, forgot to do that. I updated my question with the final result.

avatar image LEEjc · Mar 28, 2015 at 07:59 AM 0
Share

wihtout lightmap shader?

avatar image LEEjc · Mar 28, 2015 at 04:39 PM 0
Share

Hi,i still can't figure out this...i already render the exr files but it is not working....can you help ? Thank you!

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

18 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

Related Questions

Unity fails to recognize Maya models/Unity scenes 1 Answer

Alpha Transparency Shader Issue 1 Answer

How to approximate this surface with primitives? 1 Answer

Maya to Unity Glossy Shader Problem 1 Answer

How to implement shader 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