"Unable to compile effect" error

Recommended Posts

Hi everybody!

I get the following errors (relevant excerpt) in the console:

BJS - [13:19:53]: Unable to compile effect:...


BJS - [13:19:53]: Error: ERROR: 0:1001: 'vBumpInfos' : undeclared identifier
ERROR: 0:1001: 'y' :  field selection requires structure or vector on left hand side

meanwhile trying to add a normal map (by means of bump texture) to any PBR Material.

My material definition is:

var myMaterial=new BABYLON.PBRMaterial("plastic",Scene);
myMaterial.bumpTexture=new BABYLON.Texture("assets/textures/11_onetile.png",Scene);                                        
myMaterial.albedoTexture=new BABYLON.Texture("assets/textures/QIS_Exterior_BaseColor.png",Scene);
myMaterial.reflectivityColor=new BABYLON.Color3(0.07,0.07,0.07);
myMaterial.metallicTexture=new BABYLON.Texture("assets/textures/QIS_Exterior_Metallic_PBR.png",Scene);

If I remove the offending line: myMaterial.bumpTexture=new BABYLON.Texture("assets/textures/11_onetile.png",Scene); the material works flawless (but of course without normal map).


My question:

Are BJS PBR Materials compatible with Normal Maps?

Share this post

Link to post
Share on other sites

Was this related to line ending?

Because I once noticed that when line ending is linux style for the vertex file, BJS cannot compile this kind of line:

// varying
varying vec2 vUV;

Error is 'vUV' : undeclared identifier

To work properly, the code has to be:

// varying

varying vec2 vUV;

(with a blank line)

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.