cefleet Posted February 3, 2016 Share Posted February 3, 2016 I am trying to get the ambient occlusion effect to work on a scene that I import from blender. I cannot seem to understand why it is not working. Here is my setup: I have a .babylon scene that has a hemispheric light and a directional (sun) light. Once that scene is ready, it then loads the meshes (which are contained in a different .babylon file) I do not have textures on them, just materials. I then try to add the Ambient Occlusion from the console using : var ssao = new BABYLON.SSAORenderingPipeline("ssao", scene, 0.5); scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline("ssao", camera); (scene and camera are set properly beforehand) There is no discernible change. For testing I have a sample playground that was copied from the SSAO playground just taking out everything that wasn't required. http://www.babylonjs-playground.com/#1TDTWF#1 But I don't know how to translate this to my blender exported scene. I am going to assume it has something to do with my lights, or materials on the mesh, but I don't know what i need to monkey with. Quote Link to comment Share on other sites More sharing options...
cefleet Posted February 3, 2016 Author Share Posted February 3, 2016 So after I wrote this I thought about testing something and I added this in the console: var boxMaterial = new BABYLON.StandardMaterial("boxMaterail", scene); boxMaterial.specularColor = BABYLON.Color3.Black(); boxMaterial.emissiveColor = BABYLON.Color3.White(); var box = BABYLON.Mesh.CreateBox("box", 5, scene); box.rotation = new BABYLON.Vector3(1, 1, 1); box.material = boxMaterial; var box2 = BABYLON.Mesh.CreateBox("box2", 5, scene); box2.rotation = new BABYLON.Vector3(2, 1, 2); box.position = new BABYLON.Vector3(2,2.5,8); box2.material = boxMaterial; var ssao = new BABYLON.SSAORenderingPipeline("ssao", scene, 0.5); scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline("ssao", camera); And those boxes have AO! So adding after loading is not the problem which is good. I guess then what I need to know is, what settings in blender do we need to make it where AO is seen on meshes imported from blender? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 3, 2016 Share Posted February 3, 2016 Blender exporter explicitly sets all material color elements, so you cannot rely on any default values, set according to this mapping of controls to export values. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
cefleet Posted February 3, 2016 Author Share Posted February 3, 2016 Thanks, I've been exporting from blender for about a year so I know those settings.That's not the problem though. I just didn't know if my settings are blocking AO in some way. Like too much light, or to much specular or something like that. I think I am on the trail of something and it has nothing to do with materials... possibly. Quote Link to comment Share on other sites More sharing options...
amarneethi Posted February 7, 2016 Share Posted February 7, 2016 I'm not sure about your exact needs, maybe you can try baking the AO into the textures in blender instead of calculating it in realtime. AO calculation is processor intensive, at least in non-real time rendering engines. If I'm not wrong baking textures will save a lot of processing power during run-time in Babylon too. Hope this helps. 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.