Reading Texture Color Data Using UVs | Issue with Read Render Target Raw UV not working as I anticipated

I’m working on implementing a solution provided in a previous post of mine on reddit.

In short, I’m using a line trace to detect the specific color of the texture where my line trace hits to determine whether I’m hitting a body of water (black) or a landmass (white).

After adding an alpha texture (with the compression settings set to Masks no sRGB) to my material (which is set to Blend Mode Masked) the oceans have disappeared and my print string (set to print the alpha from the linear color of my Read Render Target Raw UV) is only ever showing 255, whether I’m pointing at the landmasses or water bodies. I am very inexperienced with Materials, but I feel like I’m close to the solution and might need some help.

Is there anything apparent in my blueprint and/or texture settings that I can change to show the water again and still be able to differentiate between tracing into a landmass or body of water?

I solved this by creating a simple unlit material with an Alpha texture of the earth, then I ran a line trace and sent it’s Hit Result into a function called Read UV that takes the Collision Impact point and translates that into a point on the Render Target which Read Render Target Raw UV then translates into a Linear Color. I use the B channel value to check if the Color value is less than 1.0 and if so; consider it a landmass.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.