2
$\begingroup$

I'm trying to get a candle flame to be colored with a gradient. My problem is that the candle flame move as the candle melt. Everything is made in Geometry Nodes. And the flame is a volume.

And so I find myself stuck because:

  • I can't use any sort of UV, they all seems to disappear because of the Mesh to Volume node. Even capturing attribute before using the volume don't work.
  • I can't use the generated UVs because the instance is moving. Therefore, the position also changes, and as a result, the gradient that changes the color of the flame color. But the gradient should always stay the same, even if the flame moves down.

Here is a quick doodle to show what I mean and want.
On the left, what I would like to have. On the right, what happens: enter image description here

I am at a bit of a loss. Here is the file:
https://drive.google.com/file/d/1XgJRJ5Orqd1JZ0j3hTKhj9lNpxvtyAmO/view?usp=share_link

thanks in advance!

$\endgroup$

1 Answer 1

3
$\begingroup$

The first and most important part is that you first create the flame as a separate object in a separate node tree.

If you create everything in one node tree, as in your example, the position of the volume will change.

You can then integrate this standalone flame into the candle's node tree with Object Info and Instance on Points.

The main point is: You can't apply the UVs of your original mesh to a volume, because it has no faces and there are no UV-attributes.

But you can use the node Texture Coordinate in the shader, for example, and since the candle flame always stays in the same object space, the gradient always stays in the same area.

enter image description here

PS: Of course, you would then also have to design the movement of the flame a little differently, since the noise texture is no longer influenced solely by the change in position of the flame.


(Blender 3.3+)

$\endgroup$
2
  • $\begingroup$ Thank you so much I was so focused on making it work in one single tree, I didn't even think of making the flame a volume in the object flame, and then instance that, that was so simple. Thank you! $\endgroup$ Jan 6, 2023 at 22:02
  • 1
    $\begingroup$ @FelinaFaerlaingal You are welcome! For your peace of mind: I don't always think of everything either, and am sometimes just as surprised how simple some things can work ;-) $\endgroup$
    – quellenform
    Jan 6, 2023 at 22:12

You must log in to answer this question.

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