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

GI Probe Broken when using procedural meshes #35200

Open
DEF7 opened this issue Jan 16, 2020 · 11 comments
Open

GI Probe Broken when using procedural meshes #35200

DEF7 opened this issue Jan 16, 2020 · 11 comments

Comments

@DEF7
Copy link

DEF7 commented Jan 16, 2020

Godot version:
3.2b5

OS/device including version:
Windoze 10 / Ryzen 5 2600 / RX 5700 XT

Issue description:
GI probe is not properly calculating lighting for surfaces from an omni-light source (perhaps others, I've only tested the OmniLight) and is dependent on the orientation of the GI probe. It appears that the GI probe is baking incorrectly, causing lighting to be calculated wrong for the GI volume.

brokengiprobe

Note that only half of the ceiling and the opposite half of the floor have light in the reflections of the sphere and capsule in this GIF as I move the light left/right: https://imgur.com/a/akCR71U

If I rotate the GI probe 45 degrees and re-bake then the issue occurs but at a 45-degree angle on the ceiling/floor, so it would appear to be specific to the GI probe baking. I'm surprised nobody has even noticed this because I first noticed it with beta 4 and just downloaded beta 5 to see if it was fixed yet.

The surfaces also appear to be depicting the incorrect GI probe lighting back onto themselves in tandem with the illumination from the OmniLight source, but this behavior seems normal - just not the lighting being gathered from the GI Probe itself.

Steps to reproduce:
Create GLES3 project, make a room out of cube MeshInstances with basic SpatialMaterials for walls/ceiling to have unique albedo color, set the MeshInstances to be used in baked lighting, create sphere MeshInstance with full metalic and zero roughness SpatialMaterial, add OmniLight, create GI probe encompassing entire room and bake, observe wrong room lighting reflected in sphere.

Minimal reproduction project:
Project is attached. Open the Spatial.tscn scene in the project and select the OmniLight, move it left/right and observe the incorrect ceiling/floor lighting reflecting in the sphere.
BrokenGIProbeReflections.zip

@DEF7
Copy link
Author

DEF7 commented Jan 16, 2020

This problem also exists in v3.1. I am thinking maybe it has something to do with the fact that the room was built out of cube meshes produced by Godot.

@Calinou
Copy link
Member

Calinou commented Jan 17, 2020

@DEF7 I've always had issues with procedural meshes when baking GIProbe or BakedLightmap. I don't know how this can be fixed. Try creating the scene in Blender instead.

@Calinou Calinou changed the title GI Probe Broken GI Probe Broken when using procedural meshes Jan 17, 2020
@clayjohn
Copy link
Member

clayjohn commented Jan 17, 2020

Looks like the issue has to do with the interaction between the omnilight and the GIProbe. Notice that the problem moves around as you move the light around.

edit: I've figured out what needs to change in order to fix this. Just need to make sure I'm not inadvertently breaking anything else

Screenshot (35)

@clayjohn clayjohn self-assigned this Jan 17, 2020
@DEF7
Copy link
Author

DEF7 commented Jan 20, 2020

Great!

@wacyym
Copy link

wacyym commented Aug 18, 2022

This problem appears only if ROTATION applied for meshes which "use in baked light".
Examples:
no rotation
rotated

You can check it in this project:
FixedGIProbeReflections.zip

  1. Rotate "Room" mesh in Y axis by 90 degrees
  2. Bake GI Probe
  3. See weird result

@DEF7
Copy link
Author

DEF7 commented Aug 18, 2022

This problem appears only if ROTATION applied for meshes which "use in baked light".

Good catch! Is this still happening in current builds?

@wacyym
Copy link

wacyym commented Aug 18, 2022

This problem appears only if ROTATION applied for meshes which "use in baked light".

Good catch! Is this still happening in current builds?

Yes, i use Godot_v3.5-stable_win64

@Calinou
Copy link
Member

Calinou commented Aug 18, 2022

It might be worth checking whether this issue occurs in 4.0.alpha14 (with the exact same test scene).

@wacyym
Copy link

wacyym commented Aug 18, 2022

Its seems the issue occurs in 4.0.alpha14, but in some different situations.
For some reason i will able to catch this only for room node (BLUE color), while room is rotated on Y axis by 90 degrees:
G4_rot
G4_norot

Ive tried to rotate other nodes (ceiling(red), floor(green), wall), but reflections seems ok, example - wall (white):
wall
wall_rotated

Tested on 4.0.alpha13-14, updated test scene (materials from 3.5 wont migrate to 4.0):
GIProbe 4.zip

@wacyym
Copy link

wacyym commented Aug 18, 2022

Screenshots with debugging "Voxel GI Lighting":
debug1
rotated and baked mesh "room" :
debug2

@Calinou
Copy link
Member

Calinou commented Aug 18, 2022

This could also be related to #62930 in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants