Giter Site home page Giter Site logo

Comments (8)

Ayfel avatar Ayfel commented on July 1, 2024

Something is off, I'd recommend removing the script and adding it again to the prefab and rebake

from prefablightmapping.

1ibrium avatar 1ibrium commented on July 1, 2024

Hi bro!
A value of 0xFFFE is internally used for objects that have their scale in lightmap set to 0; they affect lightmaps, but don't have a lightmap assigned themselves.

https://docs.unity3d.com/ScriptReference/Renderer-lightmapIndex.html

from prefablightmapping.

Ayfel avatar Ayfel commented on July 1, 2024

Hi bro!
A value of 0xFFFE is internally used for objects that have their scale in lightmap set to 0; they affect lightmaps, but don't have a lightmap assigned themselves.

https://docs.unity3d.com/ScriptReference/Renderer-lightmapIndex.html

I am not following, what is this in reference to?

from prefablightmapping.

1ibrium avatar 1ibrium commented on July 1, 2024

I fixed this issue by follow this reference, This issue triggered by "scale in lightmap set to 0"

from prefablightmapping.

Ayfel avatar Ayfel commented on July 1, 2024

I fixed this issue by follow this reference, This issue triggered by "scale in lightmap set to 0"

Feel free to make a pull request or give us a snipet to include : )

from prefablightmapping.

1ibrium avatar 1ibrium commented on July 1, 2024

OK, as soon as possible

from prefablightmapping.

1ibrium avatar 1ibrium commented on July 1, 2024
                if (renderer.lightmapScaleOffset != Vector4.zero)
                {
                    //1ibrium's mod : https://docs.unity3d.com/ScriptReference/Renderer-lightmapIndex.html
                    if(renderer.lightmapIndex < 0 || renderer.lightmapIndex == 0xFFFE) continue;
                    info.lightmapOffsetScale = renderer.lightmapScaleOffset;
                    Texture2D lightmap    = LightmapSettings.lightmaps[renderer.lightmapIndex].lightmapColor;
                    Texture2D lightmapDir = LightmapSettings.lightmaps[renderer.lightmapIndex].lightmapDir;
                    Texture2D shadowMask  = LightmapSettings.lightmaps[renderer.lightmapIndex].shadowMask;
                    info.lightmapIndex = lightmaps.IndexOf(lightmap);
                    if (info.lightmapIndex == -1)
                    {
                        info.lightmapIndex = lightmaps.Count;
                        lightmaps.Add(lightmap);
                        lightmapsDir.Add(lightmapDir);
                        shadowMasks.Add(shadowMask);
                    }

                    rendererInfos.Add(info);
                }

from prefablightmapping.

Ayfel avatar Ayfel commented on July 1, 2024

Thanks! I'll push it

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.