[RELEASED] 2D/3D Paint

4595563--1065842--social.png


https://www.youtube.com/watch?v=CI8CYT-dJOs

«2D/3D Paint» - a universal solution for Unity that allows to paint on 2D and 3D objects. You can also create a modern paint app with incredible features and outstanding performance!
Unity 2019-2022 supported.

WebGL Demo: https://unitymedved.bitbucket.io/XDPaint/3.0/index.html
Documentation: https://unitymedved.bitbucket.io/XDPaint/3.0/Docs/index.html
Asset Store: https://assetstore.unity.com/packages/slug/212475

✔️ Easy to use
No code-writing skills are required: just add a component, set up a few parameters and there you go

✔️ High performance, works perfectly on mobile
Asset uses GPU for painting, which provides high performance, and works even on mobile device

✔️ Works with any Shader
The asset allows you to paint using any shaders and materials. Just choose from the list of textures you want to paint and you're set!

✔️ Supports 3D components
Paint on animated objects with a great performance! MeshRenderer and SkinnedMeshRenderer are supported. Check out the WebGL demo and see how it's easy and cool

✔️ Supports 2D components
Want paint in 2D too? No problem! SpriteRenderer and RawImage are supported. You can even create your own mobile paint app

✔️ Supports VR
2D/3D Paint works with any VR device!

[NEW] ✔️ Supports Layers and Blending Modes
Paint on layers, merge, create new and use blending modes to get your desired effect

[NEW] ✔️ Supports Layer Mask
Layers support masks, so you can hide part of the layer using a mask texture

[UPDATED] ✔️ Supports brushes
Choose a brush and paint whatever you want! You can add your custom brushes and configure parameters, like size, color, hardness, and opacity, or use built-in 58 brushes presets

[UPDATED] ✔️ Includes tools
— Brush
— Erase
[NEW] Bucket
— Eyedropper
— Brush Sampler
— Clone
— Blur
— Gaussian Blur
[NEW] Grayscale Tool
Be sure that more tools will be coming in future updates ;)

✔️ Draw from code
Want to paint on any objects and not just use Input? Sure, you can draw on objects from code

[NEW] Works with Pixel Art graphics
You can draw with pixel-by-pixel precision

[NEW] ✔️ Input System supported
Asset works with a mouse, touch device, pen (tablet stylus like Apple Pen) or VR controller, or any other input device of the new Input System. The old Input Manager is supported

✔️ Pressure support
Use an Apple pencil or any other device with pressure support for the best paint results

✔️ No colliders required
No need to add any colliders for work

✔️ Works with any render pipeline
Standard, Universal Render Pipeline (URP), and High Definition Render Pipeline (HDRP) are supported

[UPDATED] ✔️ Undo / Redo
Did some miss-click and want to undo your action? Undo and redo are supported. Undo/redo system also supports layers parameters

[NEW] ✔️ Ability to save changed textures / layers
Want to save your result painting? No problem, the asset supports it

Allows getting the average color of the texture
Check the average color of painting with high performance using GPU

Supports drawing using collisions
Drawing using collisions is supported and implemented in a few clicks!

Long Term Support
Be sure that you'll get support for newer unity versions and new features. I'm preparing a ton of new features, stay tuned ;)

Full C# source code and example scene included

1 Like

HI, Can you tell me what the drawing functions are of your package? I am looking for something I can drive programmatically to draw on a texture at run-time.

[quote=“Jeff-Kesselman”, post:2, topic: 745285]
HI, Can you tell me what the drawing functions are of your package? I am looking for something I can drive programmatically to draw on a texture at run-time.
[/quote]
Hi! Thanks for your question! Sure, you can draw from code. For example, you can simulate input:

var screenPos = new Vector3(screenPos.x, screenPos.y);
var ray = Camera.ScreenPointToRay(screenPos);
RaycastController.Instance.Raycast(ray.Value, out triangle);

then use functions for painting:

PaintObject.OnMouseDown(screenPos, 1f, triangle);
PaintObject.OnMouseButton(screenPos, 1f, triangle);
PaintObject.OnMouseUp(screenPos, 1f, triangle);

I’m working now on upcoming update that will significant improve convenience, user-interaction, performance and add some new features (including more comfortable drawing from code).
Let me know if you have any questions.

A huge update of 2D/3D Paint is here!

