How to make a shader material receive global illumination from GIProbe

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fractile

Is it not possible to create a shader that receives light from GIProbe? If I convert a SpatialMaterial to ShaderMaterial the GI stops working.

I didn’t find any mention of this in the documentation.

Edit: The same material is also the only source of indirect light (the emissive parts), so it could be that the emission is not affecting GI.

Could you be more specific? What does your custom shader look like? Does it also happen when you use the shader code from the SpatialMaterial Shader as your ShaderMaterial shader?

archeron | 2021-01-25 10:20

The GI works well using a SpatialMaterial (with albedo, emissive and roughness textures, nothing special). When I convert that same material into ShaderMaterial without touching the shader code, the GI no longer affects the material.

Edit: The same material is also the only source of indirect light (the emissive parts), so it could be that the emission is not affecting GI.

fractile | 2021-01-25 10:30

:bust_in_silhouette: Reply From: Calinou

This is a known limitation which will be fixed in Godot 4.0. I opened a pull request to document it.

Ok, thanks. I can work around this by using ShaderMaterial for GLES2 only (no GI anyway) and SpatialMaterial for GLES3.

fractile | 2021-01-25 18:28