FLAM3 and palette usage

  • 3 Replies
  • 80 Views

0 Members and 1 Guest are viewing this topic.

Offline rbag183

  • *
  • Fractal Freshman
  • *
  • Posts: 2
« on: June 13, 2018, 08:36:45 AM »
Hello,

I develop a simple FLAM3 javascript program based on the flam3 paper. In the original paper each flame has a color and the color is blended for each point with the preceding color, ie:

pointColor = (pointColor + flameColor) / 2

It works well and you can easily see which flame impacted a point (see attached images), but I struggle to understand the palette concept.

Programs like Apophysis or others use a palette to display the flame, but I don't see how can I use a palette with the average calculation. Can someone explain me the concept of palette coloring ?

Offline claude

  • *
  • Fractal Freak
  • **
  • Posts: 662
    • mathr.co.uk
« Reply #1 on: June 13, 2018, 02:51:59 PM »
As far as I understand it, the flam3 palette algorithm works like this, adding an extra layer of indirection:

Code: [Select]
int index
vec2 point
float colour
vec4 rgba
until image looks good enough
{
  index = random choice up to flame count
  point = flametransform[index](point)
  colour = (colour + flamecolour[index]) / 2
  rgba = imagepalette(colour)
  accumulateimage(point, rgba)
}

The imagepalette lookup table takes flamecolour indices in [0..1] and gives you RGB(A) colours, the RGB(A) colours in the palette don't need to be a simple smooth gradient, which means you can highlight different structures in the flames more easily.

Offline rbag183

  • *
  • Fractal Freshman
  • *
  • Posts: 2
« Reply #2 on: June 13, 2018, 06:41:01 PM »
Thanks for your answer, I managed to implement something like that, the result seems satisfying.

Any hint to increase image quality ?

Offline claude

  • *
  • Fractal Freak
  • **
  • Posts: 662
    • mathr.co.uk
« Reply #3 on: June 13, 2018, 08:44:28 PM »


xx
Palette Selection

Started by mdudley on Kalles Fraktaler

4 Replies
253 Views
Last post May 07, 2018, 04:54:35 AM
by panzerboy
moved
MOVED: Palette Selection

Started by Fraktalist on Forum Help And Support

0 Replies
88 Views
Last post April 26, 2018, 08:38:43 PM
by Fraktalist
xx
Reducing CPU Usage?

Started by zxs on Mandelbulb3d

6 Replies
133 Views
Last post July 14, 2018, 09:37:28 PM
by Kalter Rauch
xx
Depth of field usage

Started by Micha1982 on Mandelbulber

8 Replies
160 Views
Last post April 07, 2018, 07:44:31 AM
by Micha1982
xx
Question about usage in general

Started by Xerilon on Mandelbulb3d

11 Replies
437 Views
Last post August 01, 2018, 04:44:11 AM
by Kalter Rauch