[Closed] [Request] Make materials more like blueprint classes
I think material editor workflow is outdated for unreal 4. What I would like to see is complete redesign of material editor to make it look more like blueprint class workflow.
Actually a material workflow is like a function with return node in blueprint class that is called every tick or? What about to create own flow control, compare variables with conditions, add local variables, access to owner actor variables, access to owner particle etc like in blueprint class? That would make materials much more flexible, dynamic and easier to use and make things like dynamic material instances and dynamic parameters redundant.
I do not know if you already think about it or I am just stupid with this suggestion than sorry if yes.
The question has been closed Apr 02 '15 at 05:04 PM by Footman for the following reason:
From what I understand Materials are just node editors for creating shaders. Shaders are programs that are run on the GPU instead of the CPU, and only work with vertex/pixel data. The GPU doesn't understand code the same way as the CPU does, and doesn't have access to the same memory that the CPU does so pointers to Actors will never work.
Materials do have flow control, the way I see it is that it just evaluates right-to-left instead of left-to-right. You can use the "If" node to do comparisons between variables, and the shader will take a different path depending on the result (< or >=).
Constant Materials are compiled before runtime to save performance, so they can't ever take variables/values as parameters at runtime. If you need to have complete control of parameters, you have to use a Dynamic Material. However, they are quite expensive, so if you have only 1-10 states or so, I would recommend making 1-10 instances of Constant Materials with overloaded parameters instead. Constant Materials are a lot faster.
Constant materials do not need really need to be updated (Unless you're using the Time function maybe?) because nothing will ever change. A Dynamic Material can be different for every object that uses it every frame, so I would guess that it would be updated per-object, per-render call. One update per object every 1/60 seconds could be very expensive, as you could well imagine.
answered Feb 28 '15 at 08:20 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here