godotengine / godot

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

Use directional LightmapGI information to display specular lobes for fully baked (static) lights #63016

Open jcostello opened 2 years ago

jcostello commented 2 years ago

Godot version

v4.0.alpha.custom_build [e5a1640cf]

System information

Ubuntu 21.04. RTX 2060

Issue description

Baked a Directional Light set as static with the LightmapGI set to directional does not bake specular information

Realtime Directional Light

image

Baked Lightmap set to directional

image

Ignore know issue about direct light power on the backed map image

Steps to reproduce

Bake lightmap set to directional on the minimal project

Minimal reproduction project

Specular.zip

Calinou commented 2 years ago

Ignore know issue about direct light power on the backed map image

Can you test this with https://github.com/godotengine/godot/pull/61910 merged locally, just in case?

jcostello commented 2 years ago

@Calinou With https://github.com/godotengine/godot/pull/61910 merged locally into master. Same result

Realtime image

LightmapGI image

Calinou commented 2 years ago

I can reproduce this on the linked MRP. Directional information is present, but very subtle by default (possibly too subtle). If you increase the normal map strength to 16 in the material, you'll definitely notice that it's there:

Normal Map Strength = 1 Normal Map Strength = 16
2022-07-19_20 00 23 2022-07-19_20 00 29
Normal Map Strength = 1 Normal Map Strength = 16
2022-07-19_20 00 51 2022-07-19_20 00 57

Specular lobes don't seem to ever show up though. I doubt it was ever implemented, actually.

Minimal reproduction project (with added lights and tweaked settings): Specular2_nolightmap.zip

Calinou commented 1 month ago

Pages 66-77 of this slideshow describe a possible implementation of direct specular lobes using directional lightmap data.

There are some limitations with the described approach, but it has a relatively small performance impact and should have a level of quality similar or better than what's described in https://github.com/godotengine/godot-proposals/issues/3078.

clayjohn commented 1 month ago

Pages 66-77 of this slideshow describe a possible implementation of direct specular lobes using directional lightmap data.

There are some limitations with the described approach, but it has a relatively small performance impact and should have a level of quality similar or better than what's described in godotengine/godot-proposals#3078.

Ya, that's a really nice approach when you are already baking L1 spherical harmonics