GLMakie.GridMethod

This constructor constructs a grid from ranges given as a tuple. Due to the approach, the tuple ranges can consist of NTuple(2, T) and all kind of range types. The constructor will make sure that all ranges match the size of the dimension of the array a.

GLMakie.ScreenType
Screen(; screen_config...)

Arguments one can pass via screen_config:

Renderloop

  • renderloop = GLMakie.renderloop: Sets a function renderloop(::GLMakie.Screen) which starts a renderloop for the screen.
Warning

The keyword arguments below are not effective if renderloop isn't set to GLMakie.renderloop, unless implemented in a custom renderloop function:

  • pause_renderloop = false: If true, creates a screen with a paused renderloop. The renderloop can be started with GLMakie.start_renderloop!(screen) and paused again with GLMakie.pause_renderloop!(screen).
  • vsync = false: Whether to enable vsync for the window.
  • render_on_demand = true: If true, the scene will only be rendered if something has changed in it.
  • framerate = 30.0: Sets the currently rendered frames per second.
  • px_per_unit = automatic: Sets the ratio between the number of rendered pixels and the Makie resolution. It defaults to the value of scalefactor but may be any positive real number.

GLFW window attributes

  • float = false: Whether the window should float above other windows.
  • focus_on_show = false: If true, focuses the window when newly opened.
  • decorated = true: Whether or not to show window decorations.
  • title::String = "Makie": Sets the window title.
  • fullscreen = false: Whether to start the window in fullscreen mode.
  • debugging = false: If true, starts the GLFW.Window/OpenGL context with debug output.
  • monitor::Union{Nothing, GLFW.Monitor} = nothing: Sets the monitor on which the window should be opened. If set to nothing, GLFW will decide which monitor to use.
  • visible = true: Whether or not the window should be visible when first created.
  • scalefactor = automatic: Sets the window scaling factor, such as 2.0 on HiDPI/Retina displays. It is set automatically based on the display, but may be any positive real number.

Rendering constants & Postprocessor

  • oit = false: Whether to enable order independent transparency for the window.
  • fxaa = true: Whether to enable fxaa (anti-aliasing) for the window.
  • ssao = true: Whether to enable screen space ambient occlusion, which simulates natural shadowing at inner edges and crevices.
  • transparency_weight_scale = 1000f0: Adjusts a factor in the rendering shaders for order independent transparency. This should be the same for all of them (within one rendering pipeline) otherwise depth "order" will be broken.
  • max_lights = 64: The maximum number of lights with shading = MultiLightShading
  • max_light_parameters = 5 * N_lights: The maximum number of light parameters that can be uploaded. These include everything other than the light color (i.e. position, direction, attenuation, angles) in terms of scalar floats.

Constructors:

Screen constructors implemented by all backends:

# Constructor aimed at showing the plot in a window.
Screen(scene::Scene; screen_config...)

# Screen to save a png/jpeg to file or io
Screen(scene::Scene, io::IO, mime; screen_config...)

# Screen that is efficient for `colorbuffer(screen, format)`
Screen(scene::Scene, format::Makie.ImageStorageFormat; screen_config...)

Interface implemented by all backends:

# Needs to be overload:
size(screen) # Size in pixel
empty!(screen) # empties screen state to reuse the screen, or to close it

# Optional
wait(screen) # waits as long window is open

# Provided by Makie:
push_screen!(scene, screen)
GLMakie.ScreenConfigType

Renderloop

  • renderloop = GLMakie.renderloop: Sets a function renderloop(::GLMakie.Screen) which starts a renderloop for the screen.
Warning

The keyword arguments below are not effective if renderloop isn't set to GLMakie.renderloop, unless implemented in a custom renderloop function:

  • pause_renderloop = false: If true, creates a screen with a paused renderloop. The renderloop can be started with GLMakie.start_renderloop!(screen) and paused again with GLMakie.pause_renderloop!(screen).
  • vsync = false: Whether to enable vsync for the window.
  • render_on_demand = true: If true, the scene will only be rendered if something has changed in it.
  • framerate = 30.0: Sets the currently rendered frames per second.
  • px_per_unit = automatic: Sets the ratio between the number of rendered pixels and the Makie resolution. It defaults to the value of scalefactor but may be any positive real number.

