Draw SphereMask to Render Target?

I’ve made a material that creates a SphereMask at a location:

I’ve created a Sphere with this material and set the Location parameter as the impact location of a line trace from the player camera, causing the Sphere to “light up” when I look at it:

So far, so good.

Next, I want to draw this material to a Render Target with the intent of having the Render Target accumulate SphereMasks when drawn to, resulting in something like this:

And after that, use that Render Target as alpha when lerping between two textures:

This should result in a run-time mesh painting effect.

The problem is that I first need to convert the SphereMask of the first material from World location to UV space before drawing it to the render target. How do I do that?

The same question have been asked here, but left unanswered:

It has this image that perfectly illustrates what I want to accomplish:

To clarify, I want something like the height map painter show here, except adapted to work on a Sphere instead of a Plane:

tracing a ray in blueprint allows you to retrieve UV coordinates from a mesh on hit, and that is what you should be using to get what you are asking for.

Sadly, that’s not enough. While that works for a simple plane, where the UV mapping to the mesh is continuous and uniform, for more complex shapes, such as the cylinder shown in the last image of my post, that won’t work. Using your suggested method to draw a SphereMask on the correct UV coordinate will cause the center of the SphereMask to appear in the right location, but everything aside from the center would be subject to texture stretching and discontinuous surface mapping (Again, look at the last image of the cylinder).

One year later and I’m curious about this as well. Is it possible with DrawMaterialToRenderTarget?

This is a dead thread but i was able to get something going for our game that does effectively this.

^^ example

So my setup is as follows
I use a paint can to hit a uv to determine where a sphere mask should start in 3d

I then render that same sphere mesh on an flattened version of the mesh so it flattens the sphere mask correctly into 2d
Sphere mask1

Then use a scene capture to take a picture of the flattened mesh as a white mask for my painting operations.

Here is the material function i plug into world position offset to get the flattened effect (for some reason uepastebin didnt like it but heres a picture)

If anyone can figure out how to do this without the scene capture step would be a true hero.