WHAT
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?)
Sorry - that’s probably a bit misleading, so I removed the link. Make sure to toss any questions you have here and I’ll see about getting someone on to do shaders with C++ for a future stream!
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?
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.
Here’s some OSL code that does bevel shading. Maybe some super-clever person can understand it well enough to get something like that running in real-time.
Hi and thanks for the nice stream session. Asking the same thing as i did in a live chat: would you please share the practice material and functions so we could play and practice with them now?