Vertex Shaders / Material Editor

Hi all.

I’ve been reading this article on rendering in UE.

I find it really frustrating and I’m missing the point of it.

Is this all really necesary to just create a simple vertex shader and apply it to a material? What’s your approach in general? Can that be done easily through other methods? (Material editor, via custom nodes?)

It’s literally two clicks on Unity to create a shader and associate it to a material, then write the glsl code. It’s insane here!

Hey darkgaze,
That information you just gave!, is very good, thanks for that, Matt Hoffman does an incredible job there!,
Anyway, back to your concern, all I know is that if you want to implement your own Vertex shader you have 2 ways in unreal, the first one is the hard one, you should create a new shader model and then implement your shader there, “again Hoffman have the paper for that”, and the another one is easier and is the one I know how to use, inside your material editor you have a special node called custom, inside this little guy you can type your hlsl code, people at epic always say that you shouldn’t use this for simple stuff like multiply or add values, because under the hood the nodes available for that are better for performance, this is just something to keep in mind

yeah definitely insane here!, I hope they can offer a better solution with time!, but speaking about pipeline and quality the material editor is doing a very good job

Oh man… implement a new shader model? I’ve heard that means modifying the engine. I can’t, this should be inside a plugin for the marketplace. I hope I can find a different way…

Using the custom nodes is a bad idea… indeed. I’ve heard bad stuff about it, too. But well… I’ve been told that what it does is probably pass the shader through some optimizer… maybe I could do the same… but I need to do more research on this. It’s really insane, I can’t understand why this isn’t more open and more documented…

Any other ideas, folks?

Thanks!

Btw, I found this answer on another thread in the Rendering section:
https://forums.unrealengine.com/development-discussion/rendering/1432387-vertex-shaders-in-custom-nodes

So we can’t? Confusing

In the other thread they mention using the VertexInterpolator node for doing Vertex Shader work, which is something I heartily endorse.

Behold! the Affine Texture Sampling material, harking back to the good old PS1 days.

affine_texture_sampling.JPG

hi @darkgaze no, we aren’t confusing anything, in fact you can add custom code with the custom node, like the last guy in your other post has said. But honestly, for me that is not enough, perhaps we need request this as an engine feature in the feedback forum, I’d like to have a .usf editor, the actual implementation with the custom node is very basic, and the current implementation for usf custom files requires too much steps!!!

Yep! In fact, we don’t need an editor, we are fine with VS…, but a way to make it detect the file and apply it … that would be great
I have no idea how to pass data to that custom node, though. I’ll have to do some research.

I’ll look into that, @Gossy Neat!

Oh God, do I need to create a whole shader model in order to have Unreal to use custom vertex shader code for its different passes? You guys accomplished anyhting about this topic?
Thanks! :slight_smile:

In general the rendering pipeline is becoming more modular, which means it’ll be much easier to do that kind of thing (starting with adding custom buffer passes, yay!)

I don’t know what kind of ETA we’re looking at for that though.