Author Topic: Input nodes  (Read 1071 times)

Hi there, i want an input node for my AO map, but when i don't have an input i want the AO to appear white. The input node is Black by default is there a way to change this to white, or another work around for this. I think the way i'm tackling this isn't right. Hope i'm making sense.

Last Edit: December 05, 2018, 10:58:13 am

in the transform node put the mip mode to manual and set to miplevel to something high like 20 or so, so it should work with very high resolutions as well. this gives us the average color of your input, which we then check in the pixel processor for its value and if it isn't 0 then there is some information in the input texture and we output the input texture. if returns black, then we just put out white.

in practice this will likely be good enough. depending on the intended bit depth to be super precise you would need to make a custom node that finds the minimum value of all pixels in the image and compare to that instead of the average.

something like that a bunch of times with increasing kernel sizes, but again, probably not worth it for your use-case.

divi.cig has the cost-effective solution.
Here's one that's easier to set up.
Use a distance node with max distance. If there's anything but black in the input, this will expand it.
Use a levels node to pull any gray up to white.
Now you can use this as the mask in your blend node. It will be completely black with no input, and completely white with an input.

"Better than some, no worse than others."

this might not work in all cases. the distance node thresholds at .5 value, so if your input has no data above .5, but plenty between 0 and .5 this will not work at all.

however this might be just fine for AO maps, as they usually are fairly bright.

Yes, you're absolutely right. That's why I always pull up the whites before the distance node as well. I forgot to show that step in the example.
"Better than some, no worse than others."

thanks guys, i will give this a bash.