GLFW window attributes

  • float = false: Whether the window should float above other windows.
  • focus_on_show = false: If true, focuses the window when newly opened.
  • decorated = true: Whether or not to show window decorations.
  • title::String = "Makie": Sets the window title.
  • fullscreen = false: Whether to start the window in fullscreen mode.
  • debugging = false: If true, starts the GLFW.Window/OpenGL context with debug output.
  • monitor::Union{Nothing, GLFW.Monitor} = nothing: Sets the monitor on which the window should be opened. If set to nothing, GLFW will decide which monitor to use.
  • visible = true: Whether or not the window should be visible when first created.
  • scalefactor = automatic: Sets the window scaling factor, such as 2.0 on HiDPI/Retina displays. It is set automatically based on the display, but may be any positive real number.

Rendering constants & Postprocessor

  • oit = false: Whether to enable order independent transparency for the window.
  • fxaa = true: Whether to enable fxaa (anti-aliasing) for the window.
  • ssao = true: Whether to enable screen space ambient occlusion, which simulates natural shadowing at inner edges and crevices.
  • transparency_weight_scale = 1000f0: Adjusts a factor in the rendering shaders for order independent transparency. This should be the same for all of them (within one rendering pipeline) otherwise depth "order" will be broken.
  • max_lights = 64: The maximum number of lights with shading = MultiLightShading
  • max_light_parameters = 5 * N_lights: The maximum number of light parameters that can be uploaded. These include everything other than the light color (i.e. position, direction, attenuation, angles) in terms of scalar floats.
GLMakie.SelectionIDType

Selection of random objects on the screen is realized by rendering an object id + plus an arbitrary index into the framebuffer. The index can be used for e.g. instanced geometries.

Base.closeMethod
close(screen::Screen; reuse=true)

Closes screen and empties it. Doesn't destroy the screen and instead frees it to be re-used again, if reuse=true.

GLMakie.activate!Method
GLMakie.activate!(; screen_config...)

Sets GLMakie as the currently active backend and also optionally modifies the screen configuration using screen_config keyword arguments. Note that the screen_config can also be set permanently via Makie.set_theme!(GLMakie=(screen_config...,)).

Arguments one can pass via screen_config:

Renderloop

  • renderloop = GLMakie.renderloop: Sets a function renderloop(::GLMakie.Screen) which starts a renderloop for the screen.
Warning

The keyword arguments below are not effective if renderloop isn't set to GLMakie.renderloop, unless implemented in a custom renderloop function:

  • pause_renderloop = false: If true, creates a screen with a paused renderloop. The renderloop can be started with GLMakie.start_renderloop!(screen) and paused again with GLMakie.pause_renderloop!(screen).
  • vsync = false: Whether to enable vsync for the window.
  • render_on_demand = true: If true, the scene will only be rendered if something has changed in it.
  • framerate = 30.0: Sets the currently rendered frames per second.
  • px_per_unit = automatic: Sets the ratio between the number of rendered pixels and the Makie resolution. It defaults to the value of scalefactor but may be any positive real number.

GLFW window attributes

  • float = false: Whether the window should float above other windows.
  • focus_on_show = false: If true, focuses the window when newly opened.
  • decorated = true: Whether or not to show window decorations.
  • title::String = "Makie": Sets the window title.
  • fullscreen = false: Whether to start the window in fullscreen mode.
  • debugging = false: If true, starts the GLFW.Window/OpenGL context with debug output.
  • monitor::Union{Nothing, GLFW.Monitor} = nothing: Sets the monitor on which the window should be opened. If set to nothing, GLFW will decide which monitor to use.
  • visible = true: Whether or not the window should be visible when first created.
  • scalefactor = automatic: Sets the window scaling factor, such as 2.0 on HiDPI/Retina displays. It is set automatically based on the display, but may be any positive real number.

Rendering constants & Postprocessor

  • oit = false: Whether to enable order independent transparency for the window.
  • fxaa = true: Whether to enable fxaa (anti-aliasing) for the window.
  • ssao = true: Whether to enable screen space ambient occlusion, which simulates natural shadowing at inner edges and crevices.
  • transparency_weight_scale = 1000f0: Adjusts a factor in the rendering shaders for order independent transparency. This should be the same for all of them (within one rendering pipeline) otherwise depth "order" will be broken.
  • max_lights = 64: The maximum number of lights with shading = MultiLightShading
  • max_light_parameters = 5 * N_lights: The maximum number of light parameters that can be uploaded. These include everything other than the light color (i.e. position, direction, attenuation, angles) in terms of scalar floats.
