I'm totally down for some good old fashioned impractical hacking. But just remember, we already have canvas, which can do all this easier, faster, and better.
Canvas throws away a lot though, especially w accessibility
So you think you know box shadows?
51–60 of 130 posts
Re: So you think you know box shadows?
#52Re: So you think you know box shadows?
#53Re: So you think you know box shadows?
#54He said it might melt your processor... but on a macbook m3 in arc runs great, like every one of those was amazing.
Re: So you think you know box shadows?
#55Re: So you think you know box shadows?
#56> 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…
If you're doing non-overlapping stuff, you'd actually expect (almost) no slowdown from transparency, since you'd have to touch every pixel once anyway, and the only thing that changed is the shader formula.
Re: So you think you know box shadows?
#57Re: So you think you know box shadows?
#58Re: So you think you know box shadows?
#59> 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…
Start with a buffer that's fully transparent (α=0.0)
for each face from front to back:
for each pixel of the face:
draw the pixel, blending 1.0-buffer.α of the new pixel into whatever's already in the buffer
(if buffer.α == 1.0 you can just skip it entirely, just like for depth buffering)
go back and double check your math relating to transparent objects behind other transparent objects
The tricky part is if you have faces that overlap in a cycle (can happen legitimately), or that penetrate each other (often avoidable if you think about it).Re: So you think you know box shadows?
#60So hard.