Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by straydogstrut · Mar 04, 2010 at 06:25 AM · terrainlightmapgrass

Swapping terrain lightmaps does not affect grass?

Hi all,

For our project we have a section where the sky will darken to create a moody atmosphere towards the end of our level. I've got the skybox fading between two textures and i'm controlling the intensity of our directional light, the sun. However we still had the problem of the terrain being unaffected.

Digging around i've discovered how to duplicate the terrain's lightmap and i've recalculated a darker version with the sunlight intensity lower. At the moment i've got a simple script which swaps between the two lightmaps when you press a key, but the grass decoration remains at it's current illumination. It does change to match each individual lightmap when I use them individually, but not when swapping between them.

One of the comments in this post suggests that grass and detail objects should be affected by the terrain lightmap, and even that in a realtime scenario multiple lightmaps could be used, but it's not working for me. Is it a Unity Pro only feature? We only have access to Indie at the moment.

I've also read in the docs about the 'Lightmap Factor' setting in the texture dialogue for the grass to control how much it is affected by the lightmap - what should this be set to? It's currently set at 1 but I don't know what the range is. 100 bleaches the grass to yellow.

I've heard that using multiple lightmaps in this scenario is not very efficient (although it will only be a brief transition, not a full day/night cycle) and I still have this script for blending lightmaps to try. But i'm getting the impression that it's not possible to have grass details affected by the terrain lightmap? I've read about exporting the terrain to a modelling package to lightmap the trees etc (that will be my next little adventure), but I don't see a solution with the grass.

It may be that I'll have to settle for tweaking the grass tint and/or ambient light levels to make the change less noticeable although the contrast is meant to be quite stark. I'll have to have another go when I get home later today.

If anyone has any ideas in the meantime, I would be very, very grateful.

Comment
Add comment · Show 2
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 Cyclops · Apr 30, 2010 at 01:46 AM 0
Share

@straydogstrut, remember to upvote good answers, not just checkmark one. :)

avatar image straydogstrut · Apr 30, 2010 at 10:11 AM 0
Share

Thanks for the re$$anonymous$$der=)

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by jonas-echterhoff · Mar 04, 2010 at 09:36 AM

Light maps should affect terrain details (grass, etc). However, once these details are generated, they are cached, so changing the light map will not immediately updated the detail shading.

Try calling the undocumented Terrain.Flush() method after changing the light map, to force it to regenerate the details.

Comment
Add comment · Show 3 · 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 straydogstrut · Mar 04, 2010 at 11:07 AM 0
Share

Thanks Jonas, i'll try that tonight. If it's undocumented, is there any chance of it stopping working in the future? I only ask because this is a coursework project so it kinda has to work=S

avatar image jonas-echterhoff ♦♦ · Mar 04, 2010 at 11:36 AM 0
Share

Yes, there is a certain risk, as we do not guarantee that any undocumented functions will keep working the same way in future releases. This is only relevant for web content, though, as standalone games will always run with the runtime they have been published with.

avatar image straydogstrut · Mar 06, 2010 at 03:09 AM 0
Share

Well that method works except it's slow and it doesn't export correctly to the webplayer as you mentioned. I suppose our only other option is to use detail meshes for the grass but i'll have to have a word with the $$anonymous$$m since this will increase the poly count.

Thank you very much for your help though, I really appreciate it.

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

No one has followed this question yet.

Related Questions

baked grass? lightmapping 1 Answer

How to add new baked lightmaps to lightmap array? 2 Answers

Grass not getting original texture, generating grass in a good way? and more 0 Answers

Forward rendering shadow flicker glitch (with video) 1 Answer

Can't lightmap trees! (or Character) 1 Answer


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