Strange Behavior in material editor

Hello

I noticed a kind of strange behavior while working on a complicated material. To make things easier to explain I created a simple example as illustrated in the attached images. The TexCoord node in both paths is set to (1,1) which means the B input to the if statement should be 0.5 in both cases. Basically it’s the same expression, however, as the preview shows, the output is different.

Any explanation??

Logical explanation from looking at the pictures is that your TexCoord is actually -1 instead of 1 :slight_smile:

Unfortunately this is not the reason. I double checked and you can try the same setup yourself.

A potential bug, Maybe?

Sorry, I guess i’m not sure I understand what the problem you’re having is.

The Texture Sample node preview is always based on a 0…1 UV space in the thumbnail box. The TexCoord input node doesn’t know anything about what meshes the material might be attached to in the game world (how could it?)

Your material code does what is expected. I don’t see any unexpected results.

BTW, the lower graph’s if statement reduces to, “if (Y / 2 >= Y) then A else B”, which is always going to give you A unless there is a negative number.

I see. Thanks for the explanation. I had a misunderstanding of how BreakOutFloat2Components should work. Your answer helped me figure it out.

Both TexCoord nodes though are set to (1,1). No negatives there :slight_smile:

Thanks again

Cheers