Hey folks,
just downloaded UE4 and gonna give it a spin now. But also want to gather some in-depth feedback regarding some of my use-cases/topics I implemented very nicely in Unity 4.x previously writing custom shaders.
Main reasons I’m now looking into UE4: it’s C+±based, has a better performance reputation, not outdated Mono Framework / GC to fight, seemingly much better editor performance, more robust and contemporary terrain. But – one of Unity’s “pros” is the render pipeline is quite transparent and fairly “hackable”. Implemented various physical-based shading algos in Cg smoothly and really like to handcode shaders knowing the project context and rendering requirements.
By the way, I know “UE is full source so you can tweak it any which way you want” but this is unrealistic, I want to ideally stay within the official engine version to allow for smooth future updates, want to minimize the time spent hacking C++, etc… so in this thread looking for current or potential/near-future out-of-box support
Custom deferred
One thing I implemented was “my own deferred renderpath” setting up multiple-render-targets with specified render-texture formats, ie. my own g-buffers to be sampled into from inside my own custom-coded post-process “lighting (and lots of other PP) Cg shader”.
Did this originally because Unity 4.x Deferred is 2-pass (light pre-pass) and I desired single-pass (more modern deferred like UE also uses). But quickly realized it’s very powerful if I can control which g-buffers exist and what info they encode. Lets me later add support for per-pixel wetness or motion-blur velocity or or or… you get the idea. Applying physically-based lighting for diffuse+specular+reflection in a post-shader is a comparatively trivial matter for me now. The question is whether I can set up something similar in UE4 using its existing API without rewriting a lot in C++, because for that I wouldn’t be cut out and would be counterproductive.
Post-process shaders
I know the most-important common post-processing effects are included out-of-box but there’s always scope for more, heat-waves etc! More importantly, I really prefer to read and write the shader code that’ll run. In Unity if you select multiple out-of-box post-effects, they chain them so each is its own render-texture and shader program invocation. Wasteful. I combined all I needed into a single post shader. So all in all have 2 post-processes, lighting itself (plus a few effects that use the depth and lighting info already present at that stage, including some stunning “water as a post-process” shading) and final (other trivial stuff like natural-bloom, tonemapping, underwater, color corrections). Will I be able to “hack it” similarly in UE4? Or how do multiple post-effects get combined here? Where’s the “shading internals” documentation?
“Realtime IBL”
In this project there’s never be any baking or lightmaps. All lightsources are movable and dynamic, think open-world 24-hour cycle. I faked “realtime IBL” for a beautiful ambient term by generating per every (or every nth) frame a simplified reflection texture (sky and terrain and big static geometry vertex-lit), supporting both HDR cubemap and 2D HDR paraboloid. Performance-wise fine, no bad hit, shader code as usual under my full control. This gave me “skylight” of sorts and an ambient term AND per-pixel reflection color that was really fairly pretty when also doing physically-based shading. “Good enough, given that we don’t need to bake or preprocess anything ever for it.” So much so I wouldn’t even worry about any indirect lighting / global illumination as long as some ambient-occlusion happens later on. Now, once again the question: does UE4 something similar out-of-box, will it in the near-future, or can I implement this myself in a reasonable manner?
Vertex shaders
Sooner or later you need them. Can I code them for UE4 as part of materials? Funkiest vertex-shader thing I did in Cg for Unity was Morgan McGuire’s single-drawcall terrain renderer…
Look forward to all your opinions on any of the above