c++ "Texture Sample" & "Multiply" Node
I want to recreate this Graph bellow in c++
I found this question https://answers.unrealengine.com/questions/441986/creating-a-dynamic-material-instance-on-c.html which has some code for creating a material but i cant find anything for doing the color multiplication
I have updated as follows. First I created a new material which takes a texture as an input parameter. I then use this code to load the material file
and then to draw the material to the hud
This draws just a black square in the HUD. The current material should not do anything to the color since it just multiples it by 1. Not sure whats wrong
The solution to the edited problem is to set the Material Domain to 'User Interface' in the editor
answered Apr 14 '18 at 06:10 PM
In linked you gave there no material creation at all, it just shows how to send parameter to material (which is shader if you didn't realize yet) which requires creating dynamic instance of material, which is not really creating new material. Instance is parameter state in memory which you can applying to multiple meshes on one go durring rendering, saving some performance.
So you need to do exact same things as answer in that question shows and in your material you need to place Scalar Parameter node with a input you gonna do in C++ function and plug it to B pin of Multiply and you ready to do. You do the same with any other parameter type and you can use multiple amount of them and control a lot of aspects of your shader with them. You can also create material instance as a asset in content browser.
answered Apr 14 '18 at 12:37 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here