Live data from Hacker News

So you think you know box shadows?

dgerrells.com

21–30 of 130 posts

Re: So you think you know box shadows?

#21
post #17
post #10

He said it might melt your processor... but on a macbook m3 in arc runs great, like every one of those was amazing.

M4 iPad Pro here started to freeze up on the Starry Night animation.

Weird. I'm on a 2011 Lenovo desktop with an i5 and it ran smooth as butter.

Re: So you think you know box shadows?

#23
> However, using a transparent color significantly slowed down the number that can be drawn too which doesn't make as much sense to me. I'd imagine that with hardware today transparency should be somewhat free.

That's because transparency limits how you can batch draws on the GPU. With opaque draws, you can use the depth buffer and draw in any order you like e.g. maximizing batching. With transparency, you need to draw things in the right order for blending to work (painters order).

Re: So you think you know box shadows?

#24
post #23

> However, using a transparent color significantly slowed down the number that can be drawn too which doesn't make as much sense to me. I'd imagine that with hardware today transparency should be somewhat free. That's because transparency limits how you can batch draws on the GPU. With opaque draws, you can use the depth buffer and draw in any order you like e.g. maximizing batching. With transparency, you need to dr…

Can't you mathematically work out how to change the colors/opacity to rearrange the job?

Re: So you think you know box shadows?

#25
post #14
post #10

He said it might melt your processor... but on a macbook m3 in arc runs great, like every one of those was amazing.

On Safari iPad, I lose the ability to scroll or do anything somewhere in the middle of the article.

Huh, I read the whole article and interacted with all the inline examples on my iPhone SE/2.

Re: So you think you know box shadows?

#28
post #24
post #23

> However, using a transparent color significantly slowed down the number that can be drawn too which doesn't make as much sense to me. I'd imagine that with hardware today transparency should be somewhat free. That's because transparency limits how you can batch draws on the GPU. With opaque draws, you can use the depth buffer and draw in any order you like e.g. maximizing batching. With transparency, you need to dr…

Can't you mathematically work out how to change the colors/opacity to rearrange the job?

Having that knowledge sounds just as expensive if the operations aren't commutative.

Re: So you think you know box shadows?

#29
post #23

> However, using a transparent color significantly slowed down the number that can be drawn too which doesn't make as much sense to me. I'd imagine that with hardware today transparency should be somewhat free. That's because transparency limits how you can batch draws on the GPU. With opaque draws, you can use the depth buffer and draw in any order you like e.g. maximizing batching. With transparency, you need to dr…

GPUs also do not like overdraw, so it's generally good idea to avoid having many transparent elements on top of each other, its also the reason why drawing more triangles vs. transparent texture is generally better.

Re: So you think you know box shadows?

#30

> It also turns out that some smart people figured out maths hacks to draw rounded boxes for super cheap which UI peeps love because with this hack boxes can be so round as to appear as circles Any references to learn more about these hacks?

Probably signed distance fields (SDF).
Post reply on HN