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 Pure Phase · Apr 21, 2010 at 02:15 PM · shadertexturelightmapcinema4d

How to lightmap without disturbing texture

Hi,

This is my first project so I'm on a bit of a learning curve.

I have a large number of objects that use the same shader. However, to make them look different I have been changing the size and position of the texture on the geometry in cinema 4d. This worked fine as I would import the fbx into unity and use the combine children script to combine the objects, but the textures on them stayed in the same place (I was using a cubic texturing, not UVs)

However, I need to lightmap these objects as I use a lot of lights and unity cannot run the game. I know how to create a lightmap and tile a texture in unity - this is ok for some things but for others it doesn't look right. I also know that I could bake the lightmap with the textures on in c4d, but the textures look really pixellated.

Is there not a way I can keep the texturing of the objects like in the first instance, but also apply a lightmap to them?

I am very thankful for your help :)

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
2

Answer by duck · Apr 21, 2010 at 02:52 PM

Yes there is. You need to create the lightmap coordinates in a second UV channel. This allows you to preserve your normal colour texturing and UV coordinates.

I haven't done this in cinema 4d (only in max), however I would guess that the concepts are broadly the same. It's also a fairly large topic, so I'm just going to breeze through the general idea quickly.

For instance, you might have lots of brick walls in your scene which each use a brick texture repeated many times. You also have some houses, which use a different texture.

These textures can be modified using a lightmap shader, which essentially darkens or lightens the colour texture based on the appropriate area from the lightmap texture.

You could lightmap this whole scene using one large lightmap texture, which is applied to all the objects, but it is applied in a different texture layer and uses the 2nd layer of UVs to determine which part of the lightmap texture should be used for each surface. So, regardless of whether your objects are using the brick texture or house texture in channel 1, they both use the lightmap texture in channel 2, and each surface maps to a different unique area within the lightmap.

In max, in the UV Unwrap modifier, there's an "automatic unwrap" tool, which basically takes every face on your model, and maps it to a unique area with the UV range. So you'd use this to make sure that every face of every part of your scene is mapped to some unique area of the lightmap texture, in the second UV layer.

So you can see that while your brick walls might use a fairly high-res tiled brick texture in channel 1, they will also use a completely different mapping to particular areas of the lightmap texture, at a comparitively low-res, and not tiled at all.

You can then use your 3d app's "bake texture" equivalent to bake the lighting into a texture, but make sure you tell it to use the UV2 layer, so that it bakes all the lighting onto the single lightmap texture - not using the colour texture layer!. You should end up with something that looks like a patchwork black and white jigsaw puzzle of all the shapes that make up your scene spread around one large texture.

You then need to export your scene to Unity, assign Lightmap shaders to your materials, and assign the single large lightmap texture to the appropriate texture slot in each material.

Comment
Add comment · Show 2 · 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 Pure Phase · Apr 21, 2010 at 05:31 PM 0
Share

Hi thanks for your message.

I think I understand this now, however I have looked on the forum and there seems to be a problem with creating 2 UV layers in cinema 4d. I'm not sure as yet if it is possible to do this or not, if anyone could point me in the right direction I would be very grateful. However, I will start to look into it.

Thanks again for your answer

avatar image Recluse · Jun 28, 2011 at 04:52 PM 1
Share

I don't know if it's possible in Cinema 4D, but you can do it in Blender 2.49, which is free. However, the learning curve for Blender's interface is pretty steep...

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

1 Person is following this question.

avatar image

Related Questions

[Unity3] How can I fix this shader 'texture' syntax error under 3.0? 1 Answer

How can i get mixed texture from one shader and set it for another object with another shader? 0 Answers

Change between 2 textures based on a variable 1 Answer

Rendering a G-Buffer for a cubemap 0 Answers

Blending normal texture and texture made with 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