Issues with the use of global illumination

Must global illumination be enabled before the scene loads? In other words, do we need to first load the light entities, then enable global illumination, and only after that start loading the models?

error:  The plugin "GIRSMRender" can't be added to the material "xxxMateiral" because this material has already been used for rendering! Please add plugins to materials before any rendering with this material occurs.
1 Like

@Evgeni_Popov?

The materials that you will use with global illumination must not have been used to render a mesh before GI has been enabled.

So, you must make sure to enable GI for all your materials (or at least those that must support GI) before any rendering has been issued with them.

It’s not specific to GI, it’s related to plugin materials: materials you want to add plugins to must not have been used to render a mesh when plugins are added to them.

I’m adding the material to GIRSMManager when it’s being created, but I’m getting a bunch of warnings in the console, and the effect isn’t as expected. I’m not sure what’s causing this issue.

    Scene.onNewMaterialAddedObservable.add((mat) => {
      giRSMMgr.addMaterial(mat);
    });

goRsMMgr.enable=true

goRsMMgr.enable=false
image

Here, the shoes in the PG are rendered first, and then their materials are added to the GIRSMManager. Why are they still rendered correctly?

I feel like I should have solved the previous few issues.

New issue: Not sure what’s causing the offset in the shadows.

Adjusting the dimensions value resolved this issue.

This implies that global illumination must be enabled before the next frame rendering, for example, if the program sleeps (0), an error will occur, as seen on line 63 of the demo, right?

Yes, the materials you use for GI rendering must not have been already used to render meshes. In the PG, the ground, sphere, etc have already been rendered with the mtl material for a frame when GI is enabled, hence the error. What you can do is clone the material and replace the material used by the ground, sphere, etc with this new material.

No, all materials are added to the manager at start, see line 102.

After enabling global illumination, what is causing the noticeable aliasing on the floor? Could it be due to incorrect texture quality settings?

Hard to tell: can you setup a repro in a PG?

Have you tried to change the edge artifact correction setting?

Click ‘test’ button.

When there is an intersection between the Plane and the Ground, noticeable aliasing occurs.

Yes, that’s because the depth buffer format is set to 16 bits by default. You can force it to 32 bits by enabling the geometry buffer yourself, before initializing GI:

I will make a PR to add an option to the GI manager to enable 32 bits depth buffer.

123

When using global illumination, I encountered this issue, and currently unable to replicate it in the PG. When useFullTexture=true, the scene becomes brighter and there is severe overexposure whenever a mesh is added to the scene. I’m unsure what is causing this.

For example, in this PG, when I drag and show/hide the sphere, the scene exhibits the effect shown in the gif.

I’m not sure if this is related to the metallicness/roughness.