So you think you know box shadows?
61–70 of 130 posts
Re: So you think you know box shadows?
#62Re: So you think you know box shadows?
#63Re: So you think you know box shadows?
#64I'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
Re: So you think you know box shadows?
#65dgerrells, please add RSS support to your blog!
Re: So you think you know box shadows?
#66I'm embarrassed to admit it took until the final paragraph before realising that 'gypity' is a reference to Chat GPT.
Re: So you think you know box shadows?
#67I'm embarrassed to admit it took until the final paragraph before realising that 'gypity' is a reference to Chat GPT.
Re: So you think you know box shadows?
#68> 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…
Reverse-painter's-order beats painter's-order since it lets you skip fully-occluded objects: 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 re…
It is generally good to render opaque geometry back to front to reduce overdraw, but not going so far as sorting the objects. We would do stuff like render the hands first in an FPS or render the skybox last in most games.
Now for the transparent layer: First occlusion is handled by the z-buffer as usual. If you render from front to back I assume you render to another buffer first and then composite to the framebuffer? If you render from back to front you don't need alpha in your framebuffer and can assume each rendered pixel is opaque, not needing that composite.
There's also order independent transparency stuff though which IIRC does need another buffer, which requires a composite but then saves you having to sort the objects.
Re: So you think you know box shadows?
#69Seriously fun exploration. > Layering. That is an important word. Layering is also the key to the (silly but also sometimes good-looking) effects from my text shadow project from 14yrs ago: https://paulirish.github.io/mothereffingtextshadow/
It's almost like this post has many layers to it, and that it's not really about box shadows.