Volumes 101 – pt. 14: Kernels, Sharpening A Smoke Sim by Moritz 09.10.2019 comments 5 Part of: Volumes 101 Premium Course, Volumes 101 Premium Content, Volumes To view this content, you must be a member of Entagma's Patreon at $29 or more Unlock with Patreon
why start with minus one when writing the for loop of our kernel step?
This is how the center voxel is found, it will be the only one in the grid with a value < 0 thereby triggering the if (d < 0) conditional.
If I’m understanding correctly, expanding the grid from 3×3 to 5×5, 7×7, etc is done by increasing the conditional value on the nested if statements, i.e. xo <= 1 becoming xo <= 2 would create a 5×5 grid. Is that correct?
That is correct. Remember that you will need to adjust the initial value for your xo, yo, and zo if you wish to make use of a different kernel grid.
I think the initial values of xo, yo, and zo should be properly declared at the top of the code. Thus you will not have to go over one after the other every time you want to change the values. At the same time, that variables should take care of the value in the if statement. Even more, you can promote a set of a few variables and make all the computation internally in the nested for loops.
I just have a question. Is there any reason for the -14, or is it just a random value after tweaking?