# Correct way to do Dynamic Textures in 4.9?

**URL:** <https://forums.unrealengine.com/t/correct-way-to-do-dynamic-textures-in-4-9/335600>\
**Category:** Asset Creation\
**Tags:** unreal-engine, CPP, question\
**Created:** [October 17, 2015, 8:41am UTC](https://forums.unrealengine.com/t/correct-way-to-do-dynamic-textures-in-4-9/335600 "2015-10-17T08:41:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tmek](https://forums.unrealengine.com/u/tmek)\
**Post date:** [October 17, 2015, 8:41am UTC](https://forums.unrealengine.com/t/correct-way-to-do-dynamic-textures-in-4-9/335600/1 "2015-10-17T08:41:35Z")

</div>

I’ve been banging my head on this for quite a while now. At this point I just keep coming across the same search results trying to find a solution through google, answer hub or forums.

Are we supposed to be able to do dynamic textures with just a normal simple Unreal C++ project or does it require downloading and building the entire engine source?

Are we still supposed to use the code for UpdateTextureRegions listed at:

> **[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 — ue4community.wiki! You will be able to find content from the official...

(if so, I can’t get it to compile in 4.9.2, see attached text file for errors. Am I missing an include perhaps?)

Or are we supposed to use this method built into UTexture2D?

> **[UTexture2D::UpdateTextureRegions](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/Engine/UTexture2D/UpdateTextureRegions/)**
>
> Asynchronously update a set of regions of a texture with new data.

(I’m guessing this method was added to UTexture2D sometime after the wiki article was written?)

Using the built in method compiles and executes without errors but something is wrong: (see image)

I’ve attached the .cpp and .h for my simple actor class. as well as screenshot of the blueprint used to apply the texture in the hopes you might catch something I’m doing wrong.

[attached compile errors.txt][1]

[attached actor.cpp][2]

[attached actor.h][3]

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/c/78c2f7048ca450143a3c77c477e393a2a589b015.png) ](https://i.imgur.com/iAg19yS.png)

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/5/b/75b8ce5c3a89287d54f47a254f85dd380dbfa898.png) ](https://i.imgur.com/c4MOnr2.png)

---

<div class="post-metadata">

**Author:** ![tmek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tmek](https://forums.unrealengine.com/u/tmek)\
**Post date:** [October 17, 2015, 10:04pm UTC](https://forums.unrealengine.com/t/correct-way-to-do-dynamic-textures-in-4-9/335600/2 "2015-10-17T22:04:53Z")

</div>

After some more searching I found this post: [How can one compose DynamicTextures at runtime in C++? - Programming & Scripting - Unreal Engine Forums](https://answers.unrealengine.com/questions/63597/how-can-one-compose-dynamictextures-at-runtime-in.html)

The wiki article omits the detail that you must include the “RHI” and “Render Core” UE4 API modules in your project’s build.cs file. I added a “note” the wiki since it seemed to be a point of confusion for multiple people.

For a complete minimal working example check this forum post (but it also fails to mention the “RHI” and “Render Core” additions).

> **[Setting Up a Dynamic Texture](https://forums.unrealengine.com/showthread.php?50349-Setting-Up-a-Dynamic-Texture&p=169623&viewfull=1#post169623)**
>
> I found this example code for a dynamic texture here: A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums, and I’ve been trying to set up a simple class derived from Actor that fills a 2D texture with data...

**I’m still confused what the purpose of the built in method UTexture2D::UpdateTextureRegions() is.**

It has the exact same signature as the function listed in the wiki article but has different behavior. I can’t seem to get it to do what it’s signature suggests it should do.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0dafa81b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0dafa81b](https://forums.unrealengine.com/u/anonymous_user_0dafa81b)\
**Post date:** [May 23, 2016, 1:04pm UTC](https://forums.unrealengine.com/t/correct-way-to-do-dynamic-textures-in-4-9/335600/3 "2016-05-23T13:04:19Z")

</div>

I want to load texture dynamically with mipmaps…Is there any way to do it?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e10a6464](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e10a6464](https://forums.unrealengine.com/u/anonymous_user_e10a6464)\
**Post date:** [October 12, 2016, 7:29pm UTC](https://forums.unrealengine.com/t/correct-way-to-do-dynamic-textures-in-4-9/335600/4 "2016-10-12T19:29:56Z")

</div>

me too but for some reason mip maps makes it crash (and without giving a useful error message)… so I ended up having to disable mip maps, which is bad for performance
