# Painting textures in real time?

**URL:** <https://forums.unrealengine.com/t/painting-textures-in-real-time/37878>\
**Category:** Asset Creation\
**Tags:** unreal-engine\
**Created:** [August 7, 2015, 8:49pm UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878 "2015-08-07T20:49:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BiznessMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BiznessMan](https://forums.unrealengine.com/u/BiznessMan)\
**Post date:** [August 7, 2015, 8:49pm UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878/1 "2015-08-07T20:49:21Z")

</div>

I am curious how one would go about making a surface that can be drawn on in real time. I’m thinking of something like the whiteboard in Duke Nukem Forever where you could use the marker to draw stuff on it.

---

<div class="post-metadata">

**Author:** ![darthviper107](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/darthviper107/32/710746_2.png) [@darthviper107](https://forums.unrealengine.com/u/darthviper107)\
**Post date:** [August 7, 2015, 10:45pm UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878/2 "2015-08-07T22:45:26Z")

</div>

Are you talking about painting textures or something like being able to draw in-game?

---

<div class="post-metadata">

**Author:** ![BiznessMan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BiznessMan](https://forums.unrealengine.com/u/BiznessMan)\
**Post date:** [August 8, 2015, 12:25am UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878/4 "2015-08-08T00:25:58Z")

</div>

An example would be to pull up a map in game and draw on top of it. Leaving notes and such that will always be saved. I assume that would be painting a texture in real time which would overlay ontop of the map.

I could be wrong though

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f9a860851](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f9a860851](https://forums.unrealengine.com/u/anonymous_user_f9a860851)\
**Post date:** [August 8, 2015, 6:40am UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878/5 "2015-08-08T06:40:03Z")

</div>

Well, I am not sure how you would do it in the Engine, but have some questions that might help others know what you are looking for.

Do you need more than one color? If not, couldn’t you just use an editable mask? Could you simply define where the user is likely to draw, and use a texture ahead of time?

A typing interface may be better if you expect notes to be longer than very short words. Or, you could give premade phrases they can stamp down on, in which case you could use texture coordinates to match a mask you have for that purpose.

Is it important that it is handwritten by the user? And, will it be done on any 3D object, which requires different strategies than a flat 2D object?

---

<div class="post-metadata">

**Author:** ![haldolium](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@haldolium](https://forums.unrealengine.com/u/haldolium)\
**Post date:** [August 8, 2015, 8:04am UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878/6 "2015-08-08T08:04:26Z")

</div>

> [@BillDStrong;351119](#):
>
> Well, I am not sure how you would do it in the Engine, but have some questions that might help others know what you are looking for.
> 
> Do you need more than one color? If not, couldn’t you just use an editable mask? Could you simply define where the user is likely to draw, and use a texture ahead of time?
> 
> A typing interface may be better if you expect notes to be longer than very short words. Or, you could give premade phrases they can stamp down on, in which case you could use texture coordinates to match a mask you have for that purpose.
> 
> Is it important that it is handwritten by the user? And, will it be done on any 3D object, which requires different strategies than a flat 2D object?

Well he was refering to the whiteboard in, so actual drawing. This is what you’re able to achieve with some (well, much) artistic skill on the Duke Nukem Whiteboard:

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/7/887ddd0630ef4c370e36e56665e626347185ae11.png)

> **[duke nukem forever fan art: in-game-doodle](http://kopfstoff.blogspot.com/2011/06/duke-nukem-forever-fan-art-in-game.html)**
>
> i never dreamed that one day, i would be able to draw duke nukem inside a duke nukem game. now i finally can, hail to the king! duke comes,...

---

<div class="post-metadata">

**Author:** ![Otreum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Otreum](https://forums.unrealengine.com/u/Otreum)\
**Post date:** [August 9, 2015, 8:15am UTC](https://forums.unrealengine.com/t/painting-textures-in-real-time/37878/7 "2015-08-09T08:15:34Z")

</div>

I would also like to know how this is done. RUST and now ARK have a form of drawing boards in the games as well as Duke Nukem Forever.

For me personally, I’m not so much concerned about painting pictures, but being able to “paint” an alpha mask at a hit location from a line trace in real time to reveal a layer of a material, which I believe would actually use the same principles as painting on an object/material in real time. If I am off topic, I am happy to create a new thread, but seems like this is all relevant to the topic anyway.

I think that ultimately, it will be a matter of getting hit location from a line trace (or click location), getting material from the hit actor, converting the hit location to UV coordinates on the material, and somehow altering the pixels on a mask on that material, or in the case of painting colours, adding colour to a blank texture which would blend with the diffuse, specular, normal etc (depending on complexity of paint material).  
It’s the “how” part that has me a bit stumped, and I believe it must be done with some coding, not via blueprints like I’m trying to do.

I stumbled across these links which may be of some use:

> **[Accessing pixel values of Texture2D](https://forums.unrealengine.com/questions/25594/accessing-pixel-values-of-texture2d.html)**
>
> I was wondering if there is a way to read/write pixel values on a UTexture2D object (e.g. read values from a heightmap or draw something on a texture). I’ve seen that there are FTexture2DMipMaps stored on the Texture that contain BulkData, which...

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

A while ago I also stumbled across this cool video of real-time per-pixel painting in UDK/UE3 for interest 🙂

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/c/8cc5f49ead0dcbbea2c00064569d0aa92674c53a.jpeg "UDK per pixel painting test 2") ](https://www.youtube.com/watch?v=R1B3VCMhE4I)
