Comments (2)
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.
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:
- Bake first lightmap, it generates Lightmap-0_comp_dir.png and Lightmap-0_comp_light.exr file.
- Duplicate and rename this files, change lights and generate new lightmap. That way I have 2 different lightmaps.
- 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)
- Baking lightmaps break decals until affected materials are Reimported. HOT 2
- Clarification of Light Probes HOT 4
- Light probes in Interior scenes HOT 1
- Baking lightning on a prefab overwrite other prefabs lightmaps HOT 2
- URP AssetBundle lighting corrupted HOT 5
- "IndexOutOfRangeException: Index was outside the bounds of the array." on MaterialPostprocessor. HOT 5
- As I bake new prefab the old lightmaps gets deleted even they are moved in separate folder
- About Android HOT 2
- Baked lighting is broken upon instantiating from Asset Bundle HOT 25
- Baked light probes
- Baked lighting doesn't work in the build version if Screen Space Shadows is enabled
- Lightmap breaks in the build on a single prefab HOT 1
- lightmaps in the build aren't mapped correctly HOT 2
- Not working on unity 2022.2.13 HOT 4
- I try to bake but it has already taken about 4 and half hours HOT 1
- Transparency in Build HOT 13
- Trying to set shader on a Material Variant HOT 3
- Lightmaps Too Bright on Android Bundle HOT 2
- Incorrect light maps being assigned on instantiation HOT 2
- Prefab only baking/loading one light HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prefablightmapping.