black artifacts in Cycles

Okay, I worked on an update to the quality of that group node which should provide much better results (especially at strength values of 2 and below).
Cycles_Mbump.blend (612 KB)

I tried it, and I’m getting blacks if I replace with default Voronoi on a flat shaded cube (disable subsurf). Then I noticed there is no normalization going on after additions. I added a vector normalization (see image), and the problem went away at least for strengths less than 2. Shouldn’t vectors be kept unit length when using them for normal (angle) stuff? Feel free to correct me though.

Also, reversing the bumps (voronoi billowing outwards) can be done by negating the bump distance input, but this also have to be done within the group. Maybe it would be better if these are fed the same value automatically? Obviously appears very wrong if sign is unequal. The image:



Notice the dark “triangle” which happens on a relatively facing cube face, goes away with normalization.

Shouldn’t vectors be kept unit length

  • i assume Bump node does exactly that, am i wrong?
    At least SVM Bump node ends in:

	/* compute and output perturbed normal */
	float3 normal_out = normalize(absdet*normal_in - distance*signf(det)*surfgrad);
	normal_out = normalize(strength*normal_out + (1.0f - strength)*normal_in);
	stack_store_float3(stack, node.w, normal_out);

I wasn’t aware of that. I guess the normal input of the layer weight node prefers normalized vector input then, considering it does have an impact. Setup seems ok, from my limited knowledge standpoint. But it won’t do magic, only improve, and will still tend to fail if bump height exceeds sensible limits, and even increasing the bumping pattern density can throw it off. Definitely saving this for future use.

Simple solution would be to cut-off the negative normal values by the edges of your object. What you need is to get rid of the normal vectors which would usually be pointing away from camera but normal map(or bump node) made them bend toward it. This causes the black artifacts to appear. Please see the node group I created for solving exactly that (insert it between the bump and BSDF node).
NegativeNormalCutoff.blend.zip (237 KB)