Download

What's best example to understand materials in math form

What would be the best example in math you would have to understand in order to make complex, high quality materials, or making sort of like a dynamic materials (doesn’t have to be Unreal Engine 4 material editor) I understand that more practice with materials are best way to go, but with most of the videos I’ve watched, there’s gotta be a catch of how professionals can create these amazing materials and I’m sure it isn’t just by sheer luck by throwing bunch of random nodes together makes a cool material. What I’m talking about is would material editing have something to do for example integration or algebra knowledge by any chance?

Integration: not really.

Algebra: sort of, in terms of a small subset of linear algebra, specifically a modicum of understanding of how vectors (definitely) and matrices (optionally) are used in 3D calculations, but if you’re making games you should probably already have internalized those concepts.

Aside from that, it’s helpful to know some trigonometry, i.e. what tangents are and how they work, and the characteristics of sine and cosine functions etcetera.

However, you can get good results just by understanding how simple arithmetic is applied to image/pixel processing, mostly what addition and multiplication does in this context. Division and subtraction comes in handy too, but less frequently. In summary, it’s all basic high-school maths. Typically nothing fancy at all.

Get familiar with all the basic input expression nodes like TextureCoordinate etcetera, and make sure you understand how UV coordinates work. All nodes in the material editor can be previewed to give you an idea of what’s going on at any point in the graph, so it’s fully possible to approach this in an experimental way, i.e. simply by adding/changing stuff to see what happens.

To make dynamic materials you typically use materials with certain nodes/values exposed as parameters, which can then be changed on the fly once the material has been converted to a dynamic material instance (you can do this in the construction script of any actor). This handles cases where you want each actor to have its own, local dynamic material. If you want global stuff, like all materials reacting to some overall world parameter (wetness for example, when it starts raining in your world) you instead use Material Parameter Collections.

[EDIT] Oh, and, no, it isn’t just by sheer luck by throwing bunch of random nodes together (well, sometimes by accident I guess), but by having a good idea of what you want to do, figuring out what data you need, where to get it, and the maths of it, then building a graph that produces that result. [/EDIT]

I recommend checking out shadertoy There are tons of examples of many of the effects you might be interested in, and you can see and edit the code right in you browser. Most of the GLSL code can be converted to HLSL without too much difficulty. HLSL function bodies can be used in custom nodes in UE4. For example, I based this post process material on this shader on shadertoy.

Start here: http://ocw.mit.edu/courses/mathematics/

Then go here: https://www.amazon.com/Mathematics-Programming-Computer-Graphics-Third/dp/1435458869

Then have fun here :stuck_out_tongue: : https://developer.nvidia.com/gpugems/GPUGems/gpugems_pref01.html

Give yourself some packs of years to digest all that as well, then you’ll know what those professionals know lol