First I hoped there may be just a node, that extracts the average color for me, but this doesn’t seem to be the case.
Then I wanted to blur it, but that doesn’t seem to work that easy as well.
So the plan I’m now following is to tile the texture by a very high value (like 100) until there is no visible structure left.
Like this:
Is there any way to do that?
Of course I could just import the Texture Sample twice and put two different texture coordinate nodes in front of them. but that’s not the way I would prefer, because I later want to instance the material and the texture is supposed to be exchangeable. Always having to replace two identical textures wouldn’t be very nice.
Or does anyone of you have a different Idea how I could solve my problem, instead of tiling the texture?
There isn’t such node and doing it in material is impractical. You would need to calculate the average color elsewhere and pass it as a parameter to the mat.
The closest you can get is by sampling all texels of texture’s lowest mip and averaging their values.
Ok, I have a solution.
In case anybody else is wondering, here it is:
So instead of importing the texture as a texture sample, I imported it as a parameter texture object now, and fed it into 2 different texture sample nodes. This way I later just have to replace one texture in the instance, but still can apply 2 different texture coordinates.
For folks looking at this later, you can also change the mip value to something really high to get the same effect. It should be more performant, I think?
You are correct. Generally, exposing the MipMaps on the texture will allow you to enter a scalar / float value that do the exact same thing but be much more performant as no UV operation is required.