GLMakie.depthbufferMethod
depthbuffer(screen::Screen)

Gets the depth buffer of screen. Returns a Matrix{Float32} of the dimensions of the screen's framebuffer.

A depth buffer is used to determine which plot's contents should be shown at each pixel. Usage:

using Makie, GLMakie
x = scatter(1:4)
screen = display(x)
depth_color = GLMakie.depthbuffer(screen)
# Look at result:
heatmap(depth_color, colormap=:grays)
GLMakie.draw_pixel_scatterMethod

This is the most primitive particle system, which uses simple points as primitives. This is supposed to be the fastest way of displaying particles!

GLMakie.draw_scatterMethod

Main assemble functions for scatter particles. Sprites are anything like distance fields, images and simple geometries

GLMakie.get_loading_imageMethod
get_loading_image(resolution)

Loads the makie loading icon, embeds it in an image the size of resolution, and returns the image.

GLMakie.to_index_bufferMethod

If already GLuint, we assume its 0 based (bad heuristic, should better be solved with some Index type)

GLMakie.to_screen_postprocessorFunction
to_screen_postprocessor(framebuffer, shader_cache, default_id = nothing)

Sets up a Postprocessor which copies the color buffer to the screen. Used as a final step for displaying the screen. The argument screen_fb_id can be used to pass in a reference to the framebuffer ID of the screen. If nothing is used (the default), 0 is used.

Makie.dropped_filesMethod

Registers a callback for drag and drop of files. returns Observable{Vector{String}}, which are absolute file paths GLFW Docs

Makie.entered_windowMethod

Registers a callback for if the mouse has entered the window. returns an Observable{Bool}, which is true whenever the cursor enters the window. GLFW Docs

Makie.hasfocusMethod

Registers a callback for the focus of a window. returns an Observable{Bool}, which is true whenever the window has focus. GLFW Docs

Makie.mouse_positionMethod

Registers a callback for the mouse cursor position. returns an Observable{Vec{2, Float64}}, which is not in scene coordinates, with the upper left window corner being 0 GLFW Docs

Makie.scrollMethod

Registers a callback for the mouse scroll. returns an Observable{Vec{2, Float64}}, which is an x and y offset. GLFW Docs

Makie.unicode_inputMethod

Registers a callback for keyboard unicode input. returns an Observable{Vector{Char}}, containing the pressed char. Is empty, if no key is pressed. GLFW Docs

GLMakie.GLAbstraction.GLVertexArrayType

Represents an OpenGL vertex array type. Can be created from a dict of buffers and an opengl Program. Keys with the name indices will get special treatment and will be used as the indexbuffer.

GLMakie.GLAbstraction.TextureMethod

Constructor for a normal array, with color or Abstract Arrays as elements. So Array{Real, 2} == Texture2D with 1D Colorant dimension Array{Vec1/2/3/4, 2} == Texture2D with 1/2/3/4D Colorant dimension Colors from Colors.jl should mostly work as well

GLMakie.GLAbstraction.TextureMethod

Constructor for empty initialization with NULL pointer instead of an array with data. You just need to pass the wanted color/vector type and the dimensions. To which values the texture gets initialized is driver dependent

Base.lengthMethod

returns the length of the vertex array. This is amount of primitives stored in the vertex array, needed for glDrawArrays

GLMakie.GLAbstraction.renderFunction

Renders a RenderObject Note, that this function is not optimized at all! It uses dictionaries and doesn't care about OpenGL call optimizations. So rewriting this function could get us a lot of performance for scenes with a lot of objects.

GLMakie.GLAbstraction.renderMethod

Renders a vertexarray, which consists of the usual buffers plus a vector of unitranges which defines the segments of the buffers to be rendered

GLMakie.GLAbstraction.@gen_defaults!Macro

Takes a dict and inserts defaults, if not already available. The variables are made accessible in local scope, so things like this are possible: gen_defaults! dict begin a = 55 b = a * 2 # variables, like a, will get made visible in local scope c::JuliaType = X # c needs to be of type JuliaType. c will be made available with it's original type and then converted to JuliaType when inserted into dict d = x => GLType # OpenGL convert target. Get's only applied if x is convertible to GLType. Will only be converted when passed to RenderObject d = x => "doc string" d = x => (GLType, "doc string and gl target") end