Jump to content

Baked lightmaps for proxy meshes on SECTR Chunk component


lucasbender
Go to solution Solved by lucasbender,

Recommended Posts

Hi!

 

Is it possible to bake lightmaps for proxy meshes? I'm using different sectors in my game and the "Lightmap all sectors" feature worked fine on the main objects, but the proxy meshes still without light data.

 

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Yes, it is possible to bake proxy meshes in Unity. Proxy meshes are simplified versions of high-poly models that are used in place of the high-poly models in order to improve performance.

To bake proxy meshes in Unity, you can use the "Generate Lightmap UVs" feature, which creates a new set of UV coordinates for the mesh that is optimized for lightmapping. This can be done by selecting the mesh in the Project window, opening the Import Settings in the Inspector window, and then enabling the "Generate Lightmap UVs" option.

After generating the lightmap UVs, you can then create a lower-poly version of the mesh using a 3D modeling tool or a plugin such as Simplygon or Mesh Simplify. Once you have the simplified mesh, you can replace the high-poly mesh with the simplified mesh in the scene.

You can then bake lighting and other effects onto the proxy mesh using Unity's lightmapping tools. This will improve performance and help to ensure that your scene runs smoothly on a variety of devices.

Link to comment
Share on other sites

Hello Bryan, thank you very much for your response!

The proxy mesh I'm referring to is the Sectr Chunk component field. Currently, it references a mesh directly, which is inside an fbx, as shown in the first image. This way it is not possible to add any more data to it, not even light, since it references only one mesh.

spacer.png

The “Lightmap all sectrs” button works very well with the main Sectrs. But as the instance of this specific mesh appears only at runtime, the lightmap bake does not interact correctly with the mesh instantiated on that slot. If I add the Proxy Mesh directly to the scene to bake the lights, there will be mesh overlap, causing lighting issues.

I also add another images, showing the difference in light between the Sectr with calculated light and the Proxy mesh. Notice that this proxy mesh that I am using is an unique mesh created in Blender, with the “Generate lightmap UVs” option turned on.

spacer.png

RNuLD.jpg

Would you know any way to have the light calculated also on this Proxy Mesh, so that there is no major differences in light between the main Sectr and the proxy?

Thanks again for your attention!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
On 3/6/2023 at 9:12 AM, lucasbender said:

Hi guys! Any solution here? 😁

Sorry for the really late response. 
I will take a look into this and see what I can find! 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • Solution

Hey!

Thanks for your time, @Bryan. I found a solution that worked for now.

I'm following these steps to "bake" a lightmap directly on the material via custom shader. I created a copy of my scene, deleted all the sectr stuff and just add the proxies, using the same lights as the original scene. So I baked the scene, ran the script described on the link above to change UV2 on the FBX (with the "Read/write" option enabled), export the FBX to keep the new UV2 as default, and linked this new mesh to the component.

Honestly, it's a bit boring, but it worked for now. I strongly suggest keeping something like that in mind for future Sectr updates!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...