Jump to content

"Unable to compile effect" error


paleRider
 Share

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.reflectionTexture=txtHDR;
myMaterial.bumpTexture=new BABYLON.Texture("assets/textures/11_onetile.png",Scene);                                        
myMaterial.cameraExposure=exposure;
myMaterial.cameraContrast=contrast;
myMaterial.microSurface=0.96;
myMaterial.albedoColor=BABYLON.Color3.White();
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);
myMaterial.useRoughnessFromMetallicTextureAlpha=false;
myMaterial.useRoughnessFromMetallicTextureGreen=true;

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?

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

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...