Log inGet started
Package

toonFrame.shaderModule

README.md

toonFrame (shader module)

What a full-frame toonBlocks block reads at a pixel: tf_read returns the frame, its base colour, the light the scene sent as a share of full light (the frame divided by the base colour, so surface texture cancels) and the light's own colour; tf_normal_at the surface's shading normal at one pixel (the deferred renderer's copy, else rebuilt from world positions four pixels apart); tf_normal that normal averaged over a dense 8 x 8 pixel square on the same surface (4 x 4 on the low tier), so a round object, a low-polygon one included, turns smoothly and the light cut from it has clean band edges; tf_smoothed_light the light averaged over the same kind of dense square; tf_shaped_light the clean light from the scene's sun (shape, shadeLevel, castBelow), climbing from shadeLevel to full as a surface turns toward the sun, with open ground in sun three quarters of the way up; tf_shaped_span the two values that light takes in shade and in full sun, which a banding block cuts its bands across; tf_sun_seen whether the sun reaches the pixel. Pixels with no known base colour, the sky and the hull outlines' ink are marked unknown and left alone, and every gather leaves them out. Include after styleKit's skCommon and ~toonBlocks.shaders.toonLight.

Every average here reads every pixel of its square once (bilinear taps on the corners between pixels). A few scattered taps would not do: on a mosaic of small facets or on textured ground each tap crosses an edge at a different pixel, so their mean steps from pixel to pixel, and a band, a cast shadow or a poster level cut from it comes out stippled.

Known limits

  • A pass reads the scene's depth only when it also writes the scene picture (#24550), and an unknown blend name draws as replace (#24551).
  • A per-object value cannot reach a geometry pass (#24549).

The package README's Known limits lists the rest.