AlbertTJames Posted August 25, 2016 Share Posted August 25, 2016 Hi, So I have another problem, this time with the PBR textures imported from unity using Babylon2unity. If I am using any light other than Hemilight (pbr material from unity seem to work with it), all the textures show up black. Again it might be solved by some tweaks in the texture objects, so I have been looking for the problem for hours now... I had some successes, failure, a lot of frustration. So I thought i should ask for your help. On the first image this is the results of my tweaking using an omnilight. So I though I had it figured out, by changing the reflectivityColor and reflectionColor from 0,0,0 to 1,1,1 it seems I get back my texture for the little robot in the middle (the infamous roger robot). With some shadow etc. I also changed the "hasAlpha" in the reflectivityTexture (because it does have alpha) and changed useMicroSurfaceFromReflectivityMapAlpha and useAutoMicroSurfaceFromReflectivityMap to "true" (one of them was already to true, can't remember which one) - that did work with matte region becoming matte, at long last. So I said Great ! lets change the reflectivity color and reflexion color for one of the tile type (the little hexagons thingy). By doing that I also get back the texture normal color BUT, light does not seem to interact in the same way, the mesh is lighted both in front and behind similarly... the back face should be black no? (see image 2). The last 2 images is with the hemilight (front and back) , it seems the material is behaving normally... You might be wondering why I am persisting on resolving this issue when I have a perfectly well behaved light source at disposal... and that is a very relevant question. Any idea(s) ? Light source code: var hemiLight = new BABYLON.HemisphericLight('hemiLight', new BABYLON.Vector3(0, 0, -30), scene); hemiLight.intensity = 2; // var sun = new BABYLON.PointLight("sun", new BABYLON.Vector3(0, 50, 0), scene); // sun.intensity = 2; Quote Link to comment Share on other sites More sharing options...
Wingnut Posted August 25, 2016 Share Posted August 25, 2016 Don't forget hemilight.groundColor = BABYLON.Color3.Gray() - lights up the sides and bottoms of things. Other than that, I got nothin'. I'll keep thinking, though. A careful examination of your .babylon file, perhaps using a nice online json-to-tree viewer, might reveal something, though. And maybe not. I also don't know who maintains the unity exporter. Maybe drop it in the sandbox, too... see what it looks like. I know there was some changes to materials done today... so make sure you get the latest BJS. The changes were mentioned in this thread. What a great help I am, huh? (sorry) AlbertTJames 1 Quote Link to comment Share on other sites More sharing options...
AlbertTJames Posted August 25, 2016 Author Share Posted August 25, 2016 Thank you, it does help I've been reading JSON for two days now, i think I will really stop here and do something else with my life I used the material editor to make a standard material with the same texture, you can see on this image the standard material of Roger the Evil Robot reflects far more the hemilight than the PBR material of the boring colored tiles.. PS: Some of you might be wondering why the hell I am still trying to use PBR when I have a standard material than is working fine ... and that again, would be a very valid point. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 25, 2016 Share Posted August 25, 2016 Hello, Could you please share your unity project? I would really try to give it a shot for both material and animations. thx AlbertTJames 1 Quote Link to comment Share on other sites More sharing options...
AlbertTJames Posted August 25, 2016 Author Share Posted August 25, 2016 Ah! awesomeness https://www.dropbox.com/s/uf4nr72u1ntpp9c/recalciltrantRoger.zip?dl=0 Take care of roger ! Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 26, 2016 Share Posted August 26, 2016 Hello, Unfortunately, I can not find the ground in the zip (only a red plane). Could you create another one with the terrain in ? Thank you, Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 26, 2016 Share Posted August 26, 2016 About the lights, the PBR is trying to follow some physics for the light falloff: http://doc.babylonjs.com/overviews/Physically_Based_Rendering_Master#inversed-squared-light-falloff-and-light-radius An hemi light (being a bit like ambient) does not have any falloff so everything is lit. With point light, the falloff with PBR is huge compared to standard (but physically closer from nature). To use the same light values you are used to in BJS, simply turn the physical falloff off: pbr.usePhysicalLightFalloff = false; Let me know if that helps. About roger could you try to export from the specular workflow in unity instead of metalic ? (I guess the conversion is not right for the metallic input, I ll take a look when I ll have more time). CU, 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.