AO in Cycles Standalone

Hello

It seams that ambient occlusion is not rendered correctly. I tried to use Cycles Standalone and render the scene with the following xml-code:

<cycles>
<camera width="800" height="500" />

<transform translate="0 0 -4" scale="1 1 1">
	<camera type="perspective" />
</transform>

<shader name="object_shader">
	<ambient_occlusion name="ao_node" distance="1.0" inside="false" />
	<emission name="em_node" />
	<connect from="ao_node ao" to="em_node color" />
	<connect from="em_node emission" to="output surface" />
</shader>

<transform rotate="180 0 1 1">
	<state interpolation="smooth" shader="object_shader">
		<include src="./objects/sphere.xml" />
	</state>
</transform>

<transform rotate="90 1 0 0">
	<transform translate="0 0 1">
		<state shader="object_shader">
			<mesh P="-3 3 0  3 3 0  3 -3 0  -3 -3 0" nverts="4" verts="0 1 2 3" />
		</state>
	</transform>
</transform>
</cycles>

As the result I obtain the following:

Is it Cycles error or this is my mistake in the ambient occlusion setup?

Are you using a recent version? Being able to use the AO node to output colors is a relatively new feature, previously it would always output an AO closure.

Are there any errors printed in the terminal when rendering this scene?

Yes, I use the latest version from Cycles repository, which was commited at 17 september. No errors in the terminal. This is result of rendering with monkey head from example meshes (quality is 128 samples):

When AO node returned closure, all worked correctly, but I don’t remember when I really tested it. It was too long ago.

I just updated the Cycles standalone repo with the latest bugfixes from Blender. Maybe one of those helps.

For me it seems to work correctly, except that the result can be better seen when lowering the emission strength from the default 10.0:

<emission name="em_node" strength="1.0"/>
1 Like

Ok, thank you. Updated version render correctly.

I am notice that incorrect result of AO appear in the Cycles compiled with Visual Studio 12 (and using external libs from win64_vc12). If compiled with Visual Studio 14 (and libs from win64_vc14), then all renders correct. Why it happens? May it is possible to fix it? I prefer to use vc12 versions of external libs, because it should be compatible with other applications wchich use only this version of VC.

There may be a compiler bug in vc12 that is causing this, but we stopped supporting that version and the libraries are not being updated anymore. If you want to contribute a fix or workaround we could add it, but for us it’s too time consuming to keep supporting such older versions.

A workaround may be to use BVH4 instead of BVH8 for example.

This is actually a known issue and one of the reasons we dropped msvc2013 support.

Ok, thank you for replies.