Search Unity

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

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

  1. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Same problem.
    If I separate it from the rest it works well even if I flag the collider on convex, while if I insert it together with the doors (Atlas method) it no longer works correctly.

    With Atlas Painting



    With cloner script


    I don't think it's the collider fault, it looks like some mesh conflict when I use the Atlas Painting.


    .
     
  2. Vaultboy_444

    Vaultboy_444

    Joined:
    Sep 3, 2019
    Posts:
    4
    ScreenShot.png Hello.

    URP2019.3.3 in use

    I've updated it for SRP.

    But,

    Shader Graphs/P3D Cutout SRP
    Shader Graphs/P3D Alpha SRP
    Shader Graphs/P3D Splat Alpha SRP

    doesn't work.

    "Shader Graphs/P3D Opaque SRP" works.
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Thanks, I'll add this to my mesh test list and see if I can find a nice way to automatically handle this scenario.

    For now, you can manually fix this by changing the "Body.baked" GameObject's Transform.scale to 1,1,1. The same can be done for the "Face.baked" and "Hair001.baked" GameObjects. You can leave "skelton" as is, and it should now paint as expected.
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    This looks like a bug with this version Shader Graph, see HERE.

    If you can't upgrade to 7.2.0, then you can delete the Shader Graph nodes that cause this issue:

    1 - Double click a Shader graph file like "P3D Cutout SRP".
    2 - Select the "Offset(1)" and "P3dOffset" nodes (as seen in the attached picture).
    3 - Press Delete, to delete these two nodes.
    4 - Press "Save Asset".

    It should now work.

    I'll have to do some more testing to see the full impact of this change, but I think most demo scenes should now work as expected.
     

    Attached Files:

  5. Darkcoder

    Darkcoder

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

    here's a sneak peek at what I've been working on:





    I've rewritten the in-editor feature (again), and this time it's 1000% better than ever. You can now paint with any of the in-game painting tools, which makes it much more flexible than before. The painting has been moved back to the main scene (not a special 3D window), so you can paint objects on your terrain, alongside other meshes, etc.

    I also made the Scene tab much more useful, and it can also speed up in-game scene setup too. As you can see, you can make an object paintable with just one click of a button now, and you can set up textures for this using the new 'preset' system, which also makes it one (two) clicks to add. This means you don't have to mess with texture names and such as much!

    Expect this new version to come out within a few days, stay tuned :)
     
  6. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117

    Hi Carlos,

    Thanks for the reply.

    It's strange, but I still can't make it work. Even after setting the scale to 1,1,1.

    skinmeshscale1.PNG


    And one thing I noticed was that the Body.baked.PaintableTexture.Slot kept changing to the 7, even though it was supposed to be 0, but even after setting it to 0 it changed back to 7, not sure if this is important. wrongtext.PNG

    So here is how the Body.baked is set up, can you spot something wrong? Maybe your Paint setup was different?

    body example.PNG


    Many thanks, Carlos!
    Gabriel.
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Hmm, maybe it's animation specific or something. I'll email you some stuff to test.
     
  8. Jmonroe

    Jmonroe

    Joined:
    Jul 7, 2012
    Posts:
    123
    Nice! So can we paint decals, etc on existing textures in the Editor now?
     
  9. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Yep :)
     
  10. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Hi Carlos, I am always on my engraving problems, with normal maps.
    For the moment I use two button associated with two Paintable tools, one with a sphere to paint, one other with a decal (normal map brush) to paint normal map (engrave). I have one mesh with 2 materials, the first with all textures, and the secondary with just the normal map (to keep relief) and the rest is transparent to add albedo painting.
    of course my paint tool is pointed on the slot 1 Albedo. But I have problems with the 2d tool for engraving. Should I point it toward the normal map of the secondary material (with separated groups) but it doesn't affect the object before I paint it. Should I point the normal map of the slot 0, to affect the object before I paint it, but I should delete the normal map of the slot 1, to keep the engraving whn the mesh is painted. Or should I use a 3e material just for normal map ?
    And when I paint the first map (0) it works for the first run on the base material, (but no on the painting), but after the normal map disapear from te texture slot... I must have misses something. I'm sorry with my confused explications ! Thank's if you have a solution ;-)
     
  11. gliealonso

    gliealonso

    Joined:
    Oct 21, 2018
    Posts:
    117

    Hi Carlos!

    Thanks to your suggestion regarding the animation, It worked! I had to disable the VR setup. Thanks a lot man! Gonna leave a nice review for you =)

    Many thanks again,
    Gabriel.
     
    Darkcoder likes this.
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    I'm confused and I'm not sure what your setup is like :D

    You have two materials.

    Your first material (0) has "all textures", like albedo + normal + smoothness + etc, and I guess it's opaque?

    What do you mean your second material (1) is just the normal map?

    What do you mean "the rest is transparent to add albedo painting"?

    If your textures disappear then it sounds like you forgot to add a P3dMaterialCloner?

    Maybe you can post screenshots of your materials and P3d__ component settings.
     
  13. benjamin666

    benjamin666

    Joined:
    Jan 11, 2019
    Posts:
    23
    Hope stronger
     
  14. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    I'm getting these errors in 2019/3/6f:
    Code (CSharp):
    1. Assets\PaintIn3D\InEditor\P3dPainter.cs(328,4): warning CS0618: 'SceneView.onSceneGUIDelegate' is obsolete: 'onSceneGUIDelegate has been deprecated. Use duringSceneGui instead.'
    2.  
    Code (CSharp):
    1. Assets\PaintIn3D\InEditor\P3dPainter.cs(340,4): warning CS0618: 'SceneView.onSceneGUIDelegate' is obsolete: 'onSceneGUIDelegate has been deprecated. Use duringSceneGui instead.'
    2.  
    Code (CSharp):
    1. Assets\PaintIn3D\InGame\Examples\Scripts\P3dVrManager.cs(365,5): warning CS0618: 'InputTracking.Recenter()' is obsolete: 'This API is obsolete, and should no longer be used. Please use XRInputSubsystem.TryRecenter() instead.'
    2.  
     
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    The first two will be fixed in the next version. The third is more tricky to fix, so you can ignore it for now. I'll have to look into it a bit more when I have more time.
     
    Zebbi likes this.
  16. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Hi Darkcoder, my setup is probably not the best :D:(
    Here is my screenshots , with my two component, and the two materials for my prev post.
    I just tried to paint on both normal textures of the two materials, to engrave the painting and the base material, but I use now 3 Paintable Texture components, one for th paint (slot 1) and the two others for normal maps (slots 0 and 1) (and two Material Cloner components (slot 0 and 1) It works but perhaps there is another optimized way to do this... And my clear All button does not work anymore. It probably destroy the slot 0 normal map , I don't know.



     
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    This setup looks ok.

    I'm not sure why you need a second layer to do engraving though, as it looks like your base material may look better than P3D Alpha. Can't you just use one material and directly engrave the base texture? You can always call the Clear() method, or paint with the ReplaceOriginal blending mode to undo the engraving.
     
  18. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    I want to paint and to engrave with two paint tools differents, but when I engrave the base texture, it's just ok on this material, the second material with painted texture does not use this normal map. If I don't duplicate the normal map of the first slot on the 2d slot, I don't have any normal map on the painting. To have the same relief on painting than without painting, I have to engrave the two textures of my two mterials, having three Paint Textures component (2 for normalmaps, one for painting). I thought the second slot P3DAlpha material would stay transparent for normalmap if I don't use it, but no, it dos not let the slot 0 works...
    And I don't understand why the clear() method doesn't work. It seems to kill the normal map of the first material slot.
     
  19. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    It' curious, each time I try to paint on a normalmap texture, slot 0 or 1, the Clear() method seems to destroy it, and the materrial seems to be transparent with artefact... Even if all he compnent are used on the same slot.
     
  20. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Everything' working when I use 3 Paintable textures, 2 for normal maps (base material and painted material) and one for the painted material. I can't use only the base material normal maps because I have just the base material with it or just the paint material with it.... I think it have an impact on performance.
    And for the clear()mthod, is there another method I could use just to clean one slot , for exemple ? Or a fill method of subtrcative soft blend mode ?
    I am sorry to ask you so much questions !!!
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    No problem.

    Clear() by default uses the P3dPaintableTexture component's Texture and Color settings, which are null in your screenshots, so it will clear to white. You can click the "Copy" button to fix this. When your P3dPaintableTexture first activates, it uses the existing Slot texture (e.g. your normal map). In the next version (waiting for Unity to review it), I've changed the way this works, so it will also copy the original texture into the P3dPaintableTexture.Texture setting, which will avoid this issue.

    I recorded a quick video showing you how to set up something like rock engraving using the Standard shader:



    Is this similar to what you're trying to do?

    For the normal decal texture I'm using an inverted 'Dent_Normal', because this texture originally pops out, but engraving should pop in.
     
  22. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Hello, Thank's a lot for your video, it's very useful, and I made a new setup like you with just one material slot. Now I use replace original blend mode to erase my paint, and I'll add a similar button for my engraving eraser tool, but with the normal group. It let me keep the base material to paint, wich is better than mix 2 different rendered materials !
    It's better than using 3 Paintable textures and 2 slots !!! But I always have my bug with the clear() method (even with the Material Cloner, and he copy tool). I will see with the options of the next relase ! I sent you in PM a webgl preview of my work for now. I will add a more precise circular cursor to preview the size of the brushof the tools because the P3D preview is great but difficult to see when the opacité and hardness are too low.I have to work on the radius parameters between the tools, and change the tools icon, but it's a base ! I will add another review on the assetstore to tell how you are nice and so reactive !!! It's precious !
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Nice. Your demo looks great too! When I hit clear it's strange that the normal doesn't instantly clear. It almost looks like you're spawning another rock, rather than clearing the existing one, because if I move the camera around I can see some flickering between the engraving and another rock mesh? Anyway, let me know once you try the new version!
     
  24. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Thank you, very much appreciated!

    Sorry if this has been asked and documented before, but how simple is it to make blood splatters based on particles? When I hit something, I just instantiate a non-looping blood particle system, and it would be cool if the particles could leave a mess on the enemy and the ground. Is this mostly as simple as adding a PaintIn3D component to the enemy and the ground?
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    It's as simple as adding the P3dHitParticles + P3dPaintDecal components to your particle system. See the "Particle Painting" demo scene for something like this.
     
  26. Darkcoder

    Darkcoder

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

    Version 1.8.6 of Paint in 3D is now out!
    • Moved main build to Unity 2018.4.0f1.
    • Fixed textures not saving on mobile when closing the app.
    • Fixed Atlas Painting demo scene materials.
    • Added P3dPaintableTexture.Filter setting.
    • Added P3dPaintableTexture.WrapU setting.
    • Added P3dPaintableTexture.WrapV setting.
    • Improved VR Pen demo scene performance.
    • Fixed paint drifting issue on some meshes.
    • Rewrote in-editor painting features.
    • Added material Preset settings to editor Scene tab.
    • Renamed P3dMaterialCloner.ResetActivation method to Deactivate.
    • Added P3dPaintableTexture.Deactivate method.
    • Tidied up P3dPaintableTexture inspector.
    • Renamed P3dPaintableTexture.State setting to UndoRedo.
    • Added P3dPaintableTexture.SaveLoad setting.
    • Added P3dPaintableTexture.UseExisting setting.
    • Renamed P3dChannelCounter.SolidR/G/B/A to CountR/G/B/A.
    • Added P3dColorCounterFill component.
    • Added P3dColorCounterEvent component.
    • Added P3dColorCounterEvent component.
    • Added Read Color demo scene.
    • Added Read Color / Event demo scene.
    • Added Read Color / Under demo scene.
    • Added Mirror / Multiple demo scene.
    • Fixed Color / Random modifier inspector error.
    • Removed P3dScatterSpawner component.
    • Removed P3dDrip component.
    • Removed P3dMover component.

    Lots of small tweaks and improvements in this build, and two new major features: The ability to read painted colors, and a completely rewritten in-editor painting system. Check out the new demo scenes to see how they work. Let me know if you encounter any issues or have questions!

    Enjoy :)
     
  27. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    I guess it's not what I told you about, right?
     
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Nope, but I have since fixed the bug you mentioned. I still need to fix a few other things first though :)
     
  29. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Ok, great! :)
     
  30. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    I must say that now the tool works really well, so much so that in addition to using it within the game I'm now setting it up to create the 3D model templates for which I usually used Blender or Substance Painter.

    By drawing within the project I make all the templates I need much faster. ;)

    Here is the example of the template of a car to be restored:



    Thanks again.

    .
     
    Last edited: May 7, 2020
    Darkcoder likes this.
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Looks great! Good job :)
     
  32. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Is there a way to generate the temp Render texture with the sRGB parameter?

    Unfortunately it seems that when you go to use EndcodeToPNG () to export it, if it is on linear as by default the image is encoded too dark, while on sRGB it remains perfect.
     
  33. BelieveXiaoShuai

    BelieveXiaoShuai

    Joined:
    Nov 6, 2017
    Posts:
    21
    Can you tell me how to upload the trace of painting to the server through the network and synchronize it to the drawing board of other clients in real time?
     
  34. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Hi DarkCoder, How could I know if a paint tool is active in a script ? I tried something like

    Code (CSharp):
    1. public P3dPaintDecal GravureDec;
    2. public P3dPaintSphere PeintureSph;
    3. if (PeintureSph.activeInHierarchy == true )
    4. or
    5. if (GravureDec.activeSelf )
    But it does not worked...
    I neeed to test it before adapt the radius of the tool, for exemple.
    Thank's if you can help me !
     
  35. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    If you keep each tool in different objects you can do this:

    Code (CSharp):
    1. public class NewBehaviourScript : MonoBehaviour
    2. {
    3.     [SerializeField] GameObject paintToolObj_1;
    4.     [SerializeField] GameObject paintToolObj_2;
    5.  
    6.     public void CheckPaintTool()
    7.     {
    8.        if (paintToolObj_1.activeSelf)
    9.             Debug.Log("paintTool_1  tool is active!");
    10.  
    11.         else if (paintToolObj_2.activeSelf)
    12.             Debug.Log("paintTool_2  tool is active!");
    13.     }
    14. }

    Or like this:

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. public class NewBehaviourScript : MonoBehaviour
    4. {
    5.     [SerializeField]
    6.     GameObject[] myPaintTools;
    7.  
    8.     public void EnablePaintTool (int t)
    9.     {
    10.         //Unable all tools
    11.         for (int i = 0; i < myPaintTools.Length; i++)
    12.         {
    13.             myPaintTools[i].SetActive(false);
    14.         }
    15.  
    16.         //enable selected only
    17.         myPaintTools[t].SetActive(true);
    18.  
    19.         Debug.Log("You have activated PaintTool number: " + t);
    20.     }
    21. }
    Etc...
     
    Last edited: May 13, 2020
  36. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    The speech is very complex, but the basic structure is similar:

    Upload texture:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Networking;
    3. using System.Collections;
    4. using UnityEngine.UI;
    5.  
    6. public class NewBehaviourScript : MonoBehaviour
    7. {
    8.     public RawImage yourImage;
    9.     Texture2D m_texture2D;
    10.  
    11.     public void SendPainting()
    12.     {
    13.         StartCoroutine(UploadPNG());
    14.     }
    15.  
    16.     IEnumerator UploadPNG()
    17.     {
    18.         RenderTexture.active = (RenderTexture)yourImage.texture;
    19.  
    20.         Texture2D texture = new Texture2D(yourImage.texture.width, yourImage.texture.height, TextureFormat.RGB24, true, true);
    21.         texture.ReadPixels(new Rect(0, 0, texture.width, texture.height), 0, 0);
    22.         texture.Apply();
    23.         m_texture2D = texture;
    24.  
    25.         // Encode texture into PNG
    26.         byte[] bytes = m_texture2D.EncodeToPNG();
    27.         Object.Destroy(m_texture2D);
    28.  
    29.  
    30.         WWWForm form = new WWWForm();
    31.         form.AddField("frameCount", Time.frameCount.ToString());
    32.         form.AddBinaryData("fileUpload", bytes);
    33.  
    34.         // Upload to a cgi script
    35.         var w = UnityWebRequest.Post("http://www.my-server.com/env.cgi?post", form);
    36.         yield return w.SendWebRequest();
    37.  
    38.         if (w.isNetworkError || w.isHttpError)
    39.         {
    40.             Debug.Log(w.error);
    41.         }
    42.         else
    43.         {
    44.             Debug.Log("Finished Uploading Painting");
    45.         }
    46.     }
    47.  
    48. }

    Download Image:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Networking;
    3. using System.Collections;
    4.  
    5. public class NewBehaviourScript : MonoBehaviour
    6. {
    7.     public Texture receivedImage;
    8.  
    9.     public void GetPaint()
    10.     {
    11.         StartCoroutine(DownloadTexture());
    12.     }
    13.  
    14.     IEnumerator DownloadTexture()
    15.     {
    16.         UnityWebRequest www = UnityWebRequestTexture.GetTexture("http://www.my-server.com/image.png");
    17.         yield return www.SendWebRequest();
    18.  
    19.         if (www.isNetworkError || www.isHttpError)
    20.         {
    21.             Debug.Log(www.error);
    22.         }
    23.         else
    24.         {
    25.             receivedImage = ((DownloadHandlerTexture)www.downloadHandler).texture;
    26.         }
    27.     }
    28. }

    for the rest you should have the receiving clients listening when the image is loaded on that address and make them call GetPaint ();
     
    Last edited: May 13, 2020
  37. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    thank you so much, Ciorbyn ! I didn't realise it was not possible to use SetActive directly on component like P3DSpere or P3DDecals, it's ok with the GameObject they are attached on ! It's a newbie error...!
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    I think by default all the render textures are set to linear if your project is linear. Before I made it this way there were major issues when you try to fix linear and sRGB, because Unity tries to be clever and auto convert things for you. I'll have to look into it.

    Just sent you a private message with an example.

    If you're using the tool system that comes with Paint in 3D then you can check if .activeSelf on the tool root (with P3dHit___, and it should work. However, if you're enabling/disabling the children (ones with P3dPaint___ components), then this won't work. This is because the P3dHit___ components cache which P3dPaint___ components they're sending events to, and there are no further checks to see if they're disabled or newly added. For this you would have to call the P3dHit___.ClearHitCache() method. This cache uses GetComponentsInChildren though, which probably includes disabled components by default, maybe I should change that.
     
  39. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Yes, indeed I can vary the settings in PlayerSettings, but this would decrease the quality of the project ...:confused:

    Unity_3d_Gamma_linear_srgb.png
     
    Last edited: May 13, 2020
  40. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Thank you, DarkCoder !
     
  41. Darkcoder

    Darkcoder

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

    Version 1.8.7 of Paint in 3D is now out!
    • Removed P3dPaintableTexture.KeepUnpaintable setting.
    • Allowed painting of overlapping UV areas.
    • Fixed painting atlas meshes that are close together.
    • Added P3dChangeCounter component.
    • Added P3dChangeCounterEvent component.
    • Added P3dChangeCounterFill component.
    • Added P3dChangeCounterText component.
    • Added Change Counter demo scene.
    • Added Rock Engraving demo scene.
    • Added Transparent Object Painting demo scene.
    • Replaced P3D Opaque shader with P3D Solid.
    • Replaced P3D Cutout shader with P3D Solid.
    • Fixed P3dPaintableTexture error when using an invalid slot.
    • Fixed P3dVrTool.StoreStates setting.
    • Fixed Undo/Redo not updating mip maps.
    • Replaced Alpha Blend RGB blending mode with Premultiplied.
    • Added P3dBlendMode.Channels setting.
    • Removed splat map examples.
    • Removed parallax mapping from example shaders.
    • Added P3dPaintableTexture.Normal setting.
    • Improved Normal Blend blending mode.
    • Switch VR examples to left hand for mobile touch compatibility.
    • Removed VR recenter function.
    • Fixed bug when P3dPaintSphere would fail to paint on UV.
    • Fixed bug when P3dPaintDecal would fail to paint on UV.
    • Fixed bug where paint material overrides wouldn't apply to child paint components.
    • Added PBR presets for P3D and Standard shaders.
    • Added extra paint materials.
    So many changes in this version. SRP issues should now be fixed with the example shaders. To simplify things I removed the splat mapping shaders+demo, though I will introduce these again using the new shaders soon. I also changed the way painting is handled to fix some edge cases, and this may improve painting performance for some meshes, but it may degrade it for others - I have a solution I will implement soon that will improve performance for all scenarios though.

    I also added full PBR painting support to the in-editor painting (I made presets for P3D + Standard shaders), and added some new paint materials to show it off. Before I add too many new materials I want to improve the material creation system, as it's currently a little tedious adding new materials with all the different PBR textures. I also added some new demo scenes.

    Enjoy :)
     
  42. cuzner

    cuzner

    Joined:
    Oct 1, 2015
    Posts:
    11
    Hi, this looks like a great unity asset.
    I am in the process of developing a mobile game that allows the user to interact and paint on complex 3d meshes. Not getting very far with my current design.
    My questions are: (a) Does it work with the latest Unity versions? (b) Is it suitable for use in a mobile game? I want to be able to paint both fine details, and large areas of the screen as required. It needs to be responsive for the user. (c) Is it easy to integrate into other projects? (d) Is it easy for a mid-level developer to modify the source code?
    That's all I can think of for now.

    Keep up the good work.
     
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    a) Should do. The latest version changes every week though and I don't always test it, though none of the core painting relies on any version specific stuff.

    b) Sure, the only consideration is texture size if you need to paint so many surfaces.

    c) Yes.

    d) Depends what you want to modify, but most simple changes should be easy enough.
     
    cuzner likes this.
  44. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Thanks for this! ;)
     
    Darkcoder likes this.
  45. ciorbyn

    ciorbyn

    Joined:
    Oct 17, 2013
    Posts:
    138
    Just to have a trace if someone were to have the problem of exporting dark textures.

    From P3dHelper.cs line 131 just force it and change:

    "desc.sRGB = sRGB;" in "desc.sRGB = true;"

    and ignore "QualitySettings.activeColorSpace == ColorSpace.Gamma"

    it's a bit rough modification, but I don't have time to study and modify the whole structure,
    besides the fact that if I update with future versions, they will overwrite my changes.

    I hope you can add it as a selectable parameter in the ADVANCED Section in the next updates.
     
    Last edited: May 19, 2020
  46. robert12342

    robert12342

    Joined:
    Jun 11, 2018
    Posts:
    29
    upload_2020-5-19_22-56-1.png
    Hi, please help me . When I draw on white material everything is fine. But as soon as I change the color of the car the duck also changes color how do I make the duck remain its color, regardless of the color of the car
     

    Attached Files:

  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    I'll have to test it out. The reason why I make the render textures' linear setting match the project settings is because if there is a mismatch, Unity will apply auto conversion. Changing this line may fix your particular issue, but it will probably break something else like the undo/redo.

    You can change the color of the car using the P3dPaintableTexture component's Color setting, or by applying your paint on top of the base material ("Paint On Top" demo scene). The duck decal is part of the car texture now, so you can't change the car material color without the duck also changing color.
     
  48. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Hi, I have lots of objects combined into one UV, with the mess of islands you get from auto packing. The textures are from 4k to 8k. How bad is this for performance or does it not matter for PCs?
     
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    It doesn't matter that much, but auto packing tends to leave a lot of wasted space. If you check the Mesh Analysis tool you can see how many % of the texture space is wasted, and this means you need to increase the size of your texture to make up for that wasted space. For example, if you use auto generation and it uses 20% of the UV, and you did it manually and took it to 80%, you can now use a texture with half the width+height (4x less pixels) for the same texel size, which means you use much less memory, and painting will be a little faster.
     
  50. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    Nah, it's pretty well packed, just messy. Thanks for info. Good to know.
     
    Darkcoder likes this.