Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Adequate option for painting app

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    3

    Adequate option for painting app

    Hi, just registered in hope that someone can give me some direction. I'm making a painting app for myself using OpenGL . I already have it working with some standard features such as layered painting, erasing, undo redo etc. But i came to a problem with layers and erasing. I used an FBO with multiple texture attachments for each layer and Blending for erase. I'm sure it's not the best solution, i couldn't find any references for that so i came with that solution by my own. Two problems: Isn't using multiple textures for each layer a bit much ? And about erasing , if i paint with color A on point X than with color B on the same point and set erase blend (ZERO, ONE_MINUS_SRC_ALPHA currently ) and paint on that point it'll erase everything of course , thus , it's not adequate for the case. So i thought about painting to main framebuffer instead, storing a list of points to draw, removing that FBO system entirely, and handling layers and erasing differently. Erasing than could be just a matter of deleting a point from list. Would that be more adequate for my case ? Or is should i stay with my FBO system and handle erasing differently ? Any tips ? An observation : It's a grid based paint app (pixel art painter) so if my image is 640x480 and my pen size is 16x16 there will be 40*30 = 1200 points.

    Thanks !

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,580
    Indeed for such low number of points it make sense to simply keep a list in memory (like a vector editor) for currently modified layer.
    For performance reasons, and with a large number of layers, it can be useful to keep an FBO for each layer which is not currently modified.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    3
    Thanks for the tip !

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    3
    One thing comes to mind: Is it possible to have layers with only one texture ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •