Issue with skybox taking priority over envAtlas

Hi Team,

I’m seeing strange regression with 1.56 where the skybox is overwriting/ taking priority over the scenes envAtlas. as seen in the video, if i set the skybox to null it shows the correct reflections but no sky. How do I specify that I want a skybox but not have it affect reflections? (this is using the engine).

Looks to have been introduced as part of https://github.com/playcanvas/engine/pull/4513
specifically this line here where it sets the skybox to the cubemap

@slimbuck @Gustav_Sterbrant , any ideas on this one?

Hi @Adrian_Meredith,

The code you show above executes only if there is no ‘local env override’. Presumably this.envAtlas is null along with this.cubeMap and this.sphereMap?

Oh wait, sorry think I misunderstood your problem.

Are you saying that your prefiltered environment is different from your skybox? In this case you can set the envAtlas directly on the material.

I’m setting the app.scene.envAtlas as my environment reflections/lighting map that i want to use as the default for all materials (as the level is all indoors) but I also have app.scene.skybox set so that I have a sky. I don’t want the sky to affect the reflections like in previous versions

Right now you’d have to set the envAtlas on all materials directly to achieve this.

thats not very feasible nor desirable and huge a breaking change. there are 100s if not 1000s of materials in my scene I’d have to set

How are the materials being created? Do they have useSkybox enabled?

Is there a way you would be able to provide an engine example for us to look at please?

It seems odd that in 1.55 that you can have a skybox with no reflections unless useSkybox was disabled on the Standard Material.

Hi @Adrian_Meredith,

Setting overrides by hand would indeed be a nightmare. I was thinking you could possible do this programatically at startup?

I would love to see your setup if you’re able to share and then chat with team about perhaps adding a flag which would help in this case.

Thanks!

  • the materials are from gltf
  • no usage of useSkybox
    I can’t share my current setup but I’ll look into providing an example if I can as my attempted workaround is not working on all types of materials (we use a fork with a few changes fixing various bugs with gltf validation and support for additional uv maps but they are fairly minor and shouldn’t affect this scenario)

Is there a way to globally set the cubeMap like there is for envAtlas? Looks like that would solve the issue

In short term it looks like I can patch that in myself (adding cubeMap to scene for specifying global reflections independent of skybox). It does feel like playcanvas would benefit from a clearer distinction between reflections and the skybox as apps that rely on reflection probes like myself. The only issue this causes is it then opts into the HQ reflections which is great in principle but from what I can see they don’t mipmap and as a result look very aliased/sparkly at a distance.

It does feel like playcanvas would benefit from a clearer distinction between reflections and the skybox

Yes I totally agree. Some of the confusion we have now is down to us not wanting to break backwards compatibility.

The sharp HQ reflections perform a simple textureCube, so mipmaps will be used if they’re available. Please check mipmaps weren’t disabled somehow on the cubemap you’re using.

1 Like

Thats exactly the issue :laughing:

Thats exactly the issue :laughing:

Oh don’t worry, it could be much worse!! :stuck_out_tongue:

Pls share a cutdown project if you are able so I can take a look. (Username slimbuck)