XaiJu
entagma
entagma

patreon


Volumes 101 - Reaction Diffusion in OpenCL

Yes... Admittedly we implemented reaction diffusion already using only SOPs (and a tiny bit of VOPs). However this implementation was a bit limited and to offer the full scope of what reaction diffusion equations offer, we'll reimplement the setup - this time using OpenCL.

This will result in two things: First - a ten to fiftyfold increase in speed (depending on your hardware and setup parameters) and second - in us learning a bit more OpenCL.

Make sure to have a look at our previous run at reaction diffusion, to get the background of what it actually is and how it works:

http://www.entagma.com/houdini-true-3d-reaction-diffusion/

Volumes 101 - Reaction Diffusion in OpenCL

Comments

Hey Moritz - loving the course so far! I have a question about how you can expand on this setup to get different results. Currently, I've been playing with different Feed and Kill settings from values obtained by using the interactive RD Tool provided on the Karl Sim's site (https://www.karlsims.com/rdtool.html?s=0TSYr). But I'm struggling with how you could take this setup and have the RD pattern grow along a surface (like a face) or even just flat along a plane. Additionally, I'd love to hear your thoughts on how one could create the kind of scaling effects also featured in the RD interactive Tool.

Eddie Livingstone

Quick tip! For everyone with the issue of painfully long caching times for animation. Converting the volume back to a VDBs after the Simulation and then converting VDBs to Polygons will safe you a lot of time, since the convert volume node appears to be single-threaded and convert vdb is multi-threaded.

weeely

Hi Willy, strange... changing feed and kill rate (f&k) are the main factors driving the look and behaviour of the system. Maybe you're changing them too drastically. A nice overview of f&k-combinations can be seen here (klick on the map to display f&k-ranges to generate the respective effects): <a href="http://mrob.com/pub/comp/xmorphia/index.html" rel="nofollow noopener" target="_blank">http://mrob.com/pub/comp/xmorphia/index.html</a> Cheers, Mo

Entagma

Hi Moritz! This might be a stupid question, but in the beginning of the video you say that reaction diffusion can be made to behave very differently. I am wondering which parameters are the ones to change (and in what range) to create different behaviour. changing DA, DB, f , k and dt result in failures to calc the reaction. cheers!

weeely

Hi Chris, good to hear you got it running now! Ah - the fun part of programming :) Cheers, Mo

Entagma

Thank you Moritz! That was a silly oversight on my part. And I was looking at the wrong block. It's working now. No cross-platform issues after all. Thanks again for taking the time.

clesage

Hi Chris, turns out the block where you calculate Laplace_B also contains the same issue. When you calculate the kernel cells' indices your code reads: int nidx = A_stride_offset + A_stride_x * (gidx + xo) + A_stride_y * (gidx + yo) + A_stride_z * (gidx + zo); where it should read: int nidx = A_stride_offset + A_stride_x * (gidx + xo) + A_stride_y * (gidy + yo) + A_stride_z * (gidz + zo); That fixes the issues even with high iteration counts. Cheers, Mo

Entagma

Hi Chris, I just rechecked the example file and that's running fine (well past frame 85). Also I had a quick look at your project file. I took the liberty of fixing some openCL code and adding a few comments: <a href="https://www.dropbox.com/s/mc66nyqvvtt4ts9/chris_lesage_volumes101_opencl_reaction_diffusion_fixed.hiplc?dl=1" rel="nofollow noopener" target="_blank">https://www.dropbox.com/s/mc66nyqvvtt4ts9/chris_lesage_volumes101_opencl_reaction_diffusion_fixed.hiplc?dl=1</a> It might well be possible that running Houdini's OpenCL on a Mac might not be the most stable thing to do. We usually recommend a Linux or Windows environment for production work. Cheers, Mo

Entagma

This whole volume course is awesome! But... something strange is happening for me on this lesson. After about 10 iterations, a large slice opens in the middle and then it explodes into 2 large 2d slices. I opened your example file and it dissolves into nothing after a few frames. After 85 iterations to be precise. I even opened up an old VEX 2D reaction diffusion tutorial I did years ago in Shawn Lipowski's course. I rewrote it to work in 16.5 and it just quickly and smoothly diffuses into a large blur in a few frames. I'm carefully checking to see if I have some typos, but this is really strange. I should also note I'm on a Mac. I'm Googling to see if there are any openCL issues on Macos or my AMD graphics card. In case anyone has a chance to look, I uploaded my file here. I'll reply if I find anything too. chrislesage.com/uploads/chris_lesage_volumes101_opencl_reaction_diffusion.hiplc

clesage

Here :) <a href="https://www.patreon.com/posts/volumes-101-in-15933504">https://www.patreon.com/posts/volumes-101-in-15933504</a>

Entagma

Hey guys, thanks for sharing your knowledge ;) P.S. where is pt.15 of Volumes 101?

Remigijus Klimovas

thank you so much Entagma <3 , you guys are just pure awesomeness !

AMIRATA Ashkiani

I love you!!

adam pizurny


More Creators