[REQUEST] TAG string for textures in a material

I would like to have some kind of TAG string that we could set inside a material for each texture that we have inside that material. And also a way to retrive this TAG, probably on a trace hit result.

If you look at the attached pic, you can see that I have a mesh with a vertex painted material. With this TAG thing, I could query the hit result and know the texture name under the hit, with only one material.

The way Ue4 works right now, using surface types, for the same mesh, I would have to use two materials.


Can’t you get the texture information if you use textures as parameters and then use a material instance for the mesh? It’s been a while since i last touched vertex painting so i dont know how/if it works with material instances but i think it should be fine.

Well, more or less. I was able to get the texture name, as parameter as you said. But it is not relative to the trace hit result. Because the trace returns the actor, then I can go into that actor and get its material parameters, but this is not relative to the hit point. That is why I said before: “And also a way to retrive this TAG, probably on a trace hit result.”

Do you have any other way of doing that? With just one material, I mean? Or could this be implemented inside the engine, just like a trace his returns a “Phys Mat”, returning a “Texture Tag”?

My BP:

Oh, i see the limitation now. It could work if there was a way to get the vertex color’s channels inside the blueprint(like you would a vector parameter value) but i dont think its possible. I cant think of any other way right now and i have no idea how it can be implemented. :\ But something like this would be useful for sure.

So, I went to another approach. I worked on the mesh to have two objects and two materials, one for the bricks and another one for the vines. Then inside the Vines material I applied the physical material. Now, I can not detect this vine physical material on my trace. But if I apply the physical material on the mesh, instead of inside the material, the trace now returns the physical material. Why?

Right now there is no way to have multiple physical materials on a single graphics section. This is made tricky by the fact that we do not have access to the UV coordinates or mask textures on the CPU.