Using RenderTexture Painting Shader
Subscribe:  iCal  |  Google Calendar
7, Mar — 12, Jun
Austin US   9, Mar — 19, Mar
San Francisco US   19, Mar — 24, Mar
San Francisco US   19, Mar — 21, Mar
Anaheim US   23, Mar — 26, Mar
Latest comments

Donald Trump, insulation is a seamless wall with airpockets. Ceilings can be printed using a re-enforcing scaffold for support. Try googling info..

by Polygrinder
8 hours ago

Really awesome work and the tutorial is fantastic. Thanks for sharing.

by Dave
8 hours ago

Absolutely no information about the 4.2 release - was it ever released in September. There is about as much information on trueSKY as there is in any of the so called products that use it. For me this lack of transparency is killing there business and points to fundamental issues with the technology. Google trueSKY in YouTube and you'll hardly get any information at all. For such a ground breaking technology this is very suspicious. Do they not have a marketing team - do they even care? Sounds like a very small company which wishes to remain small and doesn't understand what they can become because with the technology they have they should be targeting a bigger profile, revenue streams and audiance than they have and the lack of foresight here with the Simul management is quite frankly very disapointing. Another 10 years could easily disapear for these guys and they will simply remain a small fish. Very sad.

Using RenderTexture Painting Shader
26 December, 2017

Joyce (MinionsArt) has shared a guide to using the RenderTexture Painting shader the artist shared a while ago. You can do so many things with the help of this cool thing, so take some to study it. 

Here are the links if you’ve missed something: 

Persistent Damage

Leave persistent damage from laser or other weapons on the environment


This is the basic setup from linked code, Raycast to the mouse position when you click, adding the brush texture to the lightmap based RenderTexture result on collision 


Let the player leave trails with depth in snow/ sand


Set up your shader for tesselation, the Unity Manual here shows how to 

Add a vertex function for displacement, using the Paintmap as a texture reference for pushing the vertices

void disp(inout appdata v)
float d = tex2Dlod(_PaintMap, float4(v.texcoord1.xy, 0, 0)).r * _Height; += v.normal *d;

Now the untouched parts of the snow/sand are slightly higher, and the paintbrush script will push it down

Map Notes

Letting the Player add notes or draw on a map


You dont need the shader for this
Set up a canvas with a raw image, and make a RenderTexture for it

Instead of Raycasting, use the mouse position to paint to the RenderTexture. Get the X and Y coordinates by 

xCoordinate = Mathf.Floor(Input.mousePosition.x – rawImage.rectTransform.position.x);

yCoordinate = Mathf.Floor(Input.mousePosition.y – rawImage.rectTransform.position.y);

DrawTexture(texture, xCoordinate, yCoordinate);

With this you can draw on the RawImage UI component

Player Made Textures

Use the painted RenderTextures as a Texture2D for models


Start the same way as the draw map example

To convert the rendertexture to a usable texture, Make a new Texture2D and read the active RenderTexture’s pixels

 Texture2D toTexture2D(RenderTexture rTex)

sourceTex = new Texture2D(rTex.width, rTex.height, TextureFormat.RGB24, false); = rTex;
sourceTex.ReadPixels(new Rect(0, 0, rTex.width, rTex.height), 0, 0);
sourceTex.Apply(); = null;
return sourceTex;

Then assign the result texture to your renderer, and you’ve got a user made custom material!

Joyce (MinionsArt) 

Make sure to follow Joyce on Twitter and support the artist on Patreon if you find his work useful. 


Leave a Reply

Be the First to Comment!