Jump to content

Error in PBR


Hersir
 Share

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 

Link to comment
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.

Link to comment
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

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...