Hersir Posted July 31, 2017 Share Posted July 31, 2017 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 31, 2017 Share Posted July 31, 2017 Hey is it something in your own shader or in the stock one? If the latter do you mind giving us a repro in the PG? (did you try with very latest version?) Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2017 Author Share Posted August 1, 2017 @Deltakosh Its in new PBR material. And I am using latest version from git master branch Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 1, 2017 Share Posted August 1, 2017 This is really unexpected, and I unfortunately do not seem to be able to repro. what configuration of the material are you using ? As @Deltakosh mentioned, a Playground would be super helpful. Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2017 Author Share Posted August 1, 2017 @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. Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2017 Author Share Posted August 1, 2017 @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 Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2017 Author Share Posted August 1, 2017 Optimizator options are irrelevant here, even without them error is thrown. var optimizerOptions = new BABYLON.SceneOptimizerOptions(30, 2000); BABYLON.SceneOptimizer.OptimizeAsync(scene, optimizerOptions); Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2017 Author Share Posted August 1, 2017 And to make it even more interesting if PBR material is at index 0 not 1 inside MultiMaterial it works without error Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 1, 2017 Author Share Posted August 1, 2017 Also this error is thrown if scene.executeWhenReady callback is set even without scene optimisation PG Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 1, 2017 Share Posted August 1, 2017 I see no error on this one: https://www.babylonjs-playground.com/#FYMYFH#4 (I can see the scene ready log and no crash) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 1, 2017 Share Posted August 1, 2017 actually I reproduce it Let me work on a fix Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 1, 2017 Share Posted August 1, 2017 Ok it is fixed! thank you very much for pointing it out Hersir 1 Quote Link to comment Share on other sites More sharing options...
Hersir Posted August 2, 2017 Author Share Posted August 2, 2017 Thanks for quick fix Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.