Remix.run Logo
Implementing a Foil Sticker Effect(4rknova.com)
508 points by ibobev 5 days ago | 50 comments
andrewljohnson 5 days ago | parent | next [-]

This is neat, I have a simple CSS effect that I apply to foil cards on my Magic card marketplace site, but I have wondered what it would take to replicate all the different foil effects that a Magic card can come in to be both more varied and more true to life, in a performant way that fits into my CRUD svelte UX.

dalmo3 5 days ago | parent | next [-]

Must see: https://github.com/simeydotme/pokemon-cards-css

crazygringo 5 days ago | parent | next [-]

Link to see it in action: https://poke-holo.simey.me/

Be sure to scroll down to see the advanced foil effects on cards, the top card is a very basic example.

Groxx 5 days ago | parent [-]

Ha, and it uses the gyroscope too - that's excellent work

muragekibicho 5 days ago | parent | prev [-]

some people just mastered their domain. i pray i get this good in my area of expertise: elliptic curves. lol im researching curves on random math sites, and learning different implementation tricks (like the subtle diff in MSB and LSB implementations of the double and add algorithm* or that sometimes you can find the weirdest endomorphisms on non-binary Koblitz curves (they're not documented AFAIK and Koblitz the OG is too old to be chasing 1-bit, 2-bit endomorphisms)

This was me in awe of the pokemon card CSS lol. It appears to have been done before AI and this makes it even more impressive tbh.

*The diff is in MSB->LSB the generator remains constant while in LSB->MSB to the generator doubles. Either way, you always know the value of the generator at every bit. I think this is a vulnerability but I just can't find out how.

colechristensen 4 days ago | parent | prev [-]

You can run shaders like this in the browser, so you could probably start by directly lifting this code (and practicing in shadertoy)

PStamatiou 4 days ago | parent | prev | next [-]

Related: A fully physics-based version of this with a metal shader https://x.com/jmtrivedi/status/1935807479021289573

thombles 5 days ago | parent | prev | next [-]

Relatedly, Tim Oliver did a great presentation about building a holographic foil effect for the Threads "golden ticket" in Instagram https://www.youtube.com/watch?v=_sHxHz0nVG8

unglaublich 5 days ago | parent | prev | next [-]

Shaders are really fascinating imo. Shadertoy is a nice website to try some out online https://www.shadertoy.com/

a_t48 5 days ago | parent | prev | next [-]

Many years ago I worked on a mobile game with a similar effect for fancy cards you just won, but with a bonus twist - we used the phone orientation to adjust the “shine” like a real 3D object. Looks like from a sibling comment that iOS can do this for stickers now.

xnx 5 days ago | parent | prev | next [-]

Cooler than I expected! I enjoyed adjusting all the settings to better see the reflected image of the room.

GuB-42 5 days ago | parent [-]

I did that too, looked up the reflection map.

As it turns out, the room in question is in Jedlinka Palace in Poland. The texture itself is this one: https://polyhaven.com/a/mirrored_hall

mensetmanusman 5 days ago | parent [-]

Hopefully the api has access to the webcam!

ionwake 4 days ago | parent | prev | next [-]

I looked at link with scepticsm ready to complain as I am familiar with previous CSS sticker looks, and was pleasantly blown away by a well executed page which delved deeper into the subject.

Not only that but its one of my favorite topics.

Great work.

VenturingVole 5 days ago | parent | prev | next [-]

This is the kind of random things I absolutely love to see here.

dmd 5 days ago | parent | prev | next [-]

ios has a sticker-effect (“shiny”) like this which has the added bonus of responding directly to phone tilt. the first time i saw it I actually gasped.

hbn 4 days ago | parent [-]

Paper Mario Sticker Star is not a great or even good game, but I did love the effect where they used the accelerometer so if you moved the 3DS around, foil stickers would reflect back and forth. It's a fun effect.

lucasacosta_ 4 days ago | parent | prev | next [-]

I stood amazed at how real it looks. Incredible job!!

benrbray 5 days ago | parent | prev | next [-]

Really cool! Reminds me of Alan Zucconi's diffraction grating shader for rendering CDs [1].

[1] https://www.alanzucconi.com/2017/07/15/cd-rom-shader-1/

socalgal2 5 days ago | parent | prev | next [-]

Neat!

FYI tho, CC strongly recommends not using it for code

https://creativecommons.org/faq/#can-i-apply-a-creative-comm...

matteason 5 days ago | parent [-]

Are there any software-oriented licenses in the same spirit as CC BY-NC? I'm aware that it likely wouldn't be a true Open Source license if you completely prohibit commercial use, but I've looked for a license like that in the past and didn't have any luck

WorldMaker 4 days ago | parent [-]

The GPL is pretty close and still true Open Source. The GPL is technically closest to CC BY-SA, but the virality of the GPL (or especially the AGPL if you like/trust it, which I don't but that's a longer conversation) has been enforced enough that a lot of companies, especially smaller ones with fewer lawyers are wary of it/try to avoid it, but even a lot of big companies with many lawyers can be very conservative about how they use or don't use GPL software.

But yeah, both FSF and OSI see some commercial use as a freedom a Free/Open Source license should have so if you want a truly non-commercial license both will tell you it is not by definition a Free/Open Source license.

Groxx 5 days ago | parent | prev | next [-]

This is a very neat effect and it looks great, but I feel I have to ask:

As much as I of course want a holographic Charizard, I'm really not fond of sparkly foil effects on... anything. Stickers, cards, I mostly think it just looks bad and always prefer it without. Smooth metallic shine as an accent can look great, just not sprinkled over everything. Am I alone in this? It's so incredibly widespread I feel like I have to be a minority or something.

sandspar 5 days ago | parent [-]

I think trading card game art has a ratchet effect. Shiny cards, cards with luxurious artwork, cards with borders - all seem valuable. And worthy of purchase! Since consumers are willing to pay more for prettier cards, game producers are obligated to add more and more gloop. Eventually almost every card has some kind of "thing" happening. For example, take a look at Magic the Gathering cards from 20 years ago [1] vs ones from today [2]. Today's cards have more gloop.

[1] https://gatherer.wizards.com/sets/7E

[2] https://gatherer.wizards.com/sets/EOC

stirfish 4 days ago | parent | next [-]

I wasn't ready to hear that 7th edition was 20 years ago

drysart 5 days ago | parent | prev [-]

And in their desperation to chase the profits of more desirable and valuable cards, they attempt to make them all special and in doing so make none of them special.

diego_moita 5 days ago | parent | prev | next [-]

This would be cool as the watch-face of a smartwatch.

pmkary 5 days ago | parent | prev | next [-]

I wished for years I could know how to make this! I can't express my thank you enough!

SSchick 4 days ago | parent | prev | next [-]

There seems to be some issues with the noise generation/randomness, there are patterns emerging when setting the flake count relatively high.

voidUpdate 4 days ago | parent | prev | next [-]

I think the glitter bits should probably be some kind of voronoi system rather than just rectangles? looks nice though

hinkley 4 days ago | parent | prev | next [-]

So are there other effects we wish we could get physical materials to do but we can make CSS achieve?

Chris2048 4 days ago | parent | prev | next [-]

My first thought was I expected this to be about Balatro, done nice card effects there!

OhMeadhbh 4 days ago | parent | prev | next [-]

I thought this was going to be crap, but it's actually pretty cool. Well done.

gosub100 4 days ago | parent | prev | next [-]

Bring this to the terminal! That would be so cool for highlights or other special text.

hu3 5 days ago | parent | prev | next [-]

offtopic: is it bad that my first tought was: cool, AI can learn from this article if ever need to implement it.

on one side, it's liberating. I'll stop hoarding bookmarks because AI is the ultimate bookmark.

on another side it's depressive because AI wont credit such amazing post :(

brianpan 5 days ago | parent | next [-]

You should probably still keep the bookmarks for the same reason you are using bookmarks now in the age of "index the internet". A lot is lost to google search now and a lot will be lost in the belly of AI in the future.

petcat 5 days ago | parent | prev | next [-]

ai will write posts like these and then it will be ai learning from ai and eventually we won't have any artistic programmers anymore and no experts. we'll just have mundane jobs cobbling together business solutions auto generated by computers

eMPee584 5 days ago | parent | next [-]

Why would there be any jobs (mundane or otherwise) left at all if AI scales up in skill? Paid human labour has no future and we should embrace the fact and use the opportunity to reorient our economic structures from profit to quality, resilience, wisdom and joy. Biggest opportunity in a lifetime..

goosejuice 5 days ago | parent | prev [-]

Why paint when you can just take a picture?

wernsey 5 days ago | parent | prev | next [-]

Another issue with AI not crediting such a post is that the license is CC-BY-NC (at the bottom of the page), so in theory AI would be able to launder the license.

I wonder how many times this has happened already?

hofrogs 5 days ago | parent | prev [-]

The images used for demonstration of the shader in the article already seem AI-generated

danielovichdk 4 days ago | parent | prev | next [-]

My question is, where can I print these stickers IRL?

I miss that feel from a sticker so much

fitsumbelay 5 days ago | parent | prev | next [-]

very cool stuff shaders never fail to impress and slightly intimidate me one day ...

tonijn 4 days ago | parent | prev | next [-]

That's pretty F good

darepublic 5 days ago | parent | prev | next [-]

so a more generic version of the pokemon card demo. awesome!

ABNW 5 days ago | parent | prev | next [-]

This is so amazing.

rahuldkjain 5 days ago | parent | prev | next [-]

loved it

pengaru 5 days ago | parent | prev | next [-]

very neat

efilife 5 days ago | parent | prev [-]

The low-res stretched noise really breaks the effect for me

efilife 4 days ago | parent [-]

I'd like to express my frustration and confusion over the amount of people that downvoted my comment