SmartArt · 3D

Microsoft's own spec for 3D lighting is turned 90 degrees

Office's specification lists exactly where its 3D lights point. Draw them as written and the highlights land in the wrong place. Turn them a quarter turn and everything matches.

· 2 min read

SmartArt has 3D styles: Polished, Inset, Cartoon, Powder and so on. They give shapes a bevelled edge with highlights and shadows, lit by a set of virtual lights.

Microsoft's specification for the file format includes a full table of these lighting setups, with a direction vector for every light. That seemed like the easy part this week. Copy the table, do the lighting maths, done.

The highlights were in the wrong place

On a simple bevelled circle, the highlights should be easy to find. Each light makes a bright spot on the bevel, at an angle that depends on where the light comes from.

Drawn from the table as written, my highlights landed in the wrong spots. Not randomly wrong. Consistently wrong by the same amount.

The answer, found yesterday: the vectors in the table are the direction the light travels, and they are rotated 90 degrees counter-clockwise from the page's axes. Turn them a quarter turn and the "flat" setup's three highlights land exactly where PowerPoint draws them, at 0, 100 and 225 degrees around the circle. The depth of each highlight matches too.

The bevel shapes are also read differently

The specification also describes the profile of each bevel style as pseudocode. Read as described, the "circle" bevel is concave, and its highlight should sit 12 pixels in from the edge.

In PowerPoint's actual pictures it's convex, with highlights 1 and 3.5 pixels in. The profile makes sense once you read its two numbers as (how far in, how high) rather than the way the text describes them.

Fitting the material

With the geometry right, the only thing left was the material: how matte or shiny the surface is. The specification doesn't give numbers for that. So I fitted them to PowerPoint's pictures. The plastic material comes out at a diffuse strength of 0.98, a specular strength of 0.5 and a shininess of 10.

The result on PowerPoint's own style samples, as of last night:

StyleDifference beforeDifference after
Polished5.31.2
Inset3.01.0

Still open

Metallic and clear materials still look wrong, and the styles with a scene camera aren't lit at all yet. But the lesson is already clear: specs are a starting point, not the truth. This one is detailed and mostly right, which is exactly what makes a 90-degree mistake so hard to spot: everything looks plausible until you measure it against the real thing.