onetrickwolf Posted February 18, 2016 Share Posted February 18, 2016 var material = new BABYLON.PBRMaterial("ball player", scene); material.diffuseTexture = new BABYLON.Texture("assets/02_Ball Player/ball_player_D.png", scene); material.bumpTexture = new BABYLON.Texture("assets/02_Ball Player/ball_player_N.png", scene); material.specularTexture = new BABYLON.Texture("assets/02_Ball Player/ball_player_S.png", scene); //Attach the material to the sphere mesh.material = material; The above works fine when swapping out PBRMaterial with StandardMaterial. When I do PBRMaterial though I'm getting: Uncaught TypeError: Cannot read property 'PrepareDefinesForLights' of undefined Any ideas? Thank you sorry still trying to figure this out. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted February 18, 2016 Share Posted February 18, 2016 what happens when you try this var pbr = new BABYLON.PBRMaterial("pbr", scene); pbr.cameraExposure = 0.66; pbr.cameraContrast = 1.66; and assign that to the mesh or //Creation of a material var materialSphere = new BABYLON.PBRMaterial("Material_" + j, scene); materialSphere.albedoColor = new BABYLON.Color3(0.2, 0.9, 1.0); materialSphere.reflectivityColor = new BABYLON.Color3(reflectivity, reflectivity, reflectivity); materialSphere.microSurface = microSurface; materialSphere.reflectivityTexture = texture; materialSphere.useMicroSurfaceFromReflectivityMap = true they are direct copy and pastes from http://doc.babylonjs.com/overviews/Physically_Based_Rendering also what kind of light do you have in the scene? Im pretty sure a PBR would be dependent on the lighting seeing how its trying to simulate a realistic model... perhaps try changing your lights? Im not sure I have not yet got to PBR implementation on any of my projects yet so this is kinda just a shot out in the dark. But from what I see its properties are not the same as the standard material. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 18, 2016 Share Posted February 18, 2016 You need to use the latest babylon.js 2.4 I guess Quote Link to comment Share on other sites More sharing options...
onetrickwolf Posted February 18, 2016 Author Share Posted February 18, 2016 Updated to preview release worked thanks didn't know this was a preview feature! However, the only texture that works is the bumpTexture (it looks amazing though!). The diffuse and specular don't seem to be working. Any idea why? Thanks for always be so helpful Deltakosh will try to repay the forum in the future by answering questions once I know more! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 18, 2016 Share Posted February 18, 2016 it should work can you try to reproduce your issue on the PG? Quote Link to comment Share on other sites More sharing options...
onetrickwolf Posted February 18, 2016 Author Share Posted February 18, 2016 Hmm not sure how to load external files on the playground but here is the full code that's giving me issues: http://www.babylonjs-playground.com/#UUZUS#3 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 18, 2016 Share Posted February 18, 2016 You have to reference files form an open CORS server (or just use textures already in the PG like here: http://www.babylonjs-playground.com/?28) Quote Link to comment Share on other sites More sharing options...
onetrickwolf Posted February 18, 2016 Author Share Posted February 18, 2016 I replaced diffuseTexture with albedoTexture and that seemed to work. Is that just a difference between PBR and standard? Having trouble figuring out what the equivalent to specular would be. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 19, 2016 Share Posted February 19, 2016 specular is defined by reflectivityTexture We will update the doc! 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.