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

Paint In 3D ✍️ Paint In Editor✏️ Paint In 2D

Discussion in 'Assets and Asset Store' started by Darkcoder, Jul 10, 2018.

  1. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406



    Paint all your objects with Paint in 3D. With incredible performance on mobile, VR, WebGL, and much more!

    >> Get Paint in 3D <<





    Paint in Editor unlocks the ability to paint objects in your scene - great for making small tweaks, or even creating entirely new texture sets!

    >> Get Paint in Editor <<





    Paint all your sprites with Paint in 2D. With incredible performance on mobile, WebGL, and much more!

    >> Get Paint in 2D <<





    Create personalized coloring book apps with this versatile asset. Tailor the experience, add your art - limitless possibilities!

    >> Get Coloring Book <<



    Made With Paint in 3D

    Sizzle & Stew by Cowly Owl
    (iOS, Android, Amazon)

    Made With Paint in 3D

    Toy Designer by Neapolitan Studios
    (iOS, Android)

    Made With Paint in 3D

    My Garage by Viking
    (Steam)

    Made With Paint in 3D

    Shave & Stuff by HyperVR Games
    (Site, Oculus, Steam)



    Thank you for reading ❤️
     
    Last edited: Jan 30, 2024
  2. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    This looks fantastic!
    I have one question: Can it be made to work with pressure sensitivity? Like the iPad Pro with Apple Pencil or Surface Pro for instance?

    Many thanks in advance.
     
    Lars-Steenhoff likes this.
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Not yet, but this is a good idea. I'll include it in the next version!
     
  4. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Thank you! That would be amazing. Can symmetry be enabled in some way too? It would be great to be able to paint on both sides of a mesh at the same time. This would be amazing for editing a characters face and clothing at runtime.
     
  5. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Bought it! Thanks for your speedy response!
     
  6. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    I love this so far! It has been the easiest 3d painting asset to implement compared to the three I tried today. I already have a very decent base to work with. I am going to look into adding Apple pencil support tonight somehow.

    It runs like butter on my iPad Pro! :)
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    This is a very good idea and should be fairly easy to implement, I'll include it in the next version too, along with some improvements to the input system used on mobiles.


    Great! Speaking of performance, version 1.5.2 went live today, and this includes massive performance improvements, particularly when painting multiple times per frame. This version was submitted before your feature requests so it doesn't include them, but that will come soon.

    Thanks for the feature ideas by the way, they're very good. If you have more then I'd love to hear them to improve the product even more!
     
  8. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Thank you for being so responsive! I will update to the new version now.
    Anything to simplify the runtime aspect of this asset would be fantastic. I would love to have the ability to easily erase, undo and change colour at runtime. Is there a way to have a smudge or blur brush too?
    I have also found that two finger panning still draws on the mesh. I am working on all of these things but I am pretty sure you would be able to do all of this way quicker than me. :)
    I am certainly not a natural coder. I am learning all of the time but I am definitely more of an art guy.
     
  9. noaim

    noaim

    Joined:
    Feb 27, 2015
    Posts:
    4
    Hey there!

    Thanks for this awesome tool!

    I have a small question and hopefully someone can help me with that. I am painting with P3D_Paintable on a Plane. Beforehand I want to check if the color on that position is already the same I wanna paint on. How can I get this data?

    Thanks!

    Cheers,
    Noaim
     
    marcipw likes this.
  10. CaptainBaxter

    CaptainBaxter

    Joined:
    Nov 19, 2016
    Posts:
    12
    Hi, I'm really interested in this asset and I have a few questions to see if it would be suitable for my needs. Does it work in VR? Is it possible to serialise the painted objects so that they can be loaded again at a later point? For example, presets for stickers in a car game.

    Cheers,
    Baxter
     
    marcipw likes this.
  11. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    I just submitted version 1.5.3, which includes pressure based opacity/radius/hardness settings. Mirroring will come in a future version because it requires an animated mesh to be in a bind pose, which I don't have prepared just yet. I don't think there's a sensible way to prevent painting while keeping the old control system, so I added a 'rotation' button to most demo scenes, which allows you to toggle between paint mode and rotate mode. I may change this again in the future, but for now it's a simple fix.

    You can already erase by using the 'Subtractive' blending mode, and setting the RGB to 0, so only the A gets subtracted. This is what the bullet hole demo scene does. If you want the erase to basically undo what was painted in that area then I'll need to add some new blending modes, but these should be easy to add.

    I will look into adding blur and smudge, these are much more difficult to do, especially smudge :D

    Thanks for the great ideas as always, I've added them all to my to-do list!


    Assuming you're using an older version (before 1.5.0), then the P3D_ReadToImage component (Read Color demo scene) shows you how to read a pixel at a specific point and output that color to a UI.Image.color. To do what you describe you can make a new component, copy + paste most of P3D_ReadToImage, but instead of writing the color to an image, you call P3D_Painter.PaintAt(point) if the read color satisfies your requirements.


    Yes, it works great in VR. I didn't mention this in the product description yet because there is no VR integration (e.g. VRTK demo scene). But if you know how to connect a VR controller to a painting GameObject (e.g. spray can coming in version 1.5.3), then it will work.

    Yes, all paintable textures use the P3dPaintableTexture component, which has the 'Save Name' setting. Setting this to something causes the texture to automatically save/load. Keep in mind this won't work correctly with multiple prefabs in the same scene, because they will all share the same name. For this scenario you need to write a script to decide which prefabs get which save name, but the code to handle this is as simple as yourPaintableTexture.Save(uniqueName) and yourPaintableTexture.Load(uniqueName). I'll include a demo of this in the next version!
     
    marcipw likes this.
  12. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Amazing! Thank you.
    I got the pressure working in a rather hacky way. :)

    It will do for now until Unity update the version on the store.
     
  13. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Erase seems to be working but does seem to leave a bit of ghosting behind which is visible when painting over the area again. I also really need to get runtime image saving / export working so that the user can save their painted image for later use.
    I got something working with easy save but the png image would not open in photoshop so I must have done something wrong. Ideally I would love to have a gallery of saved files that the user can nip back in to.

    Thank you for creating an asset which is making the runtime painting aspect possible and thanks again for listening. :)
     
  14. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Another quick question: (sorry)
    I am using this script to save an image to the device gallery:


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class savetogallery : MonoBehaviour {
    6.  
    7. public Texture2D myTexture;
    8.  
    9.     // Use this for initialization
    10.     public void saveitman () {
    11.    
    12.     NativeGallery.SaveImageToGallery( myTexture, "GalleryTest", "My img {0}.png" );
    13.        
    14.     }
    15.    
    16. }
    (This seems to be working a lot easier than the other assets I have tried)
    https://forum.unity.com/threads/native-gallery-for-android-ios-open-source.519619/

    How do I access the 'painted' texture to save it to the device gallery?

    Screen Shot 2018-07-20 at 06.18.31.png
     
  15. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    I was simply dragging an image into the myTexture slot to make sure it is working but I want to reference the aafacepainter texture from the image so I can save that to the gallery.

    Many, many, many thanks in advance.
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    The current alpha blending approach doesn't work well with 0 alpha, and will cause this bleeding/ghosting when painting in a different color. I know how to fix this, but that will have to wait for next week.


    To get a Texture2D snapshot of a paintable texture, you first need to store a reference to the P3dPaintableTexture component you want to use, then you can call these two methods: var outputTexture2D = P3dHelper.GetReadableTexture(yourPaintableTexture.GetCurrent(false));

    You can then save that texture. Keep in mind you should destroy that texture when you're finished with it.
     
    alienorbit and marcipw like this.
  17. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Thank you! That’s amazing and so fast. :)
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Version 1.5.3 Out Now!
    - Added ‘Asteroid Holes’ demo scene.
    - Added ‘Shield Impacts’ demo scene.
    - Added ‘Spray paint’ demo scene.
    - Added finger pressure support to P3dPaintDecal.
    - Added finger pressure support to P3dPaintSphere.
    - Added finger pressure support to P3dPaintSphereTriplanar.
    - Improved mobile input support in demo scenes.
     
    marcipw likes this.
  19. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Excellent! Thank you. :)
     
    Darkcoder likes this.
  20. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    I had another thought this evening; Physics or particle based brushes! Is there a way to make particles leave a paint trail on the mesh texture? It could create some cool, random paint effects where no stroke is ever the same. :)
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    The latest version has the 'Spray Paint' demo scene, which does exactly this ;)

    Just add the P3dOnParticleCollision + P3dPaint___ components to your ParticleSystem. For physics collisions the P3dOnCollision + P3dPaint___ components can be used.
     
    marcipw likes this.
  22. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Wow! It’s like you read my mind! :)
     
    Darkcoder likes this.
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Here's a sneak peak of the next version:



    Blur paint mode! It works just like the other paint styles, so you can make it blur under the mouse, on collision, on particle hit, etc.
     
    marcipw and AthrunVLokiz like this.
  24. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Wow! I love this!!!! Thank you. :)
     
    Darkcoder likes this.
  25. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Will the alpha blending / ghosting be fixed in the new version too?
     
  26. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Yes, the upcoming version has a new AlphaBlendAdvanced blending mode which fixes this. It's a little slower than the original AlphaBlend, so I decided to keep them both in case users don't need alpha modification and want maximum performance.
     
  27. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Fantastic! Thank you for all of your hard work on this. I am sure this will go above and beyond what this asset is was originally designed for but. Is there any way to smooth the curves on really fast circles?

    I can live with out it or try to get it working on my own in some way so please don’t worry about it. This asset is worth 100 times what I paid for it and you have been so amazing so far.

    Apparently Apple created a method called coalesced touches that ‘fills in’ the jaggies in the curvature. It may be a native app only thing but here it is in use in a tutorial anyway: https://www.raywenderlich.com/121834/apple-pencil-tutorial
     
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    It's well within the scope of what the asset should do, so I'll add it to the next-next version.

    I've already got it working for fast circles, but getting it to work with small ones too is a little more complex it seems.
     
    marcipw likes this.
  29. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    The best customer service EVER! :) Thank you! :)
     
    Darkcoder likes this.
  30. gfaraj

    gfaraj

    Joined:
    Jul 11, 2016
    Posts:
    35
    Hi @Darkcoder this asset looks really awesome! I was having some issues and I sent you an email, was just wondering if you had received it. Thanks!

    edit: Just saw your email, my mail client was being stupid. Thanks for the quick reply!
     
    Last edited: Jul 30, 2018
    Darkcoder likes this.
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Version 1.5.4 Out Now!
    - Added ‘Auto Save Load’ demo scene.
    - Added ‘Chalk Board’ demo scene.
    - Added ‘Strength’ setting to Sphere Triplanar paint mode.
    - Added ‘Sphere Blur’ paint mode.
    - Added ‘Alpha Blend Advanced’ blending mode for transparent texture painting.
    - Added P3dPaintSphereBlur component.
     
    marcipw likes this.
  32. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    I sometimes wish this forum had a Facebook style Love button! Thank you @Darkcoder! You rock!!!
     
  33. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Thanks, and thank you for so many great suggestions! The next version will include even more nice things :)
     
    marcipw likes this.
  34. CaptainBaxter

    CaptainBaxter

    Joined:
    Nov 19, 2016
    Posts:
    12
    Wow! Rapid response Darkcoder. Thank you so much. Keep up the fantastic work! I will definitely be trying this in the next project.
     
    marcipw and Darkcoder like this.
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Hey everyone,

    Version 1.5.5 Out Now!
    - Added P3dPaintDebug component.
    - Added P3dDragRaycastSmooth component.
    - Added ‘UV Data Requirements’ documentation.
    - Added ‘Mesh Analysis’ window to debug UV data.
    - Fixed ‘Auto Save Load’ demo scene painting.


    Unity accepted the update sooner than I expected and I've actually made improvements to the P3dDragRaycastSmooth which you can expect to see soon, as well as decal preview painting on mobile devices.
     
    marcipw likes this.
  36. WinterboltGames

    WinterboltGames

    Joined:
    Jul 27, 2016
    Posts:
    259
    Hi, I'm going to buy Paint In 3D soon (due to the great reviews on the asset store) but before I do so I have some questions...

    1 - Can this tool create a texture and paint on it or it does require that the model have a texture pre-made for it.

    2 - Does it require any runtime scripts? because I'm not planning on using the runtime features.

    3 - Does it use/require custom shaders? because I use some custom shaders.

    4 - Does it have a texture size limit? because I might use it to paint 128x128 textures or even smaller.

    5 - Does it require any additional setup other than importing it? (no problem in this case)

    6 - How many folders/files come included with the package and are they organized? (I ask this for project organization purposes)

    Thanks in advance!
     
  37. WinterboltGames

    WinterboltGames

    Joined:
    Jul 27, 2016
    Posts:
    259
    @Darkcoder Hey sir, I have been waiting for over 3 days for a reply before I buy this asset.
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Hey, I just got back from a 2 week holiday and was too busy to answer most requests.

    1 - It can create a texture if your model does't have one. Your model requires UV data though. If your model doesn't then there is the 'UV Data Requirements' documentation, which shows you steps to make UV data using Unity's light mapping features.

    2 - Nope, you can paint entirely in the editor if you don't need any runtime stuff.

    3 - You can paint on any object using any material & shader, as long as those shaders use the vertex UV data that comes with the mesh. i.e. a triplanar mapping shader will not be paintable, but most will.

    4 - The only limit is your GPU, which may be up to 16384x16384, 128x128 or smaller is no issue.

    5 - You need to pick your object, the material slot you want to paint, the texture in that material you want to paint, and the brush settings you want, but other than these obvious things there's no special setup required I can think of.

    6 - Everything is inside /Assets/Paint in 3D, you can see the folder structure in the asset store package preview.
     
    marcipw and WinterboltGames like this.
  39. MagicK47

    MagicK47

    Joined:
    Sep 5, 2017
    Posts:
    30
    我们制作了一个角色模型,但是在uv边缘,有一条线从未被画过,How do you make this line disappear?How to color the model,full
     

    Attached Files:

  40. datbq

    datbq

    Joined:
    Nov 6, 2017
    Posts:
    6
    @Darkcoder,
    Can your tool work on mobile VR? I need to paint color on terrain's texture by collision. It's like a ball move on a terrain and paint a color where the ball moved. Can your tool do that?
     
    Last edited: Aug 21, 2018
  41. Edward13th

    Edward13th

    Joined:
    Apr 20, 2015
    Posts:
    1
    Hello, I use the P3dPaintSphereTriplanar.cs script to draw some effects on the plane. but now the problem is i want to get percentage of how mush i cover the surface.Is there a way to get percentage of how much i drawn?
     
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    I answered you via e-mail.


    No, terrains are special in Unity. Paint in 3D can only paint normal Mesh Filter + MeshRenderer or SkinnedMeshRenderer objects.


    I answered you via e-mail.
     
  43. datbq

    datbq

    Joined:
    Nov 6, 2017
    Posts:
    6
    I'm sorry for a unclear question. My terrain has a Mesh. It's not a built-in Terrain of Unity. Can your tool solve my problem in a VR mobile application?
     
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    There's no issue with VR. If your terrain renders with a MeshFilter + MeshRenderer then it will be compatible. Just keep in mind that the painting is applied to the texture, so if your terrain is very big then you will need a very big texture to give it enough detail. It also needs non-tiling UV data, but this can be generated in the editor.
     
    marcipw likes this.
  45. datbq

    datbq

    Joined:
    Nov 6, 2017
    Posts:
    6
    Thank you for your reply.
     
  46. SheepVsGravity

    SheepVsGravity

    Joined:
    Feb 13, 2012
    Posts:
    1
    I am interested in purchasing your painting code, but have 2 questions:

    1) Could I use it to create transparent "holes" in a Texture/Texture2D Unity object? So I could see through it to objects behind it?

    2) Would this works on moblie platforms? iOS and Android?

    Thanks!
     
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    1 - Yes, all you need to do is change the Blend Mode of your painting component to Subtractive, and set the color to black (i.e. RGBA 0, 0, 0, 255).

    2 - Yes, it works on all platforms.
     
    marcipw likes this.
  48. MagicK47

    MagicK47

    Joined:
    Sep 5, 2017
    Posts:
    30
    Hi, We hope to use the SVGA format in our project,will the plugin support it? Because the texture zooms in a lot when using png, is there any other solution if we can`t use svga?Thank you very much!
     
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    There's no way to paint SVG data directly, but if your SVG is being rendered using a mesh via MeshFilter+MeshRenderer, then it might be possible. All it needs is non-tiling UV data, and a material that has a texture. Just keep in mind the painting itself still uses pixels, so when zooming in the resolution will decrease. You could improve this by using a cutout shader though.
     
  50. beard-or-die

    beard-or-die

    Joined:
    Jul 12, 2017
    Posts:
    6
    I am planning on buying this, but have a few questions. I've bought lots of decal solutions and am disappointed with them or they don't support Unity 2018.2+ or require a custom shader. I am interested in being able to place (in editor and via runtime) decals from PNGs with a metallic and normal map onto meshes (conforming to that mesh's shape). An example would be a sticker that has a logo on it, where the sticker material is a matte look and the logo appears like a silver reflective metal, and the sticker can be placed on a sphere or a custom mesh like a skateboard ramp, etc. Versatility in mesh shape and material/metallic properties are important. Also, emission from a painted decal would be an optional but nice feature. Is this asset appropriate for this kind of usage?