Giter Site home page Giter Site logo

Comments (2)

Ayfel avatar Ayfel commented on June 20, 2024

Hi, so this script allows you to set lightmaps regardless of the UVs so the code inside takes care of assigning lightmaps with the right uvs and all, so you technically can record different lightmaps in different lightmap scripts and load them independently. It is not something working out of the box but you can do it. Let me know if that makes sense. The script takes the lightmap it has reference to and loads it. So you could make different prefabs with different lighting and just use the serialized data for each to load each different lighting

from prefablightmapping.

Ardoos avatar Ardoos commented on June 20, 2024

Hi, thanks for the reply! I think I solved my problem, but I'm not sure why it works that way.
So my idea was to:

  1. Bake first lightmap, it generates Lightmap-0_comp_dir.png and Lightmap-0_comp_light.exr file.
  2. Duplicate and rename this files, change lights and generate new lightmap. That way I have 2 different lightmaps.
  3. Write simple code that is able to change m_Lightmaps and m_LightmapsDir and cal Init() again. I don't see any perfomance issues doing it that way.

I did it before opening this thread, because everything worked fine except 1 thing. Even if I didn't change anything Lightmap-0_comp_light.exr file was different than previously baked copy. Just now I found a way to solve this problem, but it's a little annoying. To resolve this issue I have to bake lighmaps before I create prefab of an object. So basically I have to unpack my prefab, perform steps 1 and 2, then create new prefab. Somehow this way generated files have exactly same layout and everything works fine. It would be nice to find out how to do this without unpacking prefab.

from prefablightmapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.