4
$\begingroup$

I am trying to create a voxelized fire simulation, and then texture it so that the center of the fire is the brightest point. Here you can see what I currently have:

The voxelized fire sim, it is 3d but I showed it from front view for simplicity's sake

To create the effect of the fire being brighter in the center, I used a gradient texture that is located at this empty, so I could have the empty follow around the center of the fire, and use the gradient to drive the colors of the fire.

The node setup for the gradient texture, the position of the gradient controlled by the empty which follows the fire around

The Result

Then to make this effect pixelated, which is really important for the look of the voxel fire, I added in a snap vector math node.

Node setup with snap math node included

The Result

Now as I'm sure you can see the problem, I can manually line up the pixels with the voxels (as they are at the beginning before the torch moves), but they aren't going to stay that way.

A better visual example of the problem. The pixels need to stay stationary as I move the gradient

I've been trying for multiple hours to figure out a solution and can't find anything online for it, and am not super good with nodes or math. Essentially, what is needed for this effect to work is a grid of pixels that are static in world space, whose brightness is affected by the gradient texture. However this is proving to be way harder than it seems.

Any help would be super appreciated! I've been trying so many different nodes in so many different orders that my brain has turned to mush, and I am completely out of ideas.

$\endgroup$
1
  • $\begingroup$ are all of your surfaces axis aligned? $\endgroup$ May 2, 2022 at 13:26

1 Answer 1

5
$\begingroup$

There may be a way that suits you in shading, to pixelate the material in Camera or Window space, but..

.. forgive me if I'm missing an important point, but your whole workflow may be simpler if you Pixelate the 2D output, using the compositor, instead of Voxelizing the 3D source, in the geometry:

enter image description here

If you did choose that way, you would leave your original fire sim and model at a high enough resolution not to interfere with the downsampling.

$\endgroup$
8
  • $\begingroup$ I don't think he wants to voxelize the 2D output, but the texture he is using on the 3D objects... at least that's what I suspect when looking at the linked "better visual example". Although the fire sim image seems to imply your answer to be the solution. $\endgroup$ May 2, 2022 at 7:15
  • $\begingroup$ @Gordon.. fair enough.. that's why the answer is so hesitant. OP may want to pixelate the texture in screen-space, while I'm suggesting it's the wrong thing to want :) Any pixelation of the material would leave the object-boundaries intact. $\endgroup$
    – Robin Betts
    May 2, 2022 at 7:26
  • $\begingroup$ Hey! Sorry I may not have explained this super well. The fire is actually 3D, I just showed it from front ortho view to make the explanation a bit simpler - but I see that made it confusing. Pixelating in screen space would look very weird, especially were the camera to move. The effect I'm trying to create is a 3D gradient texture that I can use to drive the brightness of the flame towards the center. Then, I need to pixelate that gradient, but the pixels need to remain on a static grid in world space, and only change their brightness, not position, based off the gradient. $\endgroup$ May 2, 2022 at 16:24
  • $\begingroup$ @AnthonyMadeira Hi! What method did you use for your voxelzation? Can you get the knife in there, with the brightness, so it's voxelized along with everything else? $\endgroup$
    – Robin Betts
    May 2, 2022 at 16:46
  • $\begingroup$ @RobinBetts Hey! The voxelized fire is a fire sim I did, converted to VDB, and then used another object to do volume to mesh. After the Volume to Mesh modifier I have geometry nodes that attach a big bounding around the whole thing, and then a remesh modifier to turn it into blocks. The bounding box is so the remesh modifier will use a consistent grid for the voxels, instead of jittering around (remesh is calculated using the bounding box of an object). Thanks so much for your time! Any help is massively appreciated, I've reached the end of my own knowledge here. $\endgroup$ May 2, 2022 at 21:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .