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

Influence of Energy parameter from BakedLightmap on illumination of dynamic objects #1952

Closed
dedm0zaj opened this issue Dec 8, 2020 · 8 comments
Milestone

Comments

@dedm0zaj
Copy link

dedm0zaj commented Dec 8, 2020

Describe the project you are working on

I'm making a game with baked light locations. The game has a change of day and night. Godot 3.2.3.

Describe the problem or limitation you are having in your project

To change the illumination of the baked location, I use the Energy parameter from the BakedLightmap. But this parameter does not affect the baked volumetric light (light mass) and does not affect the illumination of dynamic objects.

image
image

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

I suggest adding the effect of the Energy parameter to the volumetric light.

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

Add influence to the volumetric light here (baked_lightmap.cpp):

void BakedLightmapData::set_energy(float p_energy) {
	energy = p_energy;
	VS::get_singleton()->lightmap_capture_set_energy(baked_light, energy);
}

P.S. In fact, I did not fully understand the code and did not understand in which variable the volumetric light is stored. If you can tell me where the volumetric light is stored in the code, I'll do it myself. I found the "Vector bake_cells" variable (voxel_light_baker.h), but I don't understand how it works. And is it the correct variable.

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

No. These suggestions cannot be circumvented with a few lines of script.

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

This proposal should be included in the core as it is part of the rendering.

@Calinou
Copy link
Member

Calinou commented Dec 8, 2020

If you manage to do it, feel free to open a pull request for this 🙂

You'll have to open the pull request against the 3.2 branch since the master branch uses an entirely different lightmapper.

Also, you might want to check out the new CPU lightmapper which may be merged for 3.2.4.

@dedm0zaj
Copy link
Author

dedm0zaj commented Dec 8, 2020

@Calinou If it works out, I'll definitely post it.
Can you tell me about my question? Under what variable is the volumetric light stored in the code?

@Calinou
Copy link
Member

Calinou commented Dec 8, 2020

Can you tell me about my question? Under what variable is the volumetric light stored in the code?

I don't know, I've never worked on the lightmapper. @JFonS might be able to answer, but I'm not sure how much he's looked at the old lightmapper code.

@dedm0zaj
Copy link
Author

@JFonS I still can't find where the volumetric light data is stored. Can you tell me?

@JFonS
Copy link

JFonS commented Dec 11, 2020

@dedm0zaj It is stored as an octree in BakedLightmapData, you can check scene/3d/baked_lightmap.h and scene/3d/baked_lightmap.cpp to find it. This data is then applied in the visual server via RasterizerStorage::lightmap_capture_set_octree.

@dedm0zaj
Copy link
Author

Decision godotengine/godot#44458

@dedm0zaj dedm0zaj reopened this Dec 17, 2020
@akien-mga
Copy link
Member

The proposal should be closed if/when the implementation is approved and merged.

@akien-mga
Copy link
Member

Fixed by godotengine/godot#44458.

@akien-mga akien-mga added this to the 3.2 milestone Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants