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. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    Ah right. So I can just set my Threshold to 0 in the seam fixer parameters? Although the Threshold field does turn red, it appears to let me do it and also doesn't treat the small triangle as a hole.
     
  2. songjiekun

    songjiekun

    Joined:
    Jan 21, 2017
    Posts:
    29
    @Darkcoder
    I encountered an issue. If I set multiple object as static, then I can not paint on these objects anymore.

    The objects have same material by default. And their paintable is not activated when awake but will be activated “at first use”. So at runtime when it is first used ,the default material will be replaced with “cloned material”. But I can not paint on this cloned material.

    I do a experiment in another scene without using painin3d . I can replace static object material and even change replaced material’s textures. When Paintin3d paint on “cloned material” , should be just the same as replace texture. So it should work but why not.

    I know static object will be batched . But it just Combine the mesh. The material has been changed to “cloned material” when first use. It should work.

    Please tell me what should I do, thanks.
     
  3. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    Hey Carlos, I have another question, for the Paint Sphere is there an option similar to the Normal Front option of Paint Decal? I'd like to reduce the amount of wrapping it does.

    Thanks!
     
  4. umair_hassan1991

    umair_hassan1991

    Joined:
    Jun 27, 2018
    Posts:
    18
    I have purchased this asset, it was working good in android devices, but when I converted into IOS, it started showing blackspots on body in place of paints in android every time. however on IOS, it working 90% fine.
    Also to add, it continuously work like this in editor.
    I am also sharing two screenshots,
    1) paint should appear in place of blackspot
    upload_2020-9-12_13-13-59.png

    2) it should work like this
     

    Attached Files:

  5. yumeng1022

    yumeng1022

    Joined:
    Dec 4, 2019
    Posts:
    15
    Hi Carlos,
    I want to get very sharp effect when painting in my project.
    Does Paint3d support SVG and TextMeshPro ?
    Currently i don't show these options in asset description.

    If not support , does any further plan to support SVG and TextMeshPro ?
    Thanks.
     
  6. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hi.
    I bought this asset a long time ago and I am starting to use it.
    My goal is to create "blobs" of dust or mud on a racing car in real time.
    I have tried following the manual and the "zombie" example, but I can't.
    I suppose that some of the fault is the screenshot that I attach, but I do not know if it is true or how to solve it.
    Let's see if you can guide me, thanks.
     

    Attached Files:

  7. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Solved.
    Thanks?
     
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Sorry for the late replies everyone, I somehow didn't get any notifications. In the future feel free to send me e-mails when I disappear!

    I mean the internal threshold value for discarding tiny triangles. The 'Threshold' setting isn't even used any more, whoops. I should remove it!


    I think I've made the necessary modifications to support this. I'll send you a test build later today.


    Nope, but you can use P3dPaintDecal with a sphere shape. If you set Wrapping to 1 then it will work almost the same as P3dPaintSphere.


    Does this issue occur in the example scenes, or only this mesh? Can you spend me this mesh so I can test it.

    Just to clarify, you're saying it worked fine on Android & Editor until you converted to iOS, and now it's broken in Android, Editor, and iOS? If so, it sounds like maybe converting to iOS changed the mesh settings, but it's hard to say.


    There's no support for SVG or TMP. SVG tools tend to generate a mesh based on the underlying SVG path/edge/shape data, which could potentially be painted on top of if they were UV mapped. This however would not give you sharp edges unless you modified the SVG shader to do some kind of cutout/cutoff/threshold to the edges. TMP renders the text from a character atlas, so I'm not sure how painting this would be useful. If you painted the character "a", then every other instance of that character would also appear painted.

    To get hard edges you need to use a custom shader that implements the aforementioned cutout/cutoff/threshold technique. This is how the TMP shader works, because the underlying texture is a signed distance field (SDF). You can paint these with Paint in 3D just like any other texture. One thing to keep in mind is that this technique works using one texture channel (typically alpha), and could be extended to work using RGBA or even multiple textures. However, you can't just paint as many colors as you like on one texture and have all the edges appear sharp.


    The Mesh Analysis is telling you that the UV is outside of the 0..1 range, so it may not be paintable. I recently made changes to the way painting works so this scenario might work, if your mesh is mapped to 1..2 instead or something similar. To fix this you can modify your mesh UV so that it's inside the typical 0..1 range. I plan to improve the seam fixer tool so that it can automatically do this for you though.

    Also keep in mind many of the example scenes (e.g. Zombie Blood) use P3dHitScreen to paint, which performs a raycast under the finger to know where to paint. It looks like your car GameObject doesn't have any colliders, so this raycast will hit nothing, thus no paint will be applied. To fix this you should add a MeshCollider, or test with a setup like "32 Nearby Painting" which doesn't require colliders.
     
  9. songjiekun

    songjiekun

    Joined:
    Jan 21, 2017
    Posts:
    29
    thanks. it works.
     
    Darkcoder likes this.
  10. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hello

    I come with another question.

    The image that I attach, is a car that is "stained" with the particle system (which I take the opportunity to say that it is "brutal")

    I have a "decal" texture in "Tile Texture" and a value of 1 in Opacity.

    The point is that I have to remove the highlights. It is ugly that a car stained with sand or mud has shine in those spots.

    Any recommendation?

    And by the way, how can you apply a "normal" to the staining texture so that it gives the feeling of being stuck mud?

    Thanks a thousand.

    Screenshot01.png
     
  11. Darkcoder

    Darkcoder

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

    Version 1.9.5 of Paint in 3D is now out!
    • Fixed PPtr error when using texture modifiers.
    • Added P3dHitScreen.RelativeTo = DrawAngle setting.
    • Fixed painting of static meshes.
    • Added paint priority sorting for non-preview painting.
    • Added "Draw Angle" demo scene.
    Enjoy :)

    Looks great!

    Yes, you can apply a 'mud' normal map. To remove the shine you also want to paint the Smoothness texture too to reduce the smoothness.

    You can see the "PBR Painting" demo scene for an example of how to paint multiple textures at the same time using the Group feature. Keep in mind this example shows you how to paint the chalkboard which uses the P3D Solid shader. Your car probably uses a different shader (e.g. Standard), so your required paint settings may be slightly different. Basically, you just need to make a P3dPaintableTexture for each layer (e.g. Albedo + Normal + Smoothness), then make 3 P3dPaintDecal/Sphere components, and use 3 different groups to match these all up. You can then give them unique settings to paint what you want. Also keep in mind the albedo texture should be painted with Alpha Blend blending mode, normal with the Normal Blend mode, and smoothness with the Replace mode.

    Let me know if you encounter any issues.
     
  12. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374

    Oops!
    I don't know if I will be able to do all this. I'll try.
    The main car texture is a png texture. It has no smoothness, nor normal texture, or anything. And the shader is the "standard" for Unity.
    When the particles stain the car, the shine that I have set in the car's texture parameters remains and what I try is to prioritize the upper texture, which is that of the stains, without shine.
    I'll try your instructions, see what I get.
    Thanks for your reply.
     
  13. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Ah right. First you should try setting up a normal texture in your material, you can find some example ones online or just use a blank one (RGB 128,128,255). Once that works you can set up a P3dPaintableTexture for it (make sure you set Advanced/Conversion = Normal, and Group = Normal). Once that works you can add an additional P3dPaintDecal alongside your existing one, set it to the same Group = Normal, and set the texture to be some kind of dirt normal map. You'll probably have to experiment with many textures and settings to get this looking good. Once done basically do the same steps for the Smoothness texture.
     
  14. hecali_aj

    hecali_aj

    Joined:
    Sep 1, 2015
    Posts:
    24
    Hello, Is there a way to use a paintable texture as a mask? I've tried using
    Code (CSharp):
    1. _mask.Shape = _paintableTexture.GetReadableCopy();
    but it's not working...
     
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    .GetReadableCopy() returns a new Texture2D snapshot of the paintable texture at the time you call that method. It should work, though you have to manually destroy it to avoid leaking memory, and re-call this when you want the mask shape to update.

    If you want it to use the current paintable texture state all the time then you can directly assign it: _mask.Shape = _paintableTexture.Current

    Just keep in mind the mask will now be using the paintable texture itself, so you can't paint the paintable texture and have it masked by itself at the same time.
     
  16. hecali_aj

    hecali_aj

    Joined:
    Sep 1, 2015
    Posts:
    24
    Thanks for the quick reply! I got it working now. :) Another question, is there a class that I could inherit so that I'll know if Hit Screen has painted something? I'm trying to spawn an object at the position and angle of the newly applied decal.

    EDIT: Sorry, nevermind. I found out how to do it by looking at the Paint Decal class. Thanks for the awesome asset! :D
     
    Darkcoder likes this.
  17. hecali_aj

    hecali_aj

    Joined:
    Sep 1, 2015
    Posts:
    24
    Just a question, is it possible to have a mask that only affects a Paintable Texture of a specific layer?
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    It will be in the next version. I'll send you a test build.
     
  19. Darkcoder

    Darkcoder

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

    Version 1.9.6 of Paint in 3D is now out!
    • Fixed error when seam fixing mesh without UV coords.
    • Fixed P3dSpawner inspector not drawing.
    • Fixed P3dMask ignoring paint layers.

    This also changes the internal code for managing blending modes to make it easier to extend in the future. Let me know if you encounter any issues.

    Enjoy :)
     
  20. VincentAbert

    VincentAbert

    Joined:
    May 2, 2020
    Posts:
    123
    Hello, I'm just getting started with the asset, but I can't seem to make the in Editor painting work. Even in the example scene, if I just do what the text says, launch the play mode and open the paint window, I can't paint at all, just nothing happens. I have looked through the docs but it seems I'm just doing what they say... I'm using the latest Unity 2019 LTS version.

    Thank you !
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Make sure on the Paint tab you’ve selected a Tool, Brush, and Material, and that you’re dragging in the game view to paint. When I’m back tomorrow night I can record a quick video showing this process.
     
  22. Abnormalia_

    Abnormalia_

    Joined:
    Jul 23, 2013
    Posts:
    128
    Hi I noted if I change paintabledecal color from code its not applied anymore. Is is not supported ?
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    It should work, how are you changing it?
     
  24. Abnormalia_

    Abnormalia_

    Joined:
    Jul 23, 2013
    Posts:
    128
    Thanks for quick replay !

    Simply Just assigning:

    Code (CSharp):
    1.  
    2. protected P3dPaintDecal _pDecal;
    3. ....
    4. _pDecal.Color = sliceInfo.DirtColor;
    5.  
    And call project switch projects decal on surface. If I do not do color assignment it works fine.
     
  25. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
  26. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    This works fine for me. See the attached demo, just press Space to toggle between decal colors.


    It should work. One thing to keep in mind is that for best results you should run your mesh through the 'Seam Fixer' tool to avoid UV seams when painting. Assuming this asset can output a mesh asset then this should be no problem to do. If it doesn't give you a mesh asset (e.g. it's generated at runtime only), then you would have to make a little script to manually run it through the P3dSeamFixer script, which can work at runtime too.
     

    Attached Files:

  27. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    236
    @Darkcoder Thanks, it does create a new mesh but I'm not at the point yet there I'll implement this. Just planning ahead so expect more questions later. :D
     
    Darkcoder likes this.
  28. Abnormalia_

    Abnormalia_

    Joined:
    Jul 23, 2013
    Posts:
    128
    Thanks already solved but will take look maybe its more efficient !
    It works perfectly check katanas here:
     
    Last edited: Oct 8, 2020
    Rickmc3280 and Darkcoder like this.
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Looks awesome!!
     
  30. c789a123

    c789a123

    Joined:
    May 2, 2018
    Posts:
    4
    Seems to have problem with HDRP. I tried with unity 2019 4.12f1, paintin3d latest release. Start a new HDRP project, import paintin3d, run the PIPELINE script to switch to SRP, then test with the examples, for eg, eg 12 and the zombie example, both show no change of the object with mouse click on them. In contrast, paint fine without HDRP.
     
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Oh right, it actually does work, you just need to turn up the light Intensity to a mere... 10 million or so.

    Or, you can add an expose volume to your scene with settings like this:

    upload_2020-10-14_21-33-22.png

    I'll see if I can add some documentation or a tool to add these components to make this easier.
     
  32. c789a123

    c789a123

    Joined:
    May 2, 2018
    Posts:
    4
    Cool, worked with these settings! Thanks!
     
  33. c789a123

    c789a123

    Joined:
    May 2, 2018
    Posts:
    4
    I made some more test with HDRP, changed the zombie example's zombie material shader to HDRP/Lit, and assign its basemap texture. The zombie looks ok in the game window. but nothing happens when click on it. Seems HDRP/Lit shader not working with PaintIn3D?
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    You must change the P3dPaintableTexture's slot from _MainTex to whatever the HDRP lit shader uses. I think it has a 'fake' _MainTex for some reason, but you must set the _BaseMap or _AlbedoMap or whatever it uses.
     
  35. c789a123

    c789a123

    Joined:
    May 2, 2018
    Posts:
    4
    Works great! Thanks for your help!
     
    Darkcoder likes this.
  36. songjiekun

    songjiekun

    Joined:
    Jan 21, 2017
    Posts:
    29
    @Darkcoder hello,
    I am using the "P3D solid " shader you provide to create material that utilizes secondary UV. however there is no slots for "emission texture" in this shader. have I missed something?
     
  37. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    I have converted a board and 3 markers to URP materials and cannot get it to work anymore. Is there a workflow or something that I am missing for URP integration? I did q search for URP in this forum but nothing came up.

    Edit:

    Found out that if I copy all of the components into the scene and then go to the folder and click Swith To Scriptable Pipeline it worked, then I intermittently ran into an issue where it only painted on one side of the object (the wrong side).

    Finally got it working solidly.

    Do you have anything in this system that is basically:

    Script
    • Texture To Paint On (on play mode, if nothing exists it creates a temporary one)
    • Background Color of Texture.
    • Texture image size (reads from file or creates a new one on play).
    • Further - save texture as (uses default settings unless one is provided).
    The biggest issue for me is trying to create new objects and then it goes pink (URP/Shader thing)
     
    Last edited: Oct 22, 2020
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I sent you a private message with a test build.


    The "66 Procedural Setup" demo scene shows you how to set up an object mostly from scratch. You can modify this code to your exact requirements. For example:

    1) On line 47 you would change "_MainTex" to "_Albedo" or whatever your particular shader uses.

    2) After line 47 you would change the paintableTexture.Width & .Height to match your desired texture.

    3) After line 47 you would change the paintableTexture.Color to be your desired background color, or set .Texture if you want a texture.

    4) After line 47 you would change the paintableTexture.SaveName to whatever you want.
     
    Rickmc3280 likes this.
  39. jbarnoin2

    jbarnoin2

    Joined:
    May 30, 2013
    Posts:
    5
    Hi,
    First of all, thanks for the great work on the plugin, it's a real time saver and has plenty of nice features. We're making heavy use of it in our current project.

    I'd like to get your thoughts on upgrading from a previous version. We're doing a pretty big jump from 1.7.3 to current, but as there was no major version bump I expected things to be pretty compatible, and some of the newly added features are desirable to us.
    However, the change away from MonoBehaviours for P3dModifiers is causing us quite a bit of a headache (and it's unclear for what benefit but I'm sure you had a good reason).
    Initially Unity would just crash on load trying to deserialize some of our prefabs that had modifiers in them.

    We managed to get that temporarily fixed, and I'm thinking of writing throwaway code to save the modifiers from the previous version into some custom data in our prefabs and then using that data to instantiate the new modifiers after doing the upgrade, but I wish there was an easier way. Do you have any thoughts on an upgrade path for that change? Did you run into such issues when transitioning your example projects? Doing it manually would be a pain in our case as we have quite a lot of modifiers in many prefabs all over the place in this project.

    In any case, I wanted to convey that maintaining backwards compatibility may be important to some of the users of your plugin, so if such breaking changes are introduced in the future it would be great if they can be warned about in the documentation, along with some hints on how to handle the transition, and a major version number bump also helps make sure people take a closer look before upgrading. The change to the P3dModifier could also have been nicer to handle if new class names had been used and the older classes remained present but deprecated.

    Anyway, I'm sure we'll manage to handle it but your thoughts and any tips will be appreciated ! Again, thanks for your work, we're seeing great results from using the plugin and I do appreciate that maintenance can be tough if you don't want development to slow to a crawl.
     
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The reasons for the modifier changes are:

    1) This approach has higher performance. Adding extra components and GameObjects has scene overhead, and since they can be moved or deleted at any point I have to keep checking if they're null.

    2) This makes component setup cleaner. If you only have one P3dPaint___ component then there's no difference, but if you have two then every modifier would apply equally to every paint component. The only way to work around this would be to split your paint components into two child GameObjects, which is really tedious to do since you can't just cut and paste a specific group of components very easily.

    3) It makes it clearer what modifiers are applying to what paint component. Some modifiers don't work on some paint components, so making the Add Modifier dropdown specific to that component makes it super clear.

    There are pros and cons to either approach, but I think long term this approach is cleaner.

    While I didn't make it too clear when I changed this system in 1.8.0, I did make a breaking change in 1.9.3 to this system, and the change log does have:

    upload_2020-10-23_7-40-27.png

    If your project uses a lot of modifiers then indeed writing a custom script to save their previous state then re-populate it using the new approach is a good way to do this. You could also copy+paste the old modifier components to the new version, and write some kind of find&replace script that goes through all your scenes. If you don't have too many then you can duplicate your project and open it in two Unity instances then manually rebuild the modifiers.

    Most changes to the components are field names which can auto update using Unity's built in FormerlySerializedAs attribute, but this kind of a change is too large to easily do.
     
  41. jbarnoin2

    jbarnoin2

    Joined:
    May 30, 2013
    Posts:
    5
    Hey Carlos, thanks for your detailed answer.

    I understand the reasoning for the change better now, indeed using multiple separate GameObjects to separate the sets of modifiers is something we've been doing, in particular to paint to various P3dGroups at the same time (like drawing Albedo for a decal while clearing some channels to black in another mask texture with the same decal shape). It all makes sense, it's just the transition that was painful due to the way Unity reacts when classes that were serialized as MonoBehaviour in prefabs are turned into non-MonoBehaviour.

    At any rate, we've pretty much managed to get over the upgrade now and most features are working again. In the end while there was quite a few modifiers, I decided to recreate them manually so I could check and adapt each, as anyway I also had to make sure to remove the existing invalid MonoBehaviour references on these objects, which I'm not sure can easily be automated. Also had to make sure modifiers are added for the pressure-related settings to preserve functionality. Took a bit of time but we got there.

    Now, there's a couple things from our experience upgrading that I'd like to share based on how we use the plugin.
    There's a couple important things we were able to do without plugin code changes in the previous version that are no longer straightforward and required modifications to port over. We should be ok maintaining the changes locally for our use case, but I still thought I'd let you know so you have data on how people use your work in projects, and of course if you have any thoughts on how to better achieve these within the framework or think we're doing it wrong, please let me know !
    I apologize in advance for the wall of text.

    1- We plugged into the IHitPoint interface for creating actions that require knowing both the Transform (or Collider) that was hit by a trace and the world-space position and rotation of the hit. For instance: as we paint, we spawn a particle prefab in the right position, selecting a different prefab depending on which collider was hit and parenting the spawned prefab to the hit collider.
    This is no longer possible out of the box, as we have to pick between IHitCoord (which provides the hit Transform but no world-space position) or IHitPoint (which no longer provides the hit Transform).
    As a fix, we added back a hitTransform to the HandleHitPoint interface, and we're passing in the collider transform in the case of ray trace hits, and null where we don't have such info to provide, which is not great in general but enough for our use as we only use ray traces. It would require more thought to generalize.

    2- Having to choose between "Points In 3D" and "Points on UV" for the provider of a hit can be impractical. In one case I wanted a single HitBetween to have two hit handlers: one to spawn a prefab (which requires IHitPoint for the world position where to spawn) and the other to do a paint replace (which only reacts to IHitCoord as it wants to know the hit model). I thought of giving HitBetween the ability to fire both or having two HitBetweens, but that would lead to bad side effects: if you have a PaintDecal handler, which implements both IHitCoord and IHitPoint, it would paint the decal twice. So instead, the fix was to add support for IHitPoint to PaintFill / PaintReplace, which is made easier to adapt as I already pass in a hitTransform in my version, and then we always only use "Points In 3D". I don't know in general what would be the best interface to mix and match both uses but this way of working is fine for us.

    3- In the past, we were able to have a modifier that knows which hit handler MonoBehaviour it's being applied on. In practice this allowed us to have a more generic modifier that decides what to do depending on the P3dGroup it's applied on - like change the color to the current user selected color when applied to the Albedo group, but return black if applied to an effects mask texture group. I then wanted to manually allow selecting the P3dGroup when drawing the modifier properties, but it's impractical to draw the P3dGroup property drawer in that place, and writing the group index is not user friendly.
    In the end this isn't fixed yet but I'll just provide some other external asset to pick from within the modifier which selects the configuration to use. It was a bit easier to be able to check the configuration of our main MonoBehaviour from the modifier, but I understand there can be reasons not to want that.

    4- Another minor note about creating modifiers: It required some code modifications to add a new Modifier group other than the predefined ones and make it appear in the Add modifier menu. We have a kind of meta-modifier that can modify any of the values depending on the current selected tool, powerups and game state, so we created a custom group that's always visible in all modifier lists. Easy but still not possible without a small internal code addition.

    5- P3dPaintReplace / P3dPaintFill would not work for our setup out of the box when using IHitCoord, because its
    HandleHitCoord implementation is looking for the model with hit.Root.GetComponentInParent<P3dModel>(); and the P3dHit constructor sets the Root as the RaycastHit transform, which corresponds to the hit RigidBody's Transform.
    However in our setup, a RigidBody GameObject has several child GameObjects with visual meshes and MeshColliders on each, which are the actual paintable meshes - they form sub-parts of the same rigid body and all move together.
    The P3dModels component need to live on the object where the Mesh resides (it requires a Renderer), so it can't be at the RigidBody level in this case. Therefore when using GetComponentInParent starting from the RigidBody, the P3dModel will not be found - it needs to start looking at the Collider level.
    The fix for us was to set Root = hit.collider.transform in the P3dHit constructor, which allowed this setup to work and I don't think would cause any other trouble. hit.collider.transform is also what we pass in to our extra hitTransform parameter for HandleHitPoint.

    6- Bug report: PaintFill at the moment does not seem to do anything, because the default value of _LocalMaskChannel is all zeroes and there doesn't seem to be a way of specifying it. Workaround in our case was to use PaintReplace instead as this doesn't have the issue and worked for our needs. This seems to also affect your InGame example scene "40 Fill Painting" while "39 Replace Painting" works fine.

    Thanks again for your work, we're using your plugin to great effect and are really happy with it. I hope the feedback is useful.

    Julien
     
  42. jorikito

    jorikito

    Joined:
    Apr 20, 2018
    Posts:
    22
    This asset looks awesome! Before I buy it, may I ask how your asset deals with the shader global keywords? I'm using HDRP and unfortunately it's way too easy to hit the 256 global keywords limit and it's a bitch to maintain..
     
  43. Rickmc3280

    Rickmc3280

    Joined:
    Jun 28, 2014
    Posts:
    187
    Is it possible to draw lines with this package in 3D? (no need to paint on a surface but using the line renderer only and it create Vector3 every... so many points?

    Edit to add:

    For instance draw point, draw another point after x distance from last x?
     
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    1 - Good point, this isn't a scenario I considered so I removed that. Adding the position to P3dHit would be the easiest approach. All uses of P3dHit use the RaycastHit constructor, you can just add that as a field and copy the position in the constructor.

    2 - Indeed, there's scenarios where the current hit system can be difficult to use. As you found out, the reason why I didn't make the Hit components submit all types of hits is because some components can implement multiple conflicting types. Perhaps a solution is to make it so the paint components have a setting to limit which hits they can receive, and the hit components broadcast more.

    3 & 4- Indeed, this change makes it harder to customize the modifiers. The scenario of customizing modifiers per group or per hit component sounds pretty complex though. The modifiers are designed to be as easy to use as possible while still being fairly flexible. Perhaps it's best if I just made the code easier for people to extend?

    5 - Aha, I didn't know .transform was the Rigidbody's transform, I've updated this now.

    6 - Yeah this has been fixed for the next version, along with some nice additions.


    Paint in 3D currently uses 2 global keywords. Once 2019.4 becomes the minimum version to submit with, these will be changed to local keywords and thus become 0.


    Nope, you can only paint lines on textures.
     
  45. jorikito

    jorikito

    Joined:
    Apr 20, 2018
    Posts:
    22
    Awesome! I'm so glad more developers are minding the global keywords, since unity doesn't see finding a permanent solution for this issue a priority it seems.
     
    Darkcoder likes this.
  46. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Hi, I have an interesting problem. I foolishly went with CTS for my terrain shader without realizing it has no vertical mesh blending.
    upload_2020-10-28_23-12-14.png
    I'm hoping to use this asset to paint the area where the rocks intersect with the terrain, that way there is a little bit of a grass texture blend with the rock. Is this possible with this asset?
     
  47. Darkcoder

    Darkcoder

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

    Version 1.9.8 of Paint in 3D is now out!
    • Added Dripping Paint demo scene.
    • Added Flow demo scene.
    • Added Flow / Gradually demo scene.
    • Added Flow / Time demo scene.
    • Added Emission to P3D Solid shader.
    • Added Shift blend mode.
    • Added P3dPaintableTexture.IsDummy setting to Advanced menu.
    • Added P3dPaintableTexture.Aniso setting to Advanced menu.
    • Allowed P3dPaintableTextures to be placed in child GameObjects.
    • Fixed painting when using per-texture anisotropic filtering above 0.
    • Fixed P3dHit.Root setting in some scenarios.
    Lots of nice features in this version. The new "Flow" blending mode allows for some interesting new ways to paint, like simulating a rotary brush, flowing/dripping paint, and much more! I've also made it so P3dPaintableTexture components can be placed in child GameObjects. This simplifies organization of complex objects, particularly if you want to use multiple P3dGraduallyFade components, where previously the inspector wouldn't really show you which you had picked.

    Let me know if you encounter any issues, enjoy :)



    It's possible, but it wouldn't be a good solution. You would have to paint each rock separately, thus resulting in a lot of textures, a lot of draw calls, etc.
     
    Rickmc3280 likes this.
  48. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    Hello,

    I just bought Paint in 3D but it is not working at all as expected. I am experimenting with the Basic Setup scene. The painting tool is not reacting to changes in the radius of tthe brush as I would expect. With a small radius it paints a large part of the mesh with a red background no matter what colour I have chosen. Am I doing something wrong? I am using Unity 2019.4
    In the view below you can see I am painting in blue but except for a couple of spots it is coming out as red.

    Thanks

    Capture1.JPG
     
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I notice no such issue in a new scene using 2019.4.10f1 with the latest P3D 1.9.8.

    upload_2020-10-30_17-27-4.png

    It sounds like you might be running the "InGame/Examples/01 Basic Setup" scene, rather than the "InEditor/Examples/01 Basic Setup"?
     
  50. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    That's it. I didn't understand the difference. It is working as expected now.
    Thanks for the help!!!!!!
    Now to explore further.
     
    Darkcoder likes this.