Recommended Posts

Hi,

What is the bets way to debug errors in shaders?

I have mystica error from PBR:

Error: ERROR: 0:1492: 'glossiness' : undeclared identifier
ERROR: 0:1492: 'computeHemisphericLighting' : no matching overloaded function found
ERROR: 0:1492: 'assign' : cannot convert from 'const mediump float' to 'structure'
ERROR: 0:1573: 'computeLighting' : no matching overloaded function found
ERROR: 0:1573: 'assign' : cannot convert from 'const mediump float' to 'structure'

I cant really find the source of it ,as the error shows up if I change starting camera angle :D 

Share this post


Link to post
Share on other sites

@Sebavan 

Materals: 

{
   customType: "BABYLON.PBRMaterial",
   id: "material-id",
   name: "material #name",
   reflectivity: [0.2, 0.2, 0.2],
   environmentIntensity: 0.7,
   microSurface: 0.7,
   albedo: [1, 1, 0.94],
   directIntensity: 0.7,
}
{
    name: "material #name2",
    id: "material-id2",
    customType: "BABYLON.PBRMaterial",
    albedo: [0.5, 0.5, 0.5],
    reflection: [0.7, 0.7, 0.7],
    environmentIntensity: 0.9,
    useRoughnessFromMetallicTextureAlpha: false,
    useRoughnessFromMetallicTextureGreen: true,
    useMetallnessFromMetallicTextureBlue: true,
    metallic: 1,
    roughness: 0.4,
}
scene.environmentTexture = CubeTexture.CreateFromPrefilteredData(
    "environment.dds", scene
);

They are part of babylon file that is loaded,  I use AssetManager to load scene. Only thing is that these material are part of MultiMaterial.

Could it be related to fact that lights and cameras are created after scene is loaded (onFinish for AssetManager). I get this error every time if initial camera position is away from objects (objects are not in camera viewport) and then I rotate camera to see them, (all elements with these materials are not visible).

I am still trying to replicate this scenario in Playground.

Share this post


Link to post
Share on other sites

@Deltakosh @Sebavan

Finally managed to locate source of error and to make PG

Looks like that SceneOptimization is causing error.

In scene are 2 spheres (big in centre is created and smaller is loaded and is out of camera viewport). If you zoom out with scroller, error about PBR will appear and small ball will not be visible.

If camera radius is set to 500 (small ball is in camera viewport) at the beginning small ball will be visible and no error is thrown. PG

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.