GODRICH
#css-animation#button#loader#transition#scroll#dashboard#ui#design-trends

03Face shading — computing three faces' brightness from a light angle

Take the dot product of each face's normal (top, left, right) against a fixed light vector ahead of time to fix brightness ratios (say 100%, 70%, 45%), then feed those into filter: brightness(). Change one light-angle variable and all three faces recompute from the same formula.

Best forProduct mockups, icon sets

filter: brightnessCSS custom propertieslinear-gradient
Face shading — computing three faces' brightness from a light angle
Open in a new tab

03 Face shading — computing three faces' brightness from a light angle — Measured area 5.965% · moving frames 23/23Original by GODRICH · SCSS and React ship in the zip · Isometric CSS: 9 True-Projection 3D Dioramas

The post this demo lives in

Isometric CSS: 9 True-Projection 3D Dioramas - preview of all 9 demosIsometric CSS: 9 True-Projection 3D DioramasIsometric css done right: Each cube face shades by a light-angle calc, grid coords map to screen via the 2:1 isometric f See all demos in this post

If you like this effect - similar demos