Skip to content

Comment on Show HN: I made a 3D SVG Renderer that projects textures without rasterizationparent

Comments

Perspective correct texture mapping has been solved for quite some time without excessive subdivision.

It was avoided in the Foley and Van Dam days because it requires a division per rasterized pixel, which was very slow in the late 80s.

Back in the early 90s I did a version of Bresenham's algorithm that would rasterize the hyperbolic curves that perspective-correct texture mapping required. It worked correctly though the technique of just doing a division every n pixels and linearly interpolating won out in the end, if I recall.

You could also avoid divisions entirely, while still keeping 100% correct perspective, by "rasterizing" the polygon following the line of constant Z. You would save the divs, but then you would draw mostly outside the cache, so not a panacea, but for large surfaces it was noticeably nicer than divide-every-N-pixcels approximation.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.