No antialias for PBRMaterial reflections?

antialias works nice, mostly.
I use PBRMaterials, reflecting the sunlight (as DirectionalLight)
and only at certain flat angles the sun gets reflected remarkably, as expected.
But the reflection causes Moiré patterns.

engine.setHardwareScalingLevel(0.5) does help but increases the render time. My fan starts running.
pbrMaterial._enableSpecularAntiAliasing = true; or
pbrMaterial.enableSpecularAntiAliasing = true; did not show any difference.
A more detailed texture will help, but cause other loads.

Is the antialiasing function used for the reflections?

Scaling = 1

Scaling = 0.5

Some of possible reasons:

  1. Texture dimensions are not set in your 3D editor tool.
  2. Sampling mode How to get rid of texture artifacts? - #7 by Evgeni_Popov
1 Like

Thank you for your fast answer.
I do not load a glb file and do not use a 3D editor, just plain “new BABYLON.PBRMaterial”.
And I use one file with 3 textures:
material.useAmbientOcclusionFromMetallicTextureRed = true;
material.useMetallnessFromMetallicTextureBlue = true;
material.useRoughnessFromMetallicTextureGreen = true;

May be “material.updateSamplingMode(BABYLON.Texture.TRILINEAR_SAMPLINGMODE)” could be usefull? Not in my test.

Providing a repro PG would probably help people help you.


Yes! There you are:
Just start it and you will see the moiré patterns.
They change with the distance.
Somme optional lines are in comments.

The moiré pattern shows up because of the direct lighting. You should try to use an environment map and lower the direct lighting intensity:

1 Like