What's new:
- New feature: TOOLS! Asset have 4 tools: brush, erase, eyedropper(color picker) and brush sampler(brush picker). More tools will be added in future updates;
- Brush parameters: change brush texture, opacity, hardness or color using editor or from code;
- TextureKeeper - now Undo/Redo functionality saves texture and works more faster than before. Old class StateKeeper was removed;
- Added an ability to limit Undo/Redo actions quantity;
- Added an ability to draw from code;
- Asset was partially rewritten to give you best performance;
- New Demo scene: now it is more comfortable and user-friendly;
- Properly works with alpha and color mixing;
- Bug fixes.

Version 2.0.1 released.

What's new:
- Fixed Input for WebGL;
- Improved performance for getting neighbors triangles.

Is it possible to paint on meshes with tiling materials?

[quote=“adrian-taylor09”, post:6, topic: 745285]
Is it possible to paint on meshes with tiling materials?
[/quote]
Yes, sure :slight_smile:
Note that if model has the same uv-coords in a few places, painting result will be duplicated

Version 2.1 released!

What's new:
Editor:
- Added ability to save/load Triangles data using ScriptableObjects
- Added ability to initialize PaintManager from Inspector

Core:
- PaintManager initialization moved from MonoBehaviour.Awake() method to MonoBehaviour.Start()
- Improved PaintManager initialization from code
- Improved memory management
- Fixed PaintManager.GetResultTexture() method that returned an incorrect texture
- Removed SkinnedMeshRenderer scale restriction
- PaintManager.SetSourceMaterial() marked as obsolete

Other:
- Bug Fixes
- Improved manual

Version 2.2 released!

What's new:
New Features:
- New Tool: Clone tool - clone the part of the image with a few clicks!
- New Tool: Blur tool - set parameters and blur the part of the image!
- Average Color Calculator - get an average color of the texture!

Core:
- Improved memory management
- Fixed work of 'Brush Sampler', 'Eyedropper' tools with active PaintManagers
- Added sender to BasePaintObject events
- Removed obsolete method PaintManager.SetSourceMaterial()

Other:
- Bug Fixes
- Improved manual

Version 2.2.1 released!

What's new:
Core:
- Improved Clone tool performance
- Improved thin lines drawing
- Fixed Brush Sampler tool memory management

Other:
- Improved brushes quality

Version 2.2.2 released!

What's new:
Editor:
- Added ability to set texture size from PaintManager Inspector

Core:
- Default texture size were moved from Settings to PaintManager.Material
- Fixed setting material for multi-materials objects

2D/3D Paint is on sale for 50% off!

Hey!
I'm currently working on a project and using 2D/3D Paint to draw on some 2D sprites. Unfortunately, upon drawing on the sprite, it is not painting its contour correctly, as you can see on the image (before and after painting):
6571285--745324--AliceBefore.PNG 6571285--745327--AliceAfter.PNG
Is there a way I could paint the sprite with a more precise contour?

[quote=“Furagido”, post:13, topic: 745285]
Hey!
I’m currently working on a project and using 2D/3D Paint to draw on some 2D sprites. Unfortunately, upon drawing on the sprite, it is not painting its contour correctly, as you can see on the image (before and after painting):

Is there a way I could paint the sprite with a more precise contour?
[/quote]
Hi! Thanks for your post!
Can you tell me more about contour: how do you convert source sprite to second image? Did you try to use brush hardness?
Can you email me, because sometimes unity doesn’t send new posts notification? My email: unitymedved@gmail.com
Thanks!

Last day of discount!
2D/3D Paint is on sale for 50% off!

Hi !
I have a question: When I paint using semitransparent color - the final color isn't transparent. I think it is because total transparent value is summed up. Can I draw with constant transparent, even if the next line is drawn over existing ?

[quote=“Luchunpen_0”, post:16, topic: 745285]
Hi !
I have a question: When I paint using semitransparent color - the final color isn’t transparent. I think it is because total transparent value is summed up. Can I draw with constant transparent, even if the next line is drawn over existing ?
[/quote]
Hi! Thanks for your question!
I’m working right now to improve texture blending with transparency, please email me and I’ll share my current implementation before public release :slight_smile:
My email: unitymedved@gmail.com
Thanks!

2D/3D Paint is on sale for 50% off!

I wonder if this support layers and blend modes?

Its been my dream to create multiplayer painting game.

[quote=“Gekigengar”, post:19, topic: 745285]
I wonder if this support layers and blend modes?

Its been my dream to create multiplayer painting game.
[/quote]
Hi! It supports two layers for now: background (source image) and layer for painting, I’m planning to add multiple layers and blending options in future updates :slight_smile:

1 Like