PBR OR Standard Material Skybox

Yo @Deltakosh

Is there any advantage of using a PBRMaterial for your skybox instead of a StandardMaterial when uses Six-Sided RGBA packed png images.

The reason i ask, is it seems to take ALOT longer (sometimes 15 seconds) for a scene to showup when i use a PBRMateral for the skybox images… If i use a StandardMaterial is comes right up


// Skybox
var hdrSkybox = BABYLON.Mesh.CreateBox("hdrSkyBox", 1000.0, scene);
var hdrSkyboxMaterial = new BABYLON.PBRMaterial("skyBox", scene);
hdrSkyboxMaterial.backFaceCulling = false;
hdrSkyboxMaterial.reflectionTexture = cubeTexture; // Size Sided Images (RGBA)
hdrSkyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
hdrSkyboxMaterial.microSurface = 1.0;
hdrSkyboxMaterial.cameraExposure = 0.6;
hdrSkyboxMaterial.cameraContrast = 1.6;
hdrSkyboxMaterial.disableLighting = true;
hdrSkybox.material = hdrSkyboxMaterial;
hdrSkybox.infiniteDistance = true;

All good to use StdMaterial or even faster the BackgroundMaterial like here:

What about Post processing… If i add post processing, is the PBRMaterial skybox better in anyway than a standard material…

Or is Standard Material all good for all cases ???

nope no difference :slight_smile:

Thanks @Deltakosh

The main difference is about the blur and should it be an accurate roughness.

The 15 seconds is probably because you are not using a .env file so it will try to create polynomials for it.

Basically if using an env go pbr and if not go standard.

Just to clarify… if I set the scene.environmnetTexture to a .env … the skybox material should be PBR ???

What about .dds environment textures … don’t they have polynomials ???

For dds we generate them which is what takes so long to start :slight_smile:

Ok… I see now…

But I’m still a bit confused on use pbr for skybox at all… if the standard material or background material does the same thing… it doesn’t look any better with pbr vs standard … the only thing I see is you can change pbr properties like micro surface, roughness, camera contrast and exposure… although I does see why you would want to change those… don’t you want the skybox to look exactly like the skybox images

I’m just trying to setup the best options for exporting a unity skybox to Babylon skybox … so far I’m just going with standard material using six sided images… my environment textures are dds … unless there is a matching .env file detected… it will use that instead

If it is a 1 1 mapping yup standard with disableLighting, or backgroundMaterial or PBR unlit would result in the same setup :slight_smile:

I would say the BackgroundMaterial will end up to being the lightweight of the 3 because it only renders a background, there are fewer shader code than for the two other materials (admittedly by a small margin, at least for the standard material - did not test PBR, as I don’t see the value of it for sky backgrounds).