nannou-org/nannou

Colormapping and render-to-texture

Open

#718 aberto em 28 de mar. de 2021

Ver no GitHub
 (0 comments) (1 reaction) (0 assignees)Rust (254 forks)batch import
graphicshelp wanted

Métricas do repositório

Stars
 (4.662 stars)
Métricas de merge de PR
 (Mesclagem média 24d 15h) (26 fundiu PRs em 30d)

Description

I've been working on a program that iteratively creates an image that is monochrome. I do so by drawing to an initially fully black frame using white color and low alpha values and not clear the image between frames.

This works pretty well so far, but I'd like to go one step further and have a colormapping to make the output a bit more interesting. Essentially, there would be a function

fn colormap(in: Color) -> Color;

between the image that I draw to and what is actually shown on screen. However, I am currently lost how I would do this in Nannou. I'd have to draw to some kind of texture or off-screen surface for my actual grayscale data and then pixel-by-pixel map to the actual output colors.

I'm pretty new to Nannou so I hope the question isn't too naive. But is it possible to do what I want to achieve?

Guia do colaborador