mightymandel v16

GPU-based Mandelbrot set explorer

colour::fp32::frag Class Reference

Fragment Shader. More...

Public Member Functions

out layout (location=0, index=0) vec4 c
 Output RGBA colours.
ivec2 local_coords (ivec2 it)
 Compute slice block local coordinates for a pixel.
ivec2 global_coords (ivec2 it)
 Compute slice block global coordinates for a pixel.
ivec2 block_coords (int block)
 Look up slice block local coordinates for slice block number.
int block_number_raw (ivec2 it, int level)
 Look up slice block number for slice block local coordinates.
int block_number (ivec2 it)
 Compute best block number for a pixel.
int delta ()
 Compute pixel delta for neighbours.
ivec2 quantize_coords (ivec2 it)
 Rejig the coordinates for a pixel so that they are in a computed slice.
vec4 colour (ivec2 it0, ivec2 dims)
 Compute the colour for a pixel.
void main ()
 Compute the colour for a pixel, optionally masking glitches.

Data Fields

uniform sampler2D ida0
 Raw iteration results texture.
uniform usampler2D slice_number
 Slicing coordinates to number texture.
uniform usampler2D slice_coords
 Slicing number to coordinates texture.
uniform bool update
 Colour uncalculated pixels.
uniform bool update2
 Use small slice deltas.
uniform bool errs
 Highlight glitches.
uniform float thickness
 Boundary thickness.
uniform ivec2 slicing
 Slicing parameters.
smooth in vec2 t
 Texture coordinate for the current pixel.

Detailed Description

Fragment Shader.

Definition at line 6 of file fp32_colour_frag.glsl.

Member Function Documentation

ivec2 colour::fp32::frag::block_coords ( int  block)
inline

Look up slice block local coordinates for slice block number.

Parameters
blockSlice block number.
Returns
Slice block local coordinates.

Definition at line 120 of file fp32_colour_frag.glsl.

int colour::fp32::frag::block_number ( ivec2  it)
inline

Compute best block number for a pixel.

Parameters
itSlice block local coordinates.
Returns
Slice block number.

Definition at line 143 of file fp32_colour_frag.glsl.

int colour::fp32::frag::block_number_raw ( ivec2  it,
int  level 
)
inline

Look up slice block number for slice block local coordinates.

Parameters
itSlice block local coordinates.
levelMipmap level.
Returns
Slice block number.

Definition at line 133 of file fp32_colour_frag.glsl.

vec4 colour::fp32::frag::colour ( ivec2  it0,
ivec2  dims 
)
inline

Compute the colour for a pixel.

If errs is enabled, glitched pixels are highlighted in red.

Unescaped pixels are coloured yellow.

Exterior pixels are coloured using distance estimates. If DE is enabled, then it uses the distance estimate to colour. If DE is not enabled, then a fake distance estimate colouring based on neighbouring pixels iteration counts is used. See: http://mathr.co.uk/blog/2014-12-13_faking_distance_estimate_colouring.html

Parameters
it0The texture coordinates.
dimsThe size of the texture.
Returns
The RGBA colour. Alpha is 0 when a meaningful colour could not be computed.

Definition at line 228 of file fp32_colour_frag.glsl.

int colour::fp32::frag::delta ( )
inline

Compute pixel delta for neighbours.

Returns
Pixel delta.

Definition at line 182 of file fp32_colour_frag.glsl.

ivec2 colour::fp32::frag::global_coords ( ivec2  it)
inline

Compute slice block global coordinates for a pixel.

Parameters
itPixel coordinates.
Returns
Slice block global coordinates.

Definition at line 108 of file fp32_colour_frag.glsl.

out colour::fp32::frag::layout ( location  = 0,
index  = 0 
)

Output RGBA colours.

ivec2 colour::fp32::frag::local_coords ( ivec2  it)
inline

Compute slice block local coordinates for a pixel.

Parameters
itPixel coordinates.
Returns
Slice block local coordinates.

Definition at line 95 of file fp32_colour_frag.glsl.

void colour::fp32::frag::main ( )
inline

Compute the colour for a pixel, optionally masking glitches.

If errs is set, just calls colour() for each pixel. Otherwise, glitched pixels are coloured by merging the colour()s from non-glitched neighbours – if there are no non-glitched neighbours then use black as a last resort.

Definition at line 304 of file fp32_colour_frag.glsl.

ivec2 colour::fp32::frag::quantize_coords ( ivec2  it)
inline

Rejig the coordinates for a pixel so that they are in a computed slice.

Parameters
itPixel coordinates.
Returns
Pixel coordinates in a computed slice.

Definition at line 201 of file fp32_colour_frag.glsl.

Field Documentation

uniform bool colour::fp32::frag::errs

Highlight glitches.

true: highlight glitched pixels in red, colour other pixels normally.

false: try to mask glitched pixels by blending neighbouring pixels.

Definition at line 62 of file fp32_colour_frag.glsl.

uniform sampler2D colour::fp32::frag::ida0

Raw iteration results texture.

Has two semantic formats depending whether DE is enable:

  • DE enabled: vec3(iters, error, de)
  • DE disabled: vec2(iters, error)

iters is the continuous (smooth) iteration count. Escaped pixels have iters > 0.

error is the glitch detection error count (for fpxx calculations). Glitched pixels have error != 0.

de is the distance estimate relative to pixel size. Far exterior pixels have de > 4.

Definition at line 28 of file fp32_colour_frag.glsl.

uniform usampler2D colour::fp32::frag::slice_coords

Slicing number to coordinates texture.

Definition at line 38 of file fp32_colour_frag.glsl.

uniform usampler2D colour::fp32::frag::slice_number

Slicing coordinates to number texture.

Definition at line 33 of file fp32_colour_frag.glsl.

uniform ivec2 colour::fp32::frag::slicing

Slicing parameters.

x : slice_n y : slice

Definition at line 77 of file fp32_colour_frag.glsl.

smooth in vec2 colour::fp32::frag::t

Texture coordinate for the current pixel.

Definition at line 82 of file fp32_colour_frag.glsl.

uniform float colour::fp32::frag::thickness

Boundary thickness.

Lower values give a darker image, high values can make aliasing more visible.

Definition at line 69 of file fp32_colour_frag.glsl.

uniform bool colour::fp32::frag::update

Colour uncalculated pixels.

false: discard pixels marked as uncalculated.

Definition at line 45 of file fp32_colour_frag.glsl.

uniform bool colour::fp32::frag::update2

Use small slice deltas.

true: force delta = 1 false: compute delta based on slice count

Definition at line 53 of file fp32_colour_frag.glsl.


The documentation for this class was generated from the following file: