{"id":977,"date":"2025-05-20T12:38:47","date_gmt":"2025-05-20T19:38:47","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=977"},"modified":"2025-05-20T12:48:54","modified_gmt":"2025-05-20T19:48:54","slug":"archived-post-by-sniperjake945-31","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2025\/05\/20\/archived-post-by-sniperjake945-31\/","title":{"rendered":"Archived post by sniperjake945"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">here&#8217;s something fun. if you&#8217;ve ever wanted to pass the layer data into a function in opencl and then read from the layer, here&#8217;s how to do it! \ud83d\ude42<br \/>\n&#8220;`c #bind layer src? val=0 #bind layer &#038;dst<br \/>\n float4 buffereIndexCUSTOM(const IMX_Layer* in_layer, int2 xy){     return bufferIndexF4(in_layer, xy, in_layer->stat->border, in_layer->stat->storage, in_layer->stat->channels); }<br \/>\n @KERNEL {     float4 vals = buffereIndexCUSTOM(@src.layer, @ixy);     @dst.set(vals); }<br \/>\n&#8220;`<br \/>\nthis way you can use layer data in functions! you lose the ability to use <a href=\"mailto:`@binding`\" >`@binding`<\/a> inside of the functions, but at least you have access to the layer functions. For more info on  the IMX_Layer struct check out  `$HFS\/houdini\/ocl\/include\/imx.h` and then if you&#8217;re curious what functions you have access  to you, you&#8217;ll want to read the `$HFS\/houdini\/ocl\/include\/imx_internal.h` include<\/p>\n<p class=\"\">someone here has probably already figured this out, and i will say that its super easy to crash your opencl playing with these functions, but it definitely makes passing data into and out of functions way easier!<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>here&#8217;s something fun. if you&#8217;ve ever wanted to pass the layer data into a function in opencl and then read from the layer, here&#8217;s how to do it! \ud83d\ude42 &#8220;`c #bind layer src? val=0 #bind layer &#038;dst float4 buffereIndexCUSTOM(const IMX_Layer* in_layer, int2 xy){ return bufferIndexF4(in_layer, xy, in_layer->stat->border, in_layer->stat->storage, in_layer->stat->channels); } @KERNEL { float4 vals = &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2025\/05\/20\/archived-post-by-sniperjake945-31\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by sniperjake945<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/977"}],"collection":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/comments?post=977"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/977\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=977"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}