Christian Sirois

cs_pix

About Me

Expertise
Technical Director
Location
United States of America
Website

Connect

Recent Forum Posts

OpenCL Voxel Space to World Space position? Oct. 8, 2018, 4:46 p.m.

Hi everyone,

I'm trying to get the world space position of a voxel in a heightfield volume using OpenCL. There is a option in the bindings to get “Volume Transform to World”, which returns a float16 OpenCL matrix but I don't understand how to extract a voxel position from this.

My guess is that I have to use gdix and gdiz and multiply them with the matrix but the matrix itself I don't understand.

height_xformtoworld.hi.hi = 0, 0, 0, 4?
height_xformtoworld.hi.lo = 0, ~15?, 0, 0
height_xformtoworld.lo.hi = ~15?, 0, 0, 0
height_xformtoworld.lo.lo = 0, 0, ~15?, 0

There is this weird approx 15 value in there. (I figure it out by dividing the matrix value by 15 to get 1 showing on the heightfield mask). These values are also out of place. I would expect matrix.lo.lo to return the translation part of the matrix but…

Any help to figure this out would be appreciated.
Thx!

Christian

Free Heightfield Ambient Occlusion Asset using OpenCL Feb. 28, 2018, 5:26 p.m.

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

2 things to improve? Feb. 12, 2018, 1:14 p.m.

Thank you. I will submit these as improvement requests.