OK, so, Unreal is acting pretty weird with the optimum texture/displacement thing. I basically had to manually recreate the nodes for parallaxing in the shader because it wouldn’t accept any potential solution through material functions. Believe me, I tried everything! Because of that, I had to move out all of the parallax operations to the back end of the system. What this means for you is A: making any changes to the shader will now be much easier because all the parallax is moved to the side, and B: you can select a channel for displacement maps in a packed texture. Also, you can now change the reference plane for all parallax materials! Just another benefit from the hard-wired method. If anything, this change should be more optimal than the previous method, but if you guys don’t see that as being the case, please let me know. Whenever I make changes to the main pipeline, I notice shader complexity shifts a bit, some materials get cheaper, others get more expensive. This method is required to use packed textures, though.
There’s a lot of weirdness even with this hard-wired node method: if you use iterative parallax (either 3 or 5 samples), the mask parameter will disappear from your options. It still performs the mask as it should, it’s just strange to have the option removed. If you need to switch channels, just uncheck “Use Iterative Parallax,” effectively scaling back to the basic 1-sample parallax method, and set your displacement channel. Then check iterative parallax if you wish to use it, and everything should work fine. Unfortunately, parallax occlusion uses a 4-vector “color” value to select the channel, so if you use parallax occlusion, you can’t use the mask, you need to use the “color” value to set it. Until Epic fixes the shader compiler, or until I learn HLSL, there’s nothing I can do to make single-channel parallax displacement any simpler.
I also added a POM shader complexity debug option. The material instructions for POM vary wildly based on how many passes you have and your displacement map. With this tool, you can optimize POM shaders for mid-to-low-end PC platforms. Like I said, the new engine handles POM spectacularly!
Aside from that, I also figured out a procedural method to handle the roughness seeding… only to find out it costs 5 more instructions than the old method. If you are working on Open GL or PS4, you can use this method to save one texture draw call and some texture memory (for a 2-pixel texture, lol), but for most applications, the 2-pixel texture method is much better.
It will be a while before the home content is good enough to really showcase to you guys, it’s seriously a major WIP, but I’ll see if I can get these updates rolled out soon so you guys can just have it to gawk at. 4.11 really improved how POM is handled, and I can’t wait to get it to you! Thank you for your patience
EDIT: I checked, and the new pipeline actually removes over 20 instructions from materials using the iterative parallax method, and a few instructions from most of the presets. So, all parallax methods are now much cheaper than they ever were before!