Creating a new Material in C++
Hi everyone, I'm trying to build a program that, given a project path, would load at runtime a 3D scene. I've already done it using Unity 5, and I wanted to recreate the same product under Unreal to compare pros and cons. Right now I'm struggling creating a new material starting from some input parameters (i.e. the program reads a bool isReflective variable set true, and creates a new reflective material instance). Under Unity was quite easy because all I had to do was to load the proper shader, but I can't find any parallelism under Unreal.
Is there any easy way to create a new material instance from Engine/Shaders or any other already existing resource using C++?
asked May 16 '16 at 08:03 AM in C++ Programming
If anyone else needs to create material in c++ you can do it like this:
you can also specify outer and a name and all that stuff. But what more interesting is that you can actually create material nodes in c++ and compile them. For example:
This will create a material with a const vector3d parameter in your material. I don't know the limits of it, I only had to work with constants, textures and multiply nodes. Anyway, hope this help somebody.
answered May 22 '18 at 01:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here