Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uPainter - a unity painter toolset

Discussion in 'Assets and Asset Store' started by wing6031, Apr 10, 2022.

  1. wing6031

    wing6031

    Joined:
    Jul 2, 2015
    Posts:
    13
    Asset Store
    Online Demo
    Online Manual

    This package can help your application to add paint function more faster and easier; Easy to paint or draw on rendertexture;
    - Full source code included.you can extends - your own brush by brush piple line;
    - Support Unity5.6+;
    - Cross platform support, test on: Windows|Mac|iOS|Android;
    - Support Runtime|Editor mode;
    - You can write your own drawer for other platform or ui system just adapt the interactive input data;
    - You can make your own brush just by change the brush properties' value;
    - You can extend the painter to other ui system or other interactive system just in few lines code;

    Main Features:
    * Paint in runtime
    * Paint in editor mode
    * Paint in GPU
    * Solid brush
    * Texture brush
    * Graphic brush
    * Composite brush
    * Fill Tool
    * Pixel Mode
    * More blend type
    * Post effect
    * Undo/Redo
    * Draw on RenderTexture
    * Draw on UI
    * Draw on Sprite
    * Draw on mesh/skinned mesh
     
    Last edited: Apr 11, 2022
    DragonCoder likes this.
  2. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,677
    Nice to see a support thread for this!

    Had seen this asset some time ago and it's high on my to-buy list. It has several features I've not seen in other painting assets.
    Especially like how you involve texturing.

    Is it possible for the shader that's painting, to access previous, underlying pixels? Like what's on the canvas below?
    That would allow to levitate this to a true drawing application by making it possible to implement things like a blur-brush and brushes with special blendmodes.

    Another two cool features that come to mind:
    - Support for layers (preferably also with customizable blendmodes)
    - Selections (effectively a brush to create a temporary mask so that subsequent brushes are only applying on that selection. A "wand" auto selection like the fill brush would be ideal and the possibility to have a mask with varrying opacity would be the icing on the cake.)

    Keep up the good work :)
     
  3. wing6031

    wing6031

    Joined:
    Jul 2, 2015
    Posts:
    13
    Thanks for you like it. current drawing circle can access previeous one. and indeed there has multiply layers without blend. blend support previous draw and current.
    and i think current features is enough. After all unity is a game engine, less person will buy this :-(.
    i will wrote some utillity tools for you. Do you have any suggestion?
    and give me a email, i can give you a voucher, wish you like it. :)
     
  4. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,677
    That is useful to know! If your shaders are somewhat easy to understand, I can probably add features myself then :)

    Very understandable!

    Hmm, something I recently failed to find in the asset store: A good implementation of a serializable quadtree (2D) or octree (3D).
    By that I mean a data structure that allows you to add and access location-based data efficiently and has no predefined boundaries (so it can grow automatically and be used for near-infinite procedural worlds).

    That is really generous. Will send a note!


    By the way, perhaps you should add a link to the asset directly here in the thread :)
     
    wing6031 likes this.
  5. wing6031

    wing6031

    Joined:
    Jul 2, 2015
    Posts:
    13
    Thanks for your replay, i will do it.
     
  6. wing6031

    wing6031

    Joined:
    Jul 2, 2015
    Posts:
    13
    I think that's a good suggestion, i think a toolset like GIS will be good. useful SLG and other large map.
    And look my new asset EasyLoader, how do you think about it
     
  7. KaPow1

    KaPow1

    Joined:
    Jan 27, 2013
    Posts:
    9
    Hi, thanks for this toolset! Been working with it for the past few weeks and I'm so happy with how quickly I was able to drop in the toolset and hit the ground running!

    Question - I'm using the solid brush and trying to get some sort of compromise between Line and Dash paint modes. I need the user to be able to make smooth connected lines even when quickly painting (instead of a series of dots like Dash), but I need the user to be able to tap once and create a dot (without dragging). I can get the smooth line with Line or the paint-on-tap with Dash, but I need a combination of the two.

    Below is a picture of a line drawn in Line mode (left) and a line drawn in Dash mode (right). I want the smoothness of Line but still be able to tap once for a dot - currently it only starts drawing if I drag the pointer while holding down.

    upload_2022-6-23_15-5-21.png

    I've tried modifying ScratchBrush.cs NeedPaintNumber and Draw() method to require one point instead of 4, but still can't quite get the solution I'm looking for.

    Is there an easy way to do this, or a built-in way that I'm missing?

    Thanks!
     
  8. KaPow1

    KaPow1

    Joined:
    Jan 27, 2013
    Posts:
    9
    I was able to find a workaround that acts as a merge between the two line types. In SpriteDrawer.cs Update() function I added a bit of code to the top of the raycast:

    Code (CSharp):
    1.             var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    2.             RaycastHit hitInfo;
    3.             if (Physics.Raycast(ray, out hitInfo))
    4.             {
    5.                 var paintObject = hitInfo.transform.GetComponent<PaintCanvas>();
    6.                 var touchDown = Input.GetMouseButton(0);
    7.  
    8.                 // Beginning of my code
    9.                 ScratchBrush scratchBrush = _drawer?.CurrentCanvas?.Brush as ScratchBrush;
    10.                 if (scratchBrush != null)
    11.                 {
    12.                     if (Input.GetMouseButtonDown(0))
    13.                     {
    14.                         scratchBrush.PaintMode = EPaintMode.Dash;
    15.                     }
    16.                     else
    17.                     {
    18.                         scratchBrush.PaintMode = EPaintMode.Line;
    19.                     }
    20.                 }
    21.                 ...
    I check if this is the first frame of a drag/tap and if so set the Paint mode to Dash - otherwise set to Line. This creates the effect I'm looking for - smooth lines with the ability to tap once to make a dot.

    Is there a better way to achieve this same effect?
     
  9. amberfelt

    amberfelt

    Joined:
    Jul 15, 2021
    Posts:
    2
    I have added your asset to my game but it is clearing out the drawing when the scene loads. Please, how do I save and reapply the image and be able to continue drawing on top of it when the scene loads again? Thank you.
     
  10. amberfelt

    amberfelt

    Joined:
    Jul 15, 2021
    Posts:
    2
    I figured it out. Thanks
     
  11. Till_LeFx

    Till_LeFx

    Joined:
    Dec 1, 2016
    Posts:
    9
    I am satisfied with your tool, good work!

    Maybe you could solve my problem: How can I achieve painting on a transparent canvas (e.g. in the "Painter" scene)? As expected, reducing color-alpha doesn't work, as it affects both texture (background/canvas) and the painter. Can you please provide a shader which enables that feature? Thank you in advance
     
  12. wanderw

    wanderw

    Joined:
    Dec 8, 2014
    Posts:
    5
    If the canvas is not full screen, the line is drawn in different directions, and the size of the line segment is different, and the line segment will be compressed and deformed.
     

    Attached Files: