This is pretty cool. I could see Apple or someone taking this idea and running with it. Like Face ID, they could use the front-facing camera with a NN to determine the location of nearby light sources, then provide an API to render 3D and reflective surfaces in a environmentally consistent way. Perhaps not just reflective highlights, but actual reflected and refracted images from the camera.
Show HN: Shiny.js simulates reflections on the web for mobile devices
31–40 of 41 posts
Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#32Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#33Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#34Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#35I am a bit biased. It is nice effect to see but also I take it as a complete waste of the device resources, namely a battery.
Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#36Earlier quoted context omitted.
maybe hardware acceleration is missing or something like that It's doing some seriously slow stuff behind the scenes. For example, when the library initialises it creates a 64 * pixelDensity square canvas and then loops through all the pixels in it one by one using a randomly generated transparent color value to draw a 1x1 rectangle to each one (See the 'generateNoise()' function in https://github.com/rikschennink/sh…
It does that once, and it does it to prevent having to ship an image or base64 encoded string to create a noise effect. It's a balancing act between a bigger library and CPU usage. It takes the CPU 15 milliseconds (it's more than I expected, but it's on page load). Good to know that putImageData is faster, will look into that. What is most likely causing the chopiness is that it's animating background gradients. Ther…
Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#37Once I went to demo website on my mobile phone everything made perfect sense!
Maybe the gif should be an actual screenvideo?
Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#38Quick feedback: I got a little confused on the Github readme because the gif shows a video record of the phone. The physical reflections on the glass of the phone seem to be masking the virtual reflections on the credit card image! Once I went to demo website on my mobile phone everything made perfect sense! Maybe the gif should be an actual screenvideo?
Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#39This is pretty cool. I could see Apple or someone taking this idea and running with it. Like Face ID, they could use the front-facing camera with a NN to determine the location of nearby light sources, then provide an API to render 3D and reflective surfaces in a environmentally consistent way. Perhaps not just reflective highlights, but actual reflected and refracted images from the camera.
Apple used to have a few of these sorts of effects scattered throughout iOS back in the skeuomorphic days; the volume slider in particular made heavy use of it https://www.theverge.com/2012/6/13/3082329/ios-6-button-tilt...
Re: Show HN: Shiny.js simulates reflections on the web for mobile devices
#40It isn't working well on Firefox for Android (at least not for me). It is very laggy, so much so that I would say that there is no shiny effect at all.
I'm looking at switching to GPU accelerated transforms instead but that brings a couple of new challenges.