mrkishi Posted January 19, 2017 Share Posted January 19, 2017 Hello everyone, I'm trying to use decals with a PBRMaterial but can't get past a (apparently normal-related) glitch. Playground example: http://www.babylonjs-playground.com/#1YDIEU Click on the cylinder to add a few decals on different sides of the object. Each side behaves differently, as if the normals were the same for all of them. I tried changing the PickingInfo.getNormal(bool, bool) call unsuccessfully, and even tried to force normals to be recalculated by using Mesh.updateMeshPositions(fn, true), but that didn't help. Granted, it might not even have anything to do with normals.. That's just a guess, supported by the fact that when using a NormalMaterial, decals are plain black. Now, this may well be my fault and not really a bug, but in that case I'd argue the examples and documentation have a bug! I appreciate any help. Also, feel free to curse me in case I'm doing something stupid. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2017 Share Posted January 23, 2017 Does it work with regular StdMaterial? Ping @Sebavan Quote Link to comment Share on other sites More sharing options...
mrkishi Posted January 23, 2017 Author Share Posted January 23, 2017 No, similar odd behavior with StandardMaterial: http://www.babylonjs-playground.com/#1YDIEU#1. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2017 Share Posted January 23, 2017 I see no problem (but perhaps I'm not looking a the right place): http://www.babylonjs-playground.com/#1YDIEU#2 (I removed the env map for better understanding of the normals) Quote Link to comment Share on other sites More sharing options...
mrkishi Posted January 23, 2017 Author Share Posted January 23, 2017 Also apply decals to the other side of the mesh. They should be in the dark as there's only one light at BABYLON.Vector3(100, 0, 0), yet they are fully highlighted. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 24, 2017 Share Posted January 24, 2017 Ok gotcha! bug confirmed and fixed (please update your browser cache) mrkishi 1 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.