TexturePaint on the Asset Store!

TexturePaint a runtime asset texture painting tool is now on the asset store! Yay!

Its a 2d texture painting tool that can be used for very powerful decals, extend it for custom gameplay like Portal 2 painting gameplay, use it to shoot holes in walls or leave drag marks across the ground. Its a great, powerful and efficient tool.

Whats the roadmap?:
The current version is a 2d grid painting tool, and I am currently extending it to paint on 3d objects with any uv setup.
After that I will be extending TexturePaint to support full HDR textures.

DX11 compatibility has been added and is now in the Assset Store!

TexturePaint has code paths that will work in Unity Pro (GPU or CPU) or Unity Basic (CPU only).
Procedural shapes or textures can be used for the paint brush. (Texture brushes Unity Pro only.)

I am very excited about this tool, let me know what you think and where you think I should take it.
Thanks,

Video:

Screenshot:

Store:

Painting on 3d objects is now working!
I am just ironing out the last bits of the interface and then I will submit it to the store as an update. :slight_smile:
I also have a fix for the log warning that happens in new levels.

Next is HDR, file saving and editor painting mode.

Wow, awesome!
Just one question - can you do paint mixing? Because from that youtube video, it looks like its just cycle through color, it doesn’t look like you can “mix the paint” (let’s say red + yellow = orange).

Its not currently doing paint mixing, you are correct, the video is just cycling colors. Paint mixing would be possible though, it would just be a change in the shader in how it “prints” into the texture. The current idea is centered around holes in walls, blood splats, marks on floors / walls; but I wanted to make sure I was building it forward thinking for painting etc. (imagine painting a mask which shows flaming wood on a wood wall with a blowtorch in a game, etc.)

I am finishing up the feature of painting on complex 3d objects right now and hope to submit that in the next day or two. Then I am working on file saving / editor mode. When I am working on editor mode, I will make sure to add “blend modes”. While working on blend modes, I will make sure to think about mixing colors. :wink:

Thanks for the input, glad you like it. :slight_smile:

I just submitted the 3d painting feature set to the store. Look for it soon! :slight_smile:
Here is a quick screenshot.

Here is a link to the store if you would like more information:

TexturePaint and FluidSim have been updated on the store to add proper iOS support.

yay!

Nice asset… I have a project with Kinect that needs to paint over 3D, this just uses the mouse right? Is it easy to transfer for another kind of input?
How do you handle the painting?

@xandeck

I use the mouse as an example input. Anything could be used for an input, for example I used enemies walking across a battlefield once.

The system is designed to be highly flexible, painting is broken down into:

  • a “sim grid/3d object” which is used to determin where to paint into the texture.
  • a object with the paint brush script on it (I call these objects InfluenceActors)

The paint brush tells the sim its position, rotation and scale. those are then used to paint into the texture. This allows anything to be used as a “brush”.

In the included sample files, I have an invisible paint brush object (InfluenceActor) that I update based on where the mouse clicks and then it rotates to match the surface normal.

The video doesnt show it, but the system supports multiple paint brushes active at the same time. The max number is limited only by performance. I have an artificial limit set at 128 paint brushes at one time only because I didnt expect anyone to hit that limit. IF you need more than that, its a single variable change.

Thanks, looks promising. If we get the project, I will get your solution. :slight_smile:

I need to save the new painted texture to disk…

How can i do it?

Thank’s in advance.

Hi there…

How to change Color in the texturePaintInfluenceActor in Runtime?

OK…

I got it :wink:

#pragma strict
private var tempColorDetails : colorInfluenceClass;

var thisObject : GameObject;

function Update () {

}

function OnClick () {
tempColorDetails = thisObject.GetComponent(TexturePaintInfluenceActor).colorDetails;
tempColorDetails.colorValue =Color.yellow;

}

