Curious on how to create shaders and materials in UE4? Then don’t miss Thursday’s stream. Alan Willard returns to the Unreal Engine studio to demonstrate the creation of a sample shader, reminiscent of a Palantir. He’s also ready for some serious Q&A, so if you’ve got questions for him, drop them in the comments below and we’ll try to answer them on the stream!
Woah, am I right in assuming this means shaders in code? Or is it a material shader livestream?
Don’t get me wrong every video Alan makes on Materials is solid gold and has taught me a bunch, but linking to the shader development page has got my hopes up that the stream is about writing custom shaders using C++ and HLSL.
If so, I’m SUPER looking forwards to this. If not, still will be great, but hope that one video about using custom shaders and getting them to link with the Material system is made soon (especially considering that the engine now lets you define Global Shaders even in the binary build/plugins apparently?)
Granted, that’s DirectX 9, which is pretty old and doesn’t come with the fragment shaders and other new features. But, it’s enough to get your feet wet with raw HLSL. Raw HLSL is really challenging to debug properly though. You have to use a scene debugger which lets you sample an individual pixel, view the draw calls on the GPU, and figure out what is happening to make the pixel the color it is. There may be multiple shaders which play a role in that, so it can be very much like searching for a needle in a hay stack. After using the UE4 material shaders, I never looked back or want to touch HLSL again, directly. Only in the very most dire of circumstances, will I create a custom node in a material to inject HLSL code (which has only happened once!).
The key thing to note (and this is in the documentation for the custom node), is that injecting your own HLSL into the material node graph can limit the amount of optimization UE4 can do. Large blocks of HLSL code can make a shader really hard to optimize, and thus, it may run slower.
Was there a stream on global shaders in plugins? I know there was one planned, but I thought it got cancelled. For materials I would love to hear about any new nodes added in the last couple releases of the engine. Also, maybe a bit about some of the functions that are in the engine content that are available but maybe we might not know about them or not as visible.
How to create a material that supports tension maps? (clothes folds, eye wrinkles, muscle flex)
How to create a material that “fills in” camera-clipped geometry? (If the camera clips through a mesh, fill/overlay that space with some solid color?)
How to make materials/textures affect AO color, how to dictate AO color per material?
Mesh distance fields:https://youtube.com/watch?v=shmJIbCayhc^ How to remake this in 4.18, and can we make it “self-collide” for more complex meshes, like characters, or some work around that would make it appear function that way?
Request**: A Dummies-Guide-To-Materials that interact with the larger 3D world / camera render (RED nodes).
Examples: Radar Pulse effect and Radial Blur effect. Not looking for / expecting a node by node breakdown.
More a sky-high short explanation of how these effects work outside of more normal everyday materials etc.**
(i.e. A breakdown of the master or core steps needed to ‘build-the-effect’… Or a list of the most important ‘moving-parts’)…
(Materials on a mesh are easy to deconstruct, unlike Materials that involve 3D world space / camera view / post process)…
Would really appreciate to hear some thoughts on implementing clipping planes (e.g. making a section cut through multiple objects).
Especially with datasmith coming on would really be a big improvement…
The post-process zoom blur effect is a reasonable request though. It’s something you can work out on your own step by step if you’re familiar with post-process domain shaders too, it’ll be one of the easier effects to start with.
The maths is pretty straight-forward: sample the same material several times and blend the results. Use UV coordinates and a bit of maths to offset the sampling.
Once you’ve figured out how to do it, try converting it into HLSL in a custom expression node, as repetition lends itself to this.
Dear Epic: please add a loop node into the material graph.
But there was thread a long time ago here on the UE4 forums where someone made a bevel shader, they called it something else though, but I haven’t found that thread again, idk where it was, but it was somewhere here.