subflame

Description

The subflame_wf variation allows using a flame as part of another flame. This is useful for providing textures and filling in blank spaces. It is often possible to accomplish similar results using Xaos, but using subflames is often simpler.

There are two key points to understand when working with subflame_wf:

  • Subflame_wf is a blur variation, meaning it ignores its input like other blur variations such as circleblur and starblur. But the shape of subflame_wf depends on the embedded flame, which also provides a texture. This also means that subflame_wf ignores the pre-affine transform. Use the post-affine transform to rotate or scale the subflame.
  • Only the settings in the Transformations tab are used in subflames. None of the items in the tabs at the bottom of the JWildfire flame editor window are used. For example, the Camera settings are ignored; things like rotating and resizing the subflame must be done in the flame that includes it. The subflame gradient is ignored, and only the first layer is used.

Before we get to the technicalities of how to use it, let’s see an example of subflame_wf. We’ll start with a plastic style flame that uses a blur iterated by spherical with a bit of linear. The parameters for this and the other examples are in the accompanying flame pack.

Name: subflame_wf
Type: 3D blur
Author: Andreas Maschke

Now we change the blur to subflame. We’ll use the default flame, but need to make some small adjustments to make it fit. First, the default subflame isn’t centered, so we need to center it by setting the offset parameters: offset_x to 2.5 and offset_y to 0.15. Then we need to shrink the subflame. For most blurs, we can do this with the variation amount field (it was set to 0.5 for blur above), but subflame_wf ignores that. Instead, we go to the Affine tab, set Post TF, and shrink the triangle by 300%. The subflame is still bigger than the blur was, so it overlaps a bit. Here is the result.

It shows the effect, but the result is frankly not very exciting. So let’s use a subflame of our own. Here is a flame I made awhile ago using the splits-ngon tutorial. It promises to be a more interesting pattern for our plastic.

We specify the subflame using the flame parameter. First, create or open the flame to be used as the subflame, then while editing that flame click To Clipboard. Then we switch to the flame that will use the subflame and select the transform with the subflame_wf variation. Be sure that “flame” is chosen and click the gear icon to the far right to edit the flame; the XML representation of the flame will appear. It can be edited directly, but we normally right-click and choose Select All (or press Ctrl-A), the right-click and choose Paste (or press Ctrl-V). This will paste the flame that we just copied to the clipboard as the new subflame. Click OK to close the editor.

Here, we’ll go back to the original plastic flame and, again, change blur to subflame_wf. We edit the flame and paste in the splits-ngon flame. The flame is too big, so we reduce the post-affine transform by 200% to make it fit.

It looks promising, but we’re putting a square peg into a round hole. It would look nicer if we could turn the square into a circle. There’s a trick that will let us do just that: add prepost_circlize as a second variation with an amount of 1. That variation circlizes the flame before the normal variations, then uncirclizes it afterwards. But since blur variations ignore the input, it just uncirclizes the blur. We want the opposite, so we set reverse to 1. Now the subflame fills in the circle.

Let’s make one more change: we’ll set the subflame_wf color_mode parameter to 0. The default value, -1, means to not do anything to the color. The colors are set according to the Color and Speed values on the Color tab, so the colors are the same as in the original plastic flame. Color_mode 0 means to use direct color, which uses the gradient index from the subflame instead of the normal color calculation. (The colors themselves aren’t copied, just the index; the colors come from the gradient of the main flame, not the subflame.)

Subflames are also useful for filling in gaps. We’ll use glynnSim3 as an example. We won’t get into the details of how glynnSim3 works here, but it leaves an empty ring just waiting to be filled somehow. There are lots of ways to do fill the ring; see the Circular Flame Tutorial by pillemaster (and the JWildfire adaptation of it) and the Filling Glynnsim3 Tutorial by tatasz for example. Here we’ll use a subflame.

Let’s start with a blank glynnSim3, made by adding a transform to a new blank flame and changing the variation to glynnSim3. The glynnSim3 thickness parameter specifies how thick the ring will be; since we will fill it with a nice design, we want it pretty thick; let’s use 0.4. Next we modify the pre-affine triangle: rotate it 90° left and move it 2.1 units right. Center it by setting CentreX to 1 and CentreY to -1 in the Camera tab. In preparation for the next steps, we set the weight to 1, the color to 0.5 and the speed to 0.75. This gives a nice glynnSim3 starting point.

