Artefacts on reflections when applied cubemap to material

I created a prefiltered cubemap and applied it to an object’s standard material rather than the scene’s skybox so it doesn’t appear in the background:

material.useSkybox = false;
material.cubeMap = cubeMap.resources[0];
material.envAtlas = cubeMap.resources[1];

But I get weird artefacts i.e. light coloured pixels forming an edge:

Does anybody know how to get rid of them? They don’t appear when I use the cubemap as the scene’s skybox.

Hi @Trigger,

I think you don’t need to set the cubeMap property, only the envAtlas one. But you do need to set the cubeMapProjection property in additon and provide some metrics for your scene.

Like this example does:

            roomMaterial.cubeMapProjection = pc.CUBEPROJ_BOX;
            roomMaterial.cubeMapProjectionBox = new pc.BoundingBox(
                new pc.Vec3(0, 200, 0),
                new pc.Vec3(400, 200, 400)

Thanks for the quick reply. Adding cubeMapProjection and cubeMapProjectionBox properties didn’t seem to fix it. I’ll have to keep digging.

It’s a bit more obvious below when I use a sphere:

Cubemap applied to material:

Cubemap applied to scene’s skybox:

Not sure if I’m pinging the right guys :innocent:


1 Like

@slimbuck is your man on this one

1 Like

Hi, the envAtlas texture must have mipmaps disabled!

1 Like

Thanks @slimbuck, that fixed it.

1 Like