Adding textures to a ProceduralMeshComponent (C++)
I'm new to Unreal and I've been playing with the ProceduralMeshComponent the last few days, using only C++.
I wanted to import meshes at runtime, and I managed to do that with the help of the Assimp library. So, right now I can load any mesh at runtime and it works fine: the thing missing are the textures.
Suppose I have a .obj mesh, with a .mtl file and a single .png texture. Suppose that I have no idea of what mesh I'm going to create a runtime, so I don't know how many materials there are and so on. How can I create the materials at runtime for this?
I've been looking all day on the internet for this kind of situation, but I couldn't find anything related. People always use materials that are made from within the editor, they don't create it via C++ code, but that's what I need.
I've looked into instanced materials and tried to do something like this (it's just an example in which some properties of the material get changed):
The problem is that there is no starting material in my case, and the parameters I'm "modifying" in the example aren't present since they weren't defined in the editor.
So, to sum up, I'm running out of ideas. Is there a way to create an empty material from scratch in C++ and then fill it, in particular with a texture?
asked Dec 22 '16 at 09:14 PM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here