We’ll fill in the rings using subflame with the same splits-ngon flame we used above. Since it is difficult to create a ring-shaped flame with the perfect proportions, we’ll adapt the flame to fit the rings by cropping the subflame. The first step is to add a new transform and change the variation to subflame_wf, click the gear icon, and paste in the splits-ngon flame. Change color_mode to 0 to make it more colorful. Since we are going to crop the subflame, we need to size it to fit in the rings, so we enable post transform mode and scale it by eye until the subflames cover the rings. It’s not very pretty yet, but here’s what it looks like.

We crop the subflame using two instances of post_smartcrop. With the subflame transform selected, we set variation 2 to post_smartcrop. To crop to a circle, set distortion to 0. To crop the inside set radius to a negative value, like -0.1, then adjust the value until the inner circle matches the glynnSim3 ring. Then set variation 3 to post_smartcrop and set distortion to 0. Then reduce the radius until the outer circle matches the glynnSim3 ring.

This is just a starting point. To make it more interesting, select the glynnSim transform and tweak the triangle. Make it bigger, rotate it, and move it to find a nice arrangement, like this.

Continue with the normal tweaks: add additional transforms (including a final transform), change the gradient, etc. We can even use this as a subflame in another flame (nesting subflames is allowed)! But that’s beyond our scope here. We’ve covered the most common subflame_wf parameters, so just a few words on the less common parameters.

The subflame can also be specified as a file using the flame_filename parameter. Select flame_filename and click the gear icon to choose a file. This make the flame definition less portable since the flame file needs to exist with that specific name when the flame is rendered. The main reason to use flame_filename is to make animated flames with animated subflames. We first need to prepare the animated subflame using the JWildfire movie maker, using Generate sequence with the output type FLAMES and some base filename, like “abc”. This will generate a sequence of files with names like abc0001.flame, abc002.flame, and so on.

When making the animated flame, use flame_filename to choose the first flame in the sequence (abc0001.flame), then set flame_is_sequence to 1. Change flame_sequence_start and flame_sequence_digits if needed. When the main movie is rendered, each frame of the movie will use the corresponding subflame.

The colorscale_z parameter scales the color index from the subflame and adds it to z, much like the colorscale_wf variation. The default of 0 disables this.

Although the examples given here are 2D, subflame_wf does support 3D flames. Like all flames, only the flame structure as defined in the Transformations tab is used. If solid rendering is desired, it must be set in the main flame; the setting of the subflame is ignored.

There may be a “SubFlame” button below the preview image. The buttons here run scripts and can be customized. If present, it runs the built-in script Wrap into SubFlame, which wraps the current flame into a subflame and adds some additional transforms. This can also be run from the Scripts tab.

Parameters

variation amountIgnored for subflame_wf.
flameThe flame to be used. (Ignored if a flame_filename is set.)
flame_filenameThe name of a file containing the flame to be used.
offset_x
offset_y
offset_z
Shifts the flame by the specified amount.
colorscale_zMultiply the flame’s gradient index by this and add to z (like colorscale_wf).
color_modeSpecifies how to handle colors. Useful values are:
-1 (Off) – Ignore the subflame color index
0 (Direct) – Use the color index from the subflame (but with the main flame gradient)
flame_is_sequenceIf 0, the flame is not a sequence. If 1, and a flame_filename was specified, the flame is actually a sequence of flames. This allows using a different subflame in each frame of an animation.
flame_sequence_startThe first frame sequence number.
flame_sequence_digitsThe number of digits in the flame sequence number. For example, the default value of 4 uses filenames such as abc0001.flame, abc0002.flame, and so forth.

Resources

Flame pack (flames used above)
JWildfire Subflame Tutorial by Andreas Maschke
Subflame at Fractal Formulas by Rick Sidwell

Related Posts

You may be interested in ...

1 thought on “subflame”

Leave a Comment