Jump to content

ambient occlusion blender scene export questions


cefleet
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

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