rust painting app

Joseph Parker 475c26be40 painting demo 1 year ago
.vscode 0cdef517f9 switched to miniquad, mouse in shader 1 year ago
src 475c26be40 painting demo 1 year ago
.gitignore 0cdef517f9 switched to miniquad, mouse in shader 1 year ago
Cargo.lock 0cdef517f9 switched to miniquad, mouse in shader 1 year ago
Cargo.toml 0cdef517f9 switched to miniquad, mouse in shader 1 year ago
README.md 475c26be40 painting demo 1 year ago

README.md

TODO

  • [] center fullscreen quad at texture dimension ratio
  • [] mouse position as a uniform
  • [] shader 'draws' mouse position (when mousedown)
  • [] render texture feedback loop

JOURNAL

6-6-2022

I am attempting to use a shader to render to the canvas texture. I believe you have to use two textures, render the brush strokes to one, then copy it to the other (which was displayed in the first scene)

Offscreen pass
 - render quad with "canvas_texture" using painting shader
 - renders to "color_img" render texture

Visible pass
 - renders full screen "color_img" on quad

Copy "color_img" to "canvas_texture" every frame

I have the two passes set up (started from https://github.com/not-fl3/miniquad/blob/master/examples/offscreen.rs) but both passes are only drawing 1 tri and the cursor axis are all messed up (i had the cursor shader working last night) Unsure where I'm going wrong

Aha ok i had my pipeline VertexAttribute set to Float3 not Float2, now i see both passes on screen

Got painting working, even a smooth brush. Going to backshelf this idea for a spell.