Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple atlases to the CPU lightmapper (already implemented in 3.x) #2147

Closed
Tracked by #56080
NHodgesVFX opened this issue Jan 18, 2021 · 9 comments

Comments

@NHodgesVFX
Copy link

NHodgesVFX commented Jan 18, 2021

Describe the project you are working on

Playing with the new lightmapper

Describe the problem or limitation you are having in your project

With large levels you cannot fit all objects on a single atlas this means you need to have 1 lightmap per object. in the tps demo this is over 1000 textures.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It would be great if when atlas is enabled it would put as many textures in an atlas a possible then roll over to a new atlass texture once it can not fit anymore in the current one. This way you can have maybe 20 4k textures instead 1000s of small textures.

I think 20 4k textures would be more efficient than 1000 smaller textures but if they have equal efficiency then this proposal isn't as important.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I described a bit how it should work above. I think this is always desirable so it should be always on. It could be made to be an option though

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

Lightmapper is in core, as this is an enhancement to the lightmapper it would also need to be in core

@YuriSizov YuriSizov changed the title 3.2.4+ Lightmapper Mutiple Atlases Add support for multiple atlases to the new CPU Lightmapper Jan 18, 2021
@JFonS
Copy link

JFonS commented Jan 23, 2021

It should be doable, yes. I will take a look at it when I'm done with the more pressing issues :)

@Koalamana9
Copy link

It would be great if when atlas is enabled it would put as many textures in an atlas a possible then roll over to a new atlass texture once it can not fit anymore in the current one. This way you can have maybe 20 4k textures instead 1000s of small textures.

This is exactly what I was hoping to see in new lightmaper in 3.3, unfortunately the way it currently works is kind of useless for actual projects with relatively large interior scenes. I understand that this approach is more complex but in the end this is the only correct way to do this.

@Calinou
Copy link
Member

Calinou commented Apr 24, 2021

@KoxaKoxama To optimize frustum culling opportunities, you need to split the level into several meshes anyway. If your entire level is a single mesh, the level will always be rendered in full.

Splitting each room into its own mesh is usually a good way to proceed for interior levels. For large open world scenes, you can split with a grid-based approach.

@JFonS
Copy link

JFonS commented Apr 26, 2021

Allowing for multiple atlases would be nice, and I added it to my backlog, but it's not very high priority, so I won't be working on it in the near future. If anyone wants to give it a go, I'm happy to give pointers on what needs to be changed and where :)

In the meantime, remember that you can have multiple lightmaps in the same scene, so big scenes with multiple rooms can have one lightmap per room. Splitting big meshes into smaller ones also helps as @Calinou mentioned, and you
can also reduce the lightmap resolution to fit more objects in the atlas. Remember that you can use the "Lightmap Scale" property to give more resolution to specific objects that need it.

All in all, I think this is a good feature to have, just not high priority right now.

@Calinou Calinou changed the title Add support for multiple atlases to the new CPU Lightmapper Add support for multiple atlases to the CPU lightmapper Sep 29, 2021
@Koalamana9
Copy link

Any progress on multiple atlases?

@Calinou
Copy link
Member

Calinou commented Nov 8, 2021

Any progress on multiple atlases?

As far as I know, nobody has started on working on multiple atlas support yet. JFonS is currently busy with other tasks, so it's not likely to happen for 3.5.

@JFonS
Copy link

JFonS commented Feb 14, 2022

Here is the PR for this proposal: godotengine/godot#58102

I haven't tested it thoroughly, so any testing is welcome.

@Calinou Calinou added this to the 4.0 milestone Feb 15, 2022
@Calinou
Copy link
Member

Calinou commented Feb 15, 2022

This is now implemented by godotengine/godot#58102 in 3.x (will be in 3.5beta2). I'll leave this proposal open as this feature should also be forward-ported to master.

@Calinou Calinou changed the title Add support for multiple atlases to the CPU lightmapper Add support for multiple atlases to the CPU lightmapper (already implemented in 3.x) May 10, 2022
@YuriSizov YuriSizov moved this to In Discussion in Godot Proposal Metaverse Jun 29, 2022
@YuriSizov YuriSizov moved this from In Discussion to Ready for Implementation in Godot Proposal Metaverse Jun 29, 2022
@fire
Copy link
Member

fire commented Jul 30, 2022

Forward ported to master by godotengine/godot#61861.

@fire fire closed this as completed Jul 30, 2022
Repository owner moved this from Ready for Implementation to Implemented in Godot Proposal Metaverse Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implemented
Development

No branches or pull requests

6 participants