# Reading texture color data using UV values

**URL:** <https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888>\
**Category:** Rendering\
**Tags:** line-trace, uv, unreal-engine, color, question\
**Created:** [May 27, 2020, 4:15pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888 "2020-05-27T16:15:12Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [May 27, 2020, 4:15pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/1 "2020-05-27T16:15:12Z")

</div>

I’ve been searching online for a solution to this, but to no avail.

I am trying to read color data from a texture using the UV coordinates. As you can see in the image below, I am successful in acquiring the UV values.

For my research, I am simulating beam wander and turbulence through a volume. As I know, Unreal’s particle system and weather is purely visual. I’m hoping that I can layer many transparent “screens” with – let’s say green dots – to represent dust and other particles in the air. By layering them I hope to hack in volumetric atmosphere that, when the laser impacts a particle, undergoes some kind of interference, and in the event that the laser hits only a transparent surface, passes through easily.

[https://forums.unrealengine.com/filedata/fetch?id=1767117&d=1590516930](https://forums.unrealengine.com/filedata/fetch?id=1767117&d=1590516930)

All sources say this can’t be done in blueprints. Is there such a way? I’m currently trying to keep away from C++ unless totally necessary. Additionally, is there a better way for what I’m trying to accomplish?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2020, 5:52pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/2 "2020-05-27T17:52:00Z")

</div>

This can be done, I’ve seen it in these tutorials ( I have a feeling of deja vu ):

> **[tharlevfx](https://www.youtube.com/channel/UCzyMNIlh7lBQnIagTrEh1ZA/videos)**
>
> I have over 10 years experience In the games industry and teach part time at Escape Studios in London - an Epic Unreal Authorised Training Centre.  
> 
> If there’s a topic you would like to see covered please don’t hesitate to email me...

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [May 27, 2020, 5:57pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/3 "2020-05-27T17:57:11Z")

</div>

Hey Clockwork! I replied to your post but I guess it’s still “unapproved”.

Wanted to ask you if you remembered at all how to do it/what blueprint nodes were involved. It’ll help me narrow down the search

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2020, 5:59pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/4 "2020-05-27T17:59:58Z")

</div>

Yeah, sorry, I’ve like watch the whole lot in the last week, I’m having trouble locating it!

I do recall he just pointed it out in passing and just said something like ‘and you could use that to read the color value at a given point, very powerful’…

I’m tempted to think it was in the shader 101 series ( 4 I think ).

I will look further…

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [May 27, 2020, 6:08pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/5 "2020-05-27T18:08:03Z")

</div>

No apologies needed. Appreciate you looking into this! Let me know if you find anything.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2020, 6:12pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/6 "2020-05-27T18:12:37Z")

</div>

They are illuminating vids anyway, thoroughly recommend them. He shows you how to do much better landscape material and vertex painting than the UE system, it just goes around it!..

EDIT: I do know it’s not a ‘get pixel color’ node or anything like that, it’s a clever combo of basic nodes…

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2020, 6:50pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/7 "2020-05-27T18:50:43Z")

</div>

Ahhhhh… the cogs are whirring…

Dot product.

You have the U and V, the dot product is the ‘Z’ which is color, something like that I think… 😃

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [May 27, 2020, 7:00pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/8 "2020-05-27T19:00:01Z")

</div>

Hmm. That doesn’t seem right to me. UV are just (x,y) coordinates from (0,0) → (1,1) so dot product on them would just create a gradient from RGB (0,0) to (1,1)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2020, 7:02pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/9 "2020-05-27T19:02:27Z")

</div>

No, I typed garbage, but it’s that sort of simple thing… UV are basically like XY, but I can’t recall the rest. Best to mail him… 😃

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [May 27, 2020, 7:03pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/10 "2020-05-27T19:03:05Z")

</div>

Sure sure I’ll reach out to him haha!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2020, 7:03pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/11 "2020-05-27T19:03:40Z")

</div>

Tell me when you find out, I want to know now…

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 31, 2020, 12:53am UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/12 "2020-05-31T00:53:00Z")

</div>

No, it’s no good, can’t find the ■■■■ thing. Try mailing him, he’s very open to that. His email is at the bottom of all vids.

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [June 3, 2020, 7:39pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/13 "2020-06-03T19:39:39Z")

</div>

He reached out! Thanks. I ended up moving away from reading color coordinates and just storing values into an array.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 3, 2020, 8:32pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/14 "2020-06-03T20:32:22Z")

</div>

Was there an answer!?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_882d813f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_882d813f](https://forums.unrealengine.com/u/anonymous_user_882d813f)\
**Post date:** [June 9, 2020, 1:15am UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/15 "2020-06-09T01:15:06Z")

</div>

Here is an solution:

 ![303902-gettingalphavialinetrace.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/a/2da44bc215660973f7931109957cab4a9eea0cf9.png)

Notice you should have “Trace Complex” and “Support UV From Hit Result” check-boxes turned ON both!  
“Trace Complex” check box is in your Line Trace node.  
“Support UV From Hit Result” you can find in: Setting\>Physics\>Optimization\>Support UV From Hit Result.

> **[How to make Line Trace ignoring transparent part of a texture?](https://forums.unrealengine.com/questions/964208/view.html)**
>
> Using a sprite-based enemies like in old games. Tracing a sprite via Line Trace (sprite have an alpha channel for translucency). The Line Trace is hitting the whole sprite no matter whether it a transparent space or visible. How to ignore...

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [June 9, 2020, 5:05pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/16 "2020-06-09T17:05:13Z")

</div>

Here’s the video that he linked: [Debugging Materials with Graphs in Unreal - YouTube](https://www.youtube.com/watch?v=6SCgWC3jztY&t=6s)

He also said that using the render target would be an option; albeit slow and inefficient. Though for my purposes, I find it sufficient.

---

<div class="post-metadata">

**Author:** ![thugzook](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@thugzook](https://forums.unrealengine.com/u/thugzook)\
**Post date:** [June 9, 2020, 6:12pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/17 "2020-06-09T18:12:53Z")

</div>

Exactly what I needed. Thank you man.

 ![303979-eg2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/3/873dfa8e521166636f60b7bf49652949cc0b98d8.png)

---

<div class="post-metadata">

**Author:** ![Atilla\_ati](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Atilla\_ati](https://forums.unrealengine.com/u/Atilla_ati)\
**Post date:** [March 22, 2025, 2:45pm UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/18 "2025-03-22T14:45:13Z")

</div>

Hi, Even if I do the same I can’t read continuously. It stucks while reading on some pixel then continues.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/5/ef50663e0b717edef423ed568389486d8985ecdf.png)  
[2025-03-22 17-42-52.mkv](https://forums.unrealengine.com/uploads/short-url/2VtyScpIADLzMeRjfDLmcqklQVi.mkv) (6.0 MB)

Any ideas would be great.

---

<div class="post-metadata">

**Author:** ![Autocrator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Autocrator](https://forums.unrealengine.com/u/Autocrator)\
**Post date:** [December 16, 2025, 11:50am UTC](https://forums.unrealengine.com/t/reading-texture-color-data-using-uv-values/465888/19 "2025-12-16T11:50:16Z")

</div>

I can’t get it to work… Enabled the UV support from hit result, when I print, I get the correct material but UV variables are 0,0. Does the create render even work?, tried adding my own input and still got no color

I’m confused, broken and tired 😃 haha
