Tessellation not works with Triplanar Sample output

I played with material node with World Displacement parameter, and couldn’t make working with my existing material.
So I referred the Materials Sample and checked what was the difference between the working Sample material and mine, and isolated it.

This is the ‘working case’. World Displacement calculations were extracted from the sample.


I checked the intensity of channel by connecting it to the Color output.

And this is the ‘not working case’, which the Triplanar Texture Sampling is applied.
I removed all the unnecessary nodes, so the only difference is the connection through the ‘World Triplanar Texture’ node.


As you can see, no displacement is applied. I checked the wireframe, there were enough vertex to move.
I connected the Triplanar output to the Color to check, the output values were not zero - definitely existed.

I am totally noob with shader graph thing, so I am lost here. What is the difference of first and second material? And how can I apply the tessellation with the outputs of Sampler nodes, like World Triplanar Texture or Procedural Sample Texture?

In Textures.cs

            new NodeArchetype
            {
                TypeID = 16,
                Title = "World Triplanar Texture",
                Description = "Projects a texture using world-space coordinates instead of UVs.",
                Flags = NodeFlags.MaterialGraph,
                Size = new Float2(240, 60),
                DefaultValues = new object[]
                {
                    1.0f,
                    1.0f
                },
                Elements = new[]
                {
                    NodeElementArchetype.Factory.Input(0, "Texture", true, typeof(FlaxEngine.Object), 0),
                    NodeElementArchetype.Factory.Input(1, "Scale", true, typeof(Float3), 1, 0),
                    NodeElementArchetype.Factory.Input(2, "Blend", true, typeof(float), 2, 1),
                    NodeElementArchetype.Factory.Output(0, "Color", typeof(Float3), 3)
                }
            }

‘World Triplanar Texture’ node only outputs 3-float RGBs. Is this means Triplanar node samples only three channels from the texture? Isn’t there a way to extract the sampling channel by channel?

That’s a limitation of the Displacement that is being evaluated in not Pixel Shader so the code generated for shader was unable to properly sample the texture.

Fixed in Fix `World Triplanar Texture` node to support displacement and float4… · FlaxEngine/FlaxEngine@979ab9f · GitHub.