godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.68k stars 20.11k forks source link

GIProbe indirect lighting on GridMaps not working #18836

Open DevMagicLord opened 6 years ago

DevMagicLord commented 6 years ago

Godot 3.0.2 Win 7 64 bits GeForce 960

Hi there,

I made a scene with an emissive material and Global Illumination, but lighting only throw on floor, but walls don't receive any bounces lighting.

https://github.com/DevMagicLord/Godot3/blob/master/bugs/Giprobeissue.jpg

While materials without normal map and roughness map receives all indirect lighting.

https://github.com/DevMagicLord/Godot3/blob/master/bugs/giprobeissue2.jpg

Materials with normal map and roughness, metallic maps, needs to receive lighting bounces.

Calinou commented 6 years ago

Does your scene use procedural meshes such as CubeMesh inside a MeshInstance? From my testing, GIProbe bakes won't affect them.

DevMagicLord commented 6 years ago

No, it's imported cubes as .obj files, they are used in a Meshlib for 3D Gridmaps. This means Gridmaps are not good for GiProbe ?

groud commented 6 years ago

Probably related to #18056

DevMagicLord commented 6 years ago

I found GiProbe baking works well on standard objects, and emissive objects must also have the flag "used in baked lighting" to true.

But imported 3D tiles with "used in baked lighting" to true and saved as meshlib, baking the Giprobe doesn't bake well on Gridmaps, it's very dark.

On center this is gridmap while others are objects. https://github.com/DevMagicLord/Godot3/blob/master/bugs/giprobeGridmapsbaking.jpg?raw=true

The issue is about gridmaps.

EzraT commented 6 years ago

This happens to me too with Godot 3.0.6 on Linux. There is a very clear difference to how GIProbe looks on regular MeshInstance nodes, compared to how it looks on a Gridmap.

reduz commented 5 years ago

Sorry, without a test scene, figuring out what is going on is impossible. Closing.

EzraT commented 5 years ago

@reduz Reproduction Project Details: https://github.com/godotengine/godot/issues/18056#issuecomment-439538543

EzraT commented 5 years ago

Could this one be added to the 3.1 milestone?

reduz commented 5 years ago

Actually, it seems to be working, but the emission channel is not strong enough. Lights can compensate this because they have a bake energy value but materials don't. I promise to add this after 3.1 is out, as I will be doing some rewriting to the GIProbe code.

KoBeWi commented 3 years ago

Still valid in 3.2.4 beta3 Can't test on master, because GridMap doesn't work (incompatible meshlib?)

SoloCodeNet commented 3 years ago

Gi PRobe not working on voxel based model, no texture on the mesh just magica voxel import tested with meshinstance directly work fine, add gridmap with same model (left and right) and re-bake capture : https://ibb.co/pJ8D9Z8

Calinou commented 2 years ago

This appears to be fixed in master according to my tests in https://github.com/godotengine/godot/issues/56030.

EzraT commented 2 years ago

Issue still present in 3.5.beta3.

EzraT commented 2 years ago

I did some more testing, and I found something that could hopefully shed some more light on this problem.

To clarify again, this is what the scene in the MRP looks like when using just meshinstances for the hallways: image

Now here's what the same meshes look like in a gridmap, using the exact same settings in the GIProbe: image

The GIProbe Energy is turned to 16 in both scenes to demonstrate the problem better.

What I discovered is this: When I turn down the Bias property on the GIProbe node to zero in the scene with only MeshInstances, things start to look very similar to the GridMap scene: image

Changing the Bias value in the Gridmap scene also does not result in any different visuals.

Could it be that GIProbe is not correctly applying the Bias value to gridmaps?

Calinou commented 2 years ago

@ezrat Thanks for checking this issue :slightly_smiling_face:

Can you reproduce this with a MultiMeshInstance? GridMap uses MultiMesh behind the scenes for rendering.

EzraT commented 2 years ago

@Calinou Check #45313 As far as I'm aware MultiMeshInstances in Godot 3 do not affect GIProbe, as the issue says. Happy to help!