I bought your tool from the asset store. it worked great on pc, iPad and Galaxy s3. however, it did not work on Kindle fire hd and Galaxy tab. Render texture did not show. Could not paint on 2d nor 3d object. please help. I would like to use your paint texture function on my app. Thanks.

@ emo55
Save to disk would need to be done in the same way mentioned in the forums for saving render textures to disk. you need to use the readpixels method to copy the rendertexture data into an image that is then saved as a png.
check out this and if that isnt enough, there are well documented methods on the forum. Unity - Scripting API: Texture2D.ReadPixels

@dougP
I am not sure why it wouldnt work on Kindle fire or Galaxy tab but why it would on the s3. I have not tested the tool on Android and dont know that environment very well. I have tested pc, mac, iphone and ipad and know those environments much better. Since you mention it works on a Galaxy s3, it sound more like a Unity3d issue with that hardware or OS setup. Can you verify that unity is even creating render textures on the fire or tab? Does the tool work if you set it to not use render textures? (use the gpu boolean on the paint surface to switch to full cpu mode.) Do other features that use render textures work? does the log give you a error that would direct us to the problem?

Pheck
I just did a full cpu mode test on the galaxy tab and it worked. Painfully slow ofcourse. I’ll poke around and see if these devices even allow me to use renderTexture. I’m not quite sure how to get a debug log from from these devices. Please let me know if u have any idea. Thanks

Update: I just did a test with renderTexture and it worked. I manually create a renderTexture and blit a 2dtexture to it when a mouse click is detected.

@dougp

ok, its good we have more info… the texture paint setup doesnt require a specific rendertexture format, but some of them look better than others. possible that hardware cant use the format that is set in the script.

what format did your rendertexture test use?

TexturePaint uses RenderTextureFormat.ARGB32 and is set at line 213.
if you find your test used a different format, try setting this value to the format you used and see if that fixs it for that specific hardware setup.

Pheck,
It worked when I changed it to textureRenderFormat.ARGBHalf. However, it seems like I can’t changed color texture in texturePaintInfluenceActor. I changed different color textures, even with an empty (clear) one and it still draws circle pattern. Any ideas?

Update: RGBHalf causes rendertexture failed to create error. Switch to RGB565, no more error and works correctly in pc. However in galaxy tab, still only draws circle splat pattern. It must have failed to create correct rendertexture in Tab.

@dougP
I am glad you found a format that is working for you.

TexturePaint requires a rendertexture to allow the painting of an specific image as a brush instead of a procedural circle. if you can get it to create a texture and it still does the circle, then check the below:
If you find you need different texture formats for different platforms, you could always have a if() statement that checks for platform and then sets texture format.

Is “Use Gpu” turned on in the paint surface?

Is “Use Texture” turned on in the paint brush and is a texture assigned that has detail which should show up when painted?

Does it show the texture when painted on other platforms or do all platforms paint the circle?

I am not sure what shader features android supports, but texture paint uses fairly traditional shader features. I would expect they should work on android. The circle you mention only shows up when using the CPU version instead of the GPU version, when the GPU isnt supported, or when a setting is off by accident.

Pheck,
Thanks for all your feedbacks. After few attempts to debug, it seems that TexturePaintScript.js fails at line 431 with impulseLocationTexMat.SetTexture when running on galaxy tab. Any idea? Do you have another simple impulseLocationTexShader for me to test just to see if anything show up at all? Thanks.

@dougP

hmm… strange that its failing on that set texture and not on all set textures. But its possible that shader is the first shader in the setup to require shader model 3.0. because of the high instruction count on some of the shaders that deal with high numbers of influence actors it needs shader model 3. if you are not using high numbers of influence actors you may be able to remove #pragma shader 3.0 from the shader and it may work for you on android. Just a word of warning though, I added that to shaders because it was needed in a few setups. if you decide to remove it, do it one shader at a time until your setup is working the way you need.

I dont know android galaxy tab, so I have no idea if it supports SM 3.0 equivalent features.