Search Unity

TexturePaint on the Asset Store!

Discussion in 'Assets and Asset Store' started by Pheck, Dec 20, 2012.

  1. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    @ creat327
    (by doing a google search, it looks like this is a issue introduced in Unity 4.2 and lots of people using two cameras are seeing this. TexturePaint doesn't use two cameras, but it must be touching a similar part of code. I don't see anything that is "wrong" in TexturePaint, it sounds like Unity is just throwing a annoying error that would show up with anything using even slightly advanced GPU methods.)

    What version of Unity are you running? What GPU do you have Unity using? DX11 or lower?
    Are you trying the example in a clean unity project with nothing else in it? or is this in your own project with other scripts?

    I have never seen this error before and no one else has said they see this issue. I am not sure how to repro it without more detail.
    Maybe its specific to a unity version or a GPU type.

    Its also an odd error, because its saying the rendertexture was not cleared or discarded... and it shouldn't be. we want to keep the rendertexture data around each frame so that we can see the cool stuff that was created. I don't really see what its warning about except pointing out typical rendertexture behavior.

    Post a forum msg to me if you have specific details we can work through.

    - Pheck
     
  2. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    @creat327
    After looking into it more, I don't believe adding the "discardcontents" code suggested on the forums help TexturePaint. In fact, I think it would prevent TexturePaint from running. BUT there seems to be a group of people who filed a unity bug on this, so it may already be fixed.

    The forum mentions this only shows up in your editor is set to emulate mobile and that this doesn't show up with working in "pc" mode. which would explain why I didn't see it, I only work in pc mode at home.
     
  3. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    56
    I just bought TexturePaint and it's just what I needed!

    At first I was having the same issue as eduhcano, but I fixed it by changing line 116 in TexturePaintConnector.cs from
    colorActorDynamicTempArray[dynamicArrayCount] = colorActorHistoryArray;
    to
    colorActorDynamicTempArray = colorActorHistoryArray;

    Now I'm having another issue:
    I'm attaching TexturePaintInfluenceActors to prefabs that are instantiated, fly across the screen and destroy themselves. As soon as 128 of these objects have been created, I'm out of space for new actors despite there only being 10 on the screen at any time. How can I fix this?
     
  4. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    @ eduhcano
    @mbhuet

    I have isolated the issue you are seeing and am fixing it tonight. I will post a code fix once I have it tested.

    I would recommend not using the mbhuet fix since that can cause "live" actors to not be given priority to "dead" actors.

    Thanks for being active if giving feedback everyone.
     
  5. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    Ok, I found the correct fix and have updated the Asset Store code... but since that takes time to get through their QA...

    You need to add "dynamicArrayCount++;" to the first for loop in the TexturePaintConnector inside the SortActorArrayHidden function.

    But make sure to keep all other code the same. if you use the code listed by people in other posts, it can cause problems with rendering large numbers of influence actors.

    To fix a 3d painting code bug I found while fixing the above bug, after the raytrace in the 3d paint code, add a if() block with "hitInfo.transform == myTransform". This will make sure the object hit is the object you want to paint on instead of just any object in the way. If you have objects in the way that you dont want to check against, use the Unity physics layers to check around that.

    Sorry for the bug in the recent submission.
    - Pheck
     
    Last edited: Sep 23, 2013
  6. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    Recent bug found fixed... in next submission.

    In a recent submission a bug was introduced. I found the bug and fixed it... but for those that dont want to wait for the store below are more details:

    3d actor painting is acting funny in the recent version. it doesnt check for which actor to paint on and if within range will paint on all actors. to fix this in the 3d update function after the raytrace add a if(hitInfo.transform == myTransform) which incases the children code of this section.

    thats it... or just wait for the asset store to post the fixed up version. ;)
     
    Last edited: Sep 26, 2013
  7. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    There is a bug that has been pointed out related to spawning to many influence actors.
    I have it fixed and will be uploading it to the store as soon as I have it converted to both js and c#.

    just a quick fyi ;)
     
  8. Shinugami

    Shinugami

    Joined:
    Oct 17, 2012
    Posts:
    54
    I bought the program. I followed upto these steps:

    However when I press play I get this error message:
    Could you please advise what to do. I just want to make a bullet hole effect but am finding this program I bought to be erroneous despite following the steps stated.
     
  9. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    @shinugami
    The name you typed into the texture slot below the material slot doesnt match a slot available in your material.
    If you are using the defaults, it should work without modification. if the default is wrong, make sure you have the newest version downloaded.
    incase you want the default and dont remember it use "_MainTex" as that is a common default in Unity.

    - Pheck
     
  10. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Hi Pheck,

    In the RoadMap write up on the First page you mentioned that you will be extending this package to paint in "Full HDR". That would really be awesome, can you give some ideas of when this feature will be added.

    Thanks for the great work.

    Cheers.
     
  11. Jukes55

    Jukes55

    Joined:
    Oct 31, 2013
    Posts:
    1
    Hey Pheck!

    First, Thanks for an aweeeeeesome tool! After seeing how a pro builds something like this, I am humbled =) I am however having a very basic issue that is quite confusing. Im using the free version of unity, so CPU based stuff, and trying to simply assign a starting texture to the TexturePaintObject. It works with any color I choose, but when I assign a texture to "Use Start Texture Color", it seems to grab a corner pixel of that texture and stretch it across the TexturePaintObject, so it still shows up as a solid color to start.

    The texture is a tif, with a solid alpha channel, RGBA32, 1024x512. And the color resolution on the TexturePaintObject is set to 512x512. Im a bit new to scripting, and unity for that matter, so I bet this is a super simple issue to get around... just wondering why its not working. Im on Unity 4.2.1, Free version.

    On a side note, Im actually using it more like an eraser, to remove the alpha from the TexturePaintObject, and reveal a plane below it with a separate texture on it. But thats not really relevant, just thought I'd share a "different" way of using this awesome tool.

    Thanks!!!
     
  12. sicga123

    sicga123

    Joined:
    Jan 26, 2011
    Posts:
    782
    Hi Pheck

    I'm trying to put this texturepaint into a demo scene I'm making but am having no luck. As far as I can tell it is all correct. I tried putting a simple cube into your 3D demo scene but still could not get it to paint. Would it be possible to send you the scene so you could take a look and see just what I am doing wrong?

    Any help would be greatly appreciated.
     
  13. davvilla

    davvilla

    Joined:
    Mar 28, 2012
    Posts:
    18
    After reading this:
    http://forum.unity3d.com/threads/19...warning-quot?p=1317217&viewfull=1#post1317217

    I managed to remove the warnings (and stuff still works for me) by doing the following changes:

    At line 431ish
    Code (csharp):
    1. colorRenderTextureDestination.DiscardContents();
    2. Graphics.Blit (colorRenderTextureSource, colorRenderTextureDestination, initializeToValueMat);
    3. colorRenderTextureSource.DiscardContents();
    4. Graphics.Blit (colorRenderTextureDestination, colorRenderTextureSource);
    At line 726ish
    Code (csharp):
    1. colorRenderTextureDestination.DiscardContents();
    2. Graphics.Blit (colorRenderTextureSource, colorRenderTextureDestination, impulseLocationTexMat);
    3. colorRenderTextureSource.DiscardContents();
    4. Graphics.Blit (colorRenderTextureDestination, colorRenderTextureSource);
     
  14. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    225
    Hi Davvilla,

    Thanks for posting your findings. That change shouldnt impact anything, I still find it interesting that this bug is happening for a 2 camera issue but texturepaint only uses 1 camera. I will look into adding that change to a future version.

    thanks,
    - pheck
     
  15. SamuZen

    SamuZen

    Joined:
    Jan 26, 2014
    Posts:
    7
    Hi Pheck,

    Is it possible to paint transparent ? like : Color(0,0,0,0) ?

    i'm trying to make an eraser ... for now the only eraser method i found was to clear buffer ...

    i can do this :ClearColorBuffer(new Color(0,0,0,0)) ... to clear the full texture to transparent... but i cant to this : colorDetails.colorValue = new Color(0,0,0,0)

    i can paint any color , and clear the buffer to any color including transparent ...

    what i need to do , so the brush can "erase" ( paint transparent )...
     
  16. Ony_

    Ony_

    Joined:
    Jul 24, 2014
    Posts:
    1
    ^Up the question of SamuZen

    I'm interested in the plugin for doing exactly that. Is it possible ?
    (And is the plugin compatible with the 2D sprites of Unity 4.5 ?)
     
  17. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I'm also interested in this question by SamuZen.
     
  18. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    243
    I have a few questions before I purchase:

    1. Can I paint directly on a model with my own texture? Like if I have a player model with a custom UVW map.
    2. Is there a way to draw a primitive like a square on the model, not just drawing like a brush?
     
  19. HypothicEntropy

    HypothicEntropy

    Joined:
    Mar 24, 2014
    Posts:
    26
    Hello, thanks for this tool.

    Is there any good way to make lines in-between the texture splotches to keep it connected? Right now, when the influence actor is moved quickly, there are gaps between the textures.