When launching or building, reflections are not properly expressed


Hello, it seems that an error has suddenly occurred. help
In the editor, the reflection is displayed normally.
When launching or building, reflections are not properly expressed.
What is the reason please help

Have a nice day~ :slight_smile:

Hi @MJ0619,

Thatโ€™s strange, can you double check that your cubemap is loaded when launching? You can do that by opening your browser dev tools โ†’ Network tab.

You can also share, if possible, your sample project here to take a look at.

Thank you for your reply! leonidas
Could you take a look at the sample project?

https://playcanvas.com/project/1023125/overview/reflection_test

1 Like

Thatโ€™s quite strange indeed, nothing wrong with your setup. If you set the skybox Mip level to 1, then reflections work, even if you later set it back to 2:

I remember vaguely there was a discussion about that on Discord, but I may be wrong. Calling @Elliott from the PlayCanvas team (he may be slow to respond due to holidays).

Thank you so much for your reply.
When launching, I solved it by adjusting the mip level.
But what is the solution when building?

To replicate that behavior on a build you will need to use code. Here is an example script which you can use on your Root entity. Set your skybox mip initially to 1 and have this script change it:

var SetSkyboxMip = pc.createScript('setSkyboxMip');

// initialize code called once per entity

SetSkyboxMip.prototype.initialize = function () {

    this.app.scene.skyboxMip = 2;

};
1 Like

Thank you for your reply! leonidas
you are great man~!