If you haven't already, please consider writing a review. They really help me out!
You can also ask in the Forum Thread.
You can also check the YouTube Channel.
I'm also available for freelance work if you need help with your projects.
First, make sure you back up your project files.
Next, install the latest version.
If for some reason the latest updates breaks your project (e.g. errors in the console), then try deleting the root folder for this asset, and reinstalling it.
If it still doesn't work then go back to your previous version, and let me know what the errors are, so I can fix it.
Paint in 3D allows you to quickly paint any texture in your scene, using lightning fast GPU acceleration.
All core painting features work in the editor, and in game.
If you just want to paint in game then I recommend you first go through the demo scenes, and read the description text that explains what is being shown and how to set it up.
Yes, both LWRP/URP and HDRP are fully supported.
After you've enabled a scriptable rendering pipeline in your Graphics settings:
If you decide to go back to the standard rendering pipeline, then you can click the Switch To Standard Pipeline button.
Yes, this asset has been developed and tested in VR, and supports both multi-pass & single-pass rendering modes.
The VR HVLP demo scene shows you how to implement painting using Unity's XR system.
To open the main Paint in 3D window, click on Window > Paint in 3D from the top menu bar.
Make sure you're on the Objects tab, and begin by selecting a GameObject in either the Scene window, or the Hierarchy window.
Any GameObject with a MeshFilter + MeshRenderer or Skinned Mesh Renderer is supported by Paint in 3D.
Once selected, you can click the green Lock & Edit button.
Make sure you're on the Textures tab, and you will see every material and texture slot on the currently locked GameObject.
If the texture slot names look unfamiliar, you can hover your mouse over them to view the material descriptions for them.
Once you've found the texture slot you want to paint, click the arrow to the left to expand it.
Once your texture settings look good, click the green Lock & Paint button.
Make sure you're on the Painting tab, and you can see all your brush settings.
You can now edit various settings such as the Color and Radius, play around with these to see what they do.
If you move your mouse in the Scene view, you should see a preview of what your brush will look like.
If you click and drag in the Scene view, then paint will be applied to your objects.
Once you finish painting, make sure you go back to the Objects tab and click Unlock All.
To make your object paintable, first add the P3dPaintable component to it.
This works with any GameObject that has a Mesh Filter + Mesh Renderer, or Skinned Mesh Renderer.
Next, you need to mark which textures you want to paint. To do this, click the Add Paintable Texture button from the P3dPaintable inspector.
You should now see the P3dPaintableTexture component.
Inside this component, you can click the dropdown to the right of the Slot setting, allowing you to pick from a list of materials and texture slots.
For most objects, the default 0, _MainTex setting is all you need. But if you have multiple materials or need to do advanced painting you may need to change this.
The rest of the settings should be OK at their default values for now.
If your object is prefab clone, or your material is shared with multiple objects, then you want to clone your painting material before use.
To do this, click the Add Material Cloner button from the P3dPaintable inspector, and make sure the Index setting corresponds to your P3dPaintableTexture.Slot number setting you want to clone. The material at that index will be shown greyed out at the bottom.
Paint in 3D comes with several ways to paint objects.
One simple method is to make a new GameObject with the P3dHitScreen and P3dPaintDecal components. These components will automatically work together, allowing you to paint under the mouse or finger (on touch devices).
You can now adjust the settings for P3dPaintDecal to use the decal texture you want, the color you want, etc.
Once done, hit play, and you should be able to click on your object in the Game window, and have the decal you selected paint on your object.
If nothing shows, make sure your paintable object has a 3D collider (e.g. MeshCollider). Also, make sure the P3dPaintDecal.Texture setting is set, and that the Depth setting is large enough for your model.
For more advanced ways to paint I recommend you examine the demo scenes and see how they're put together!
For Paint in 3D to work, the mesh you want to paint must have UV data. Not only that, but for best results the UV data must not overlap, or exceed the 0..1 range (i.e. no texture tiling).
If your mesh fails any of these requirements, then I recommend you modify the mesh in your favourite 3d modelling program, and unwrap the UV data so that it's suitable for painting.
If you don't know how to UV map then you can use Unity to automatically do it for you. Just keep in mind that doing it manually will allow you to achieve better results.
To automatically generate UV data, you can enable the Generate Lightmap UVs setting in your mesh import settings.
If you followed the steps above, then you can use Paint in 3D to copy the newly generated UV1 data into the UV0 channel.
To do this, select your mesh in the Project window, and click the context menu (gear) icon at the top right of the inspector, and select the Coord Copier (Paint in 3D) option.
Your Project window should now contain a Coord Copier (YOUR_MESH_NAME) prefab, and you can click Generate to copy the coords over.
The generated mesh with the copied coords is now placed as a child of the Coord Copier prefab, and you can drag and drop it into your Mesh Filter or Skinned Mesh Renderers.
Yes, using the following steps you can get it working using the detail texture. Just keep in mind this isn't the best solution because it doesn't replace the albedo exactly.
Most shaders only use UV0, so you will need to make an alternative shader that uses UV1.
For example, instead of using uv_MainTex you use uv2_MainTex, or instead of using texcoord0 : TEXCOORD0, you use texcoord1 : TEXCOORD1.
Paint in 3D supports runtime undo & redo, but to save performance and memory it's not enabled by default.
To enable it, you need to follow these steps:
The first step is to select your P3dPaintableTexture components, and enable the State setting.
If you're painting animated objects then you should set this to FullTextureCopy, but for most scenarios you can use LocalCommandCopy.
If you use the FullTextureCopy state mode then you must also set the State Limit setting. A value of 10 means you can undo paint operations 10 times, and then redo them 10 times. If you paint 11 times with this setting then your initial paint state will be deleted, and you will only be able to undo 10 times to your first paint operation.
You can read the P3dPaintableTexture documentation to understand the difference.
The next step is to find your painting components, and enable the Store States setting. This setting will automatically call the Store State method on each P3dPaintableTexture in your scene, letting Paint in 3D know that you're about to paint on them.
For example, the P3dHitScreen component has the Store States setting, as well as P3dToggleParticles, and P3dTapThrow.
Finally, you can add the P3dUndoAll and P3dRedoAll components to your UI elements, and they will automatically be set up so when you click them they perform an undo or redo operation.
If you want to manually do this, then you can call the "Undo All" and "Redo All" methods/functions that are on these components. These methods are also available from the context menus if you want to test it in the editor.
And that's it, your game should now have Undo & Redo paint functionality!
Keep in mind that each undo/redo state is stored as a full texture state. This means that if your texture is 1024x1024 using the RGBA32 format, then each undo/redo state will consume 1024x1024x4 bytes of memory, or 4 megabytes.
If your game requires a lot of undo states and you can't afford to use too much memory, then instead of using this texture state system you need to store the paint operations themselves so you can reconstruct the texture when you undo. This kind of system uses very little memory, but it's quite complex to setup and manage, so there is no implementation of it included in Paint in 3D.
The undo & redo functionality listed above works well for most games, but it's not suitable for all scenarios. For example, if you have a multiplayer game where each user can paint their own object, then performing a global undo operation is unacceptable. Another problem is when using delayed painting features like the spray can, the actual paint may not have finished applying by the time you go to paint a second time, and so the save states may seem incorrect.
In these scenarios, you will likely need to manually handle undo & redo. To do this, you need to call the P3dPaintableTexture.StoreState method before you paint a specific texture, and then P3dPaintableTexture.Undo or P3dPaintableTexture.Redo when required. This works the same as the global methods, but because it's done on each individual paintable texture it gives you full control.
When you make complex 3d models it's inevitable your mesh will have UV seams, where one part of the texture is disconnected from another.
This normally isn't a problem with clever texturing, but when painting it can result in visual seams between these disconnected UV islands (see the seams around the shoulders on the zombie image).
The blue lines in this image show you the UV seams:
To fix these UV seams, Paint in 3D comes with a tool that can convert a normal mesh with UV seams into a fixed mesh without UV seams.
To access the tool, select any mesh in your project, click the context menu icon (gear) at the top right, and select Fix Seams (Paint in 3D).
This creates a seam fixer in your project, and automatically sets the Source mesh to the one you picked.
If you want to see the result of the seam fixing, set the Debug Scale setting to 10 or so.
You can now press the Generate button to generate the fixed mesh.
If it was successful, you should see something like this in your Scene window:
Where the green lines are the original seams, and the blue lines are the new fixed seams. The blue lines should be outside of your original green lines. If your blue lines are overlapping then try reducing the Border setting a little, or the Threshold setting.
The generated mesh will be placed as a child of the seam fixer in your Project window.
To use it, just drag and drop it from here into your MeshFilter or SkinnedMeshRenderer that uses this mesh.
Blend modes allow you to change the way your painted pixels are applied to your textures.
If you're painting in the editor, then you can set the blending mode in your brush settings.
If you're painting in game, then you can set the blending mode in the painting components (e.g. P3dPaintSphere, P3dPaintDecal).
This blend mode increases the alpha channel of your texture, and blends the RGB channels of your texture toward the color of your paint, based on the opacity of your paint.