POM material

Is fix something spesifically for POM or is it just general material compiler magic.

General compiler magic for all custom node functions. Previously it was just making a new custom function pretty much every time it was needed instead of checking if one already existed. The fix also made things a bit more workable in terms of cross function calling although there is still progress that needs to be made there (such as custom naming of functions as they show up IN the shader for reliable calling).

Our engineer Rolando Caloca Olivares performed the optimization.

Would POM material work with mobile VR (Gear VR, Galaxy S6) ?

I have used it on PC VR before, in fact bullet train used POM a little bit. In the tunnel one of the yellow floor tiles had POM. It used to be in the main combat area but was changed for art reasons. You just have to use very few steps and make sure you profile.

for mobile I would be surprised but it may work if your scene is carefully budgeted and you keep the number of steps low (ie less then 8 or 16 or something). as an example, the recent samsung galaxy epic demo had some raytraced metaballs in the intro and that shader was similar to POM in complexity but it had to be tweaked to run fast.

Right, but S7 is different from S6, and I am sure a lot of people still going to keep their S6 (I personally canā€™t justify upgrading to S7). So, the questing is if it will perform well on S6. There is a game on Gear VR called Dreadhalls (built with Unity) that allegedly uses POM effect a lot. It runs pretty smooth on S6.

I never had a S7 to test on, I only have a nexus 6p. AFAIK they are pretty much the same GPU in terms of raw perf. I had to optimize for the 6p anyways. It ran faster on the 6p but only because we ran at higher res on the final device. Had to run to somebody elseā€™s office once in a while to verify on device.

if I have some time later today I can try firing up a POM material in the 6p. I probably only have it for a few days until somebody from QA snags it back.

Well, Gear VR works with S6/S6 edge/S6 Edge+/Note5 and S7 (which isnā€™t out yet afaik, but available for preorders). S6 and S7 (for NA and China at least) have different SoCs.

But yes, it would be nice to know how it performs on your 6p in VR rendering :slight_smile:

I dont have any mobile VR to test on. I can test it on the 6p in regular style. but shader cost doesnā€™t really go up with VR like object count does. I am not sure where the 6p is in terms of the performance hierarchy. I know very little about smart phones. My phone is the 20 dollar kind.

, did you ever find out if itā€™s possible to achieve rotated POM decals?

Would be useful for putting them on walls and whatnot.

I could only get it to work using a blueprint and using a virtual plane for the POM orientation. That way you can specify the tangent vectors as three vector parameters. will work for decals on flat surfaces but I am afraid it will not work very well for surfaces that have deformation. Even if it could, youā€™d see some pretty bad distortion artifacts without using real curvature data.

Thanks I got it to work :slight_smile: The custom rotator didnā€™t output a third component because its a v2 output, so the B component mask errored. I figured out that when rotating it around Z, its tangent space so B is (0,0,1) so I plugged that in. Made me wonder why the third component is used in the divide in the viewtrace length section. Iā€™m guessing it has something to do with changing the length of the tangent vector after its been normalized?

Canā€™t wait to try with the performance bump. Then I need to see where I can optimize as figure out nice ways to handle blending/masking (something similar to the height blend/mask from kite demo) or a simple max.

I think Iā€™ll call technique POM-BOMB.

I was going to be using to procedurally create cool natural ground materials from a small amount of input textures. Today I discovered wang tiling from someone on redditā€¦

ā€¦so I might try that as well

The divide by Z is how we make it create a ray with enough length to always hit the bottom of the virtual floor that we are projecting downwards. At glancing angles, ray length approaches infinity as Z approaches 0.

right here is one of the biggest differences between POM and bumpoffset. Bumpoffset does not do the divide by Z which reduces the height along the horizon which also helps to hide artifacts.

I made graphic to explain something different in relation to pixel depth offset but I think it still shows point:

On the left is a normalized ray without divide by Z. you can see even if you scale it to the desired height it will not hit the floor at glancing angles without adjustment.
The comment about product is a bit unnecessary in case. The Z is simply the tangent space camera vector Z.

Nice one! However, is there a way to also use a mask so that the sand(?) blends more naturally with rocks?

I would probably perform a heightlerp with the sand and rocks using the height of the rocks as the height texture. To clarify, the heightmap needs to be looked up with parallax UVs as well.

There will be some minor floating artifacts with the sand but if the color fairly float like above it will make it hard to tell. You can also try doing things like soft bumpoffset on the sand where it meets the rocks. as long as the height change is gradual bump offset will work ok. Sadly you canā€™t really use POM for that part since there is no way to raytrace the painted layer weight. If it was only textures defining the boundaries then you could do a combination POM and get a perfect result but it would be slow and require some tweaks to the custom node code.

fwiw the content example map prepared for 4.12 has an example of height lerp using POM. In that example I put the POM onto the second layer as well to avoid the floating but that wonā€™t work in all cases.

Found on Slideshare:

Slide 25-26 are about silhouette POM in CryEngine.
Maybe useful :rolleyes:

Hi ,

Could you or anyone else with the know-how give some clarity on the method by which youā€™d accomplish ? Iā€™m having trouble getting POM to work consistently at all really, even on regular meshes.

http://i.picpar.com/0aKb.gif

I use the masked blend mode for the trim material for nice edges but naturally that doesnā€™t make a difference from regular opaque. My textures are nonsquare for the trim if that makes a difference! 2048x128. You can see it works fine however on the main road which is using a square texture.

Edit:

I would love to be able to do myself, too. They mention in a youtube comment that itā€™s just a matter of using the ā€œcorrect node setupā€ to allow rotatable POM decals, but from everything Iā€™m reading here it seems like thereā€™s more to it.

As a side note, Iā€™m a rendering tech artist so no need to beat around the bush with abstractions or what have you. I just donā€™t know blueprint as well as I should :stuck_out_tongue:

Hmm I am not sure what the is with the above shot. Typically that is what it looks like when you try to use WorldCoordinates without checking the world coordinates boxā€¦ maybe in case you are doing the opposite and have worldcoordinates set to true when it should be false?

It is just regular static mesh geometry right? Should be nothing special required to make a material like that work. A picture of the node graph would help to debug.

I will try and post some info on the decal thing later but I have a lot on my plate atm.

you arenā€™t trying to use anything other than UV0 are you? ue4 only supports a tangent basis for UV0 so it goes without saying that POM will only work on UV0 coordinates (or world coordinates which bypass the transform). Technically it would be possible to use other UVs but would require multiple chains of hacks so I wonā€™t even go into it.

Thanks for the reply :slight_smile: Any input on decals is appreciated if itā€™s not too much trouble. I definitely feel you on being busy lol

http://i.picpar.com/dgKb.jpg

For good measure I plugged up a bool and manually set it to false. is all one static mesh btw and the materials are set up pretty standard with a multi-sub mat in 3ds max, but yes itā€™s using UV0. Iā€™ll keep plugging away!

Ah I see what is happening. Looks like POM isnā€™t handling non uniform texture scaling at all. Should be relatively easy fix. Simply have to squash the post-transform ray by the same scaling factor. Will try to get a solution tomorrow.