Free Heightfield Ambient Occlusion Asset using OpenCL

   4810   3   2
User Avatar
Member
23 posts
Joined: July 2015
Offline
Hi everyone,

I've been reading this forum for a while now and even asked a few questions. The response from the community is always great so I figured it was time for me to give back a little. We have some very talented people at Seasun Games and part of our pipeline involves using Houdini 16+ heightfields quite a lot. Since moving our tools from being grid base to using volumes, there is one computed datasets that we wanted to improve and it is Ambient Occlusion on the Heightfield.

In short, this dataset allows us to modulate the distribution of plants or rocks on the terrain. It was very slow to compute using traditional VEX so I set out to create an OpenCL version and I'm sharing the result today.

I have 2 main reason for this release. First, to give back to the community that I consult often and second, to share the code and the knowledge of using OpenCL in Houdini. It's not an easy language but the benefits are sometimes extraordinary.

Also, maybe some OpenCL pro on this forum will find ways of optimizing it or it's up to anyone to add features and improve the asset. In any cases, its there for you to download. The SOP contains a branch that uses OpenCL and one that uses standard VEX for comparaison.




You can download the package below

A big thanks goes out to Robert Osborne for helping me figuring this stuff out:
https://www.sidefx.com/profile/skara/ [www.sidefx.com]

I hope you find it useful.
Cheers!

Christian Sirois
Technical Director
Seasun Games
Edited by cs_pix - March 1, 2018 11:50:04

Attachments:
AmbientOcclusion.zip (663.9 KB)
AO_nodes.jpg (37.1 KB)
AO_result.jpg (118.0 KB)

User Avatar
Member
166 posts
Joined: March 2014
Offline
Thank you very much for this, I will definitely try it out in a few days.

I've had a need for generating AO on heightfields for texture generation purposes and was going to implement it myself. But you've already done all the work, this is excellent!
User Avatar
Member
9 posts
Joined: July 2013
Offline
Awesome!!
Thanks
User Avatar
Member
4 posts
Joined: Oct. 2013
Offline
Just found this, it's so helpful! Thanks for sharing Christian!

I would like to try implementing this on polygons for a point attribute so I can iterate efficiently. Just comparing the labs version written in VEX and your heightfield version it seems very similar in implementation, do you have any resources you could share on how to build something like this? I know its been a bit since you posted this. :P
  • Quick Links