Shader tesselation question(custom node)

Hi everyone…

I use some custom material node along with noise to create create a procedurally generated material.

The problem I am facing is at the end of the material, I get a grey scale material. But, I cannot use it in height map. It is showing some error.

The custom material node just return a float but I get error when I connect my node to world position.

Hey envenger -

Without looking at your scripting itself, I would guess that you have a call in your script that tries to connect a vertex shader parameter to a pixel shader parameter which cannot be done implicitly and must be set up through a variable structure.

If you are comfortable doing so, feel free to post you code and I will give it a glance to see if I can resolve the call.

Thank You

Eric Ketchum

if(Input >= 0 && Input < F2)
{
return 0;
}
else
{
return 1;
}

if(Input >= 0 && Input < F2)
{
 float Output;
 Output = Input/F2;
 return Output;
}
else
{
return 1;
}

These 2 are in the custom material nodes.

They return a float. I wanted to use this has a height map so that I could convert it into a normal map but that doesn’t seem possible. It shows “cannot convert from float to Texture2D” So I thought of using tessellation.

Hi!

This problem exists in UDK too. And solution was to change the type of the class node in the shader source code. The problem is that the output value of a node expression has a data format of “float”, but the compiler believes that the data type is not correct. Even if we use this as an alpha and connect to “Lerp” in WorldDisplacement. All the same, an error occurs. It is either a bug. Or needed method for converting data type.

Thanks for reply.

I got another small question though. Can this grey scale image be used to create a normal map? The heightmap to float node asks for Texture2D and doesn’t accept floats.

Hey envenger -

We are going to continue to look into the issue with the Custom node, in the meantime, the logic of you script can be replicated using the following material setup:

I will keep you informed as we investigate the custom node.

Thank You

Eric Ketchum

Hey envenger -

Not direct through that particular material function, the Normal from Heightmap, it is setup to take only a texture 2D as the heightmap image. You can however open that function and use the logic and replace with your generated greyscale image just replacing it in place of the Texture Samples in the Material Function.

Hope that helps out -

Eric Ketchum

Can u share how u changed it and which class node?