<aside> 🚨

None of these dots are real!

They are only a mask applied to a texture/shading value.

</aside>

Even if we made sure the dots are consistent sizes, you still need to keep this image in mind. All we are doing is checking a shading/albedo value against a dithering pattern and return 1 or 0.

the only difference is our left texture is a 3d texture which we shift between to maintain consistent dot sizes

the only difference is our left texture is a 3d texture which we shift between to maintain consistent dot sizes

void main()
{
    // whether or not we use light dots on dark background, or the reverse
    const bool dotToggle = ((uint(push.normalMatrix[3][2]) & 1u) == 0u);

    const vec3 diffuseLight = getDiffuseLight();

    float brightness = dotToggle 
									   ? 1 - getLuminance(diffuseLight)
									   : getLuminance(diffuseLight);
    brightness /= 2;

    const vec2 ditheringLevel = propperDitheringScale(brightness);
    const vec4 ditheringSample = texture(
													    sDitheringPattern, 
													    vec3(inUV / ditheringLevel.x, ditheringLevel.y)
															    );
															    
    // push.normalMatrix[3][1] is our specified threshold
    if (dotToggle)
    {
        outColor = brightness * push.normalMatrix[3][1] < 1 - ditheringSample.x 
					         ? vec4(inLightColor, 1.0)                                                                    
									 : vec4(inDarkColor, 1.0);
    }
    else
    {
        outColor = brightness * push.normalMatrix[3][1] < 1 - ditheringSample.x 
					         ? vec4(inDarkColor, 1.0)                                                             
					         : vec4(inLightColor, 1.0);
    }

    outColor.a = 1.0;
    outNormal = vec4(inNormalWorld, 1.0);
}

And as such,

  1. we cannot know the dots centers or radius. Our color is not defined from “our proximity to a point center” but simply by our value relative to the dithering texture sample.
  2. the dots cannot be perfectly consistent. we are not drawing circles, and as such, on edge, there will be spheres, cut offs, and other artifacts. It is our role to hide these as best we can, but they cannot be removed

example of such artifacts

example of such artifacts