so after watching your video…
if ( A > B )
{
return float(1);
}
else if ( A < B )
{
return float(0);
}
else
{
return float(1);
}
if, elseif, else? you ever heard of >= and <= ? do you really need to cast 1 to float? can’t even.
you’re still comparing performance with branch A or branch B (and mixed), but you still never compare a material that does the same as the exact visual output of lets say, branch A (but without any of the branching stuff), against you branched material with branch A. i.e. the comparison of branched vs unbranched. therefore it’s impossible to know the cost of your branching (i.e. what I proved in my previous post)
“working model 1” is hardly a working model of anything real-life. you’re again dodging the issue of what branching tries to save up on: expensive operations. making a sum 300 times isn’t a working example of an expensive operation. this is relevant because as I’ve shown, texture sampling behaves differently.
I’ll need to test your working model 1, maybe passing just the order of the CustomExpressions works some magic but I cannot be certain just from looking at your video
“working model 2” obviously works perfectly because you copied my custom node where the expensive operations are nested inside the branch. all you did was add some extra unneeded stuff into the branch condition. you could remove your custom IF and just hook the clamp that comes before it, and it would work all the same.
in short, I just spent 14 minutes on a video where you show that your method (“working model 1”) is still not doing anything close to a real life scenario of what you’d expect dynamic branching to be useful at, and then showed that my method works (“working model 2”),