Hacker News new | ask | show | jobs
by jessep 2051 days ago
I found this one by the same person even more amazing. It shows the background image being refracted through the glass: https://domenicobrz.github.io/webgl/projects/glass-absorptio...
7 comments

Abusing the framebuffer contents to do convincing-unless-you-stare-closely-at-them reflections is a time-honored tradition stretching back to the early 2000s. Nintendo pulls off this effect a couple of times in this shot:

https://noclip.website/#smg/HeavensDoorGalaxy;ShareData=AY,m...

From the username & submission history, I'm guessing you're the author of noclip.website & the associated youtube videos explaining various graphics effects in SMG/WW. Love your content!
Is that website supposed to work on mobile? I get a couple of microscopic icons on a black background and a message about a non-responsive script after a few minutes.
That was even cooler, agreed. Although on Firefox Mobile I need to turn down the gui1_x parameter to almost zero, otherwise I get these weird red polygon artifacts. And I get 15-ish fps. Chrome on the same device is flawless at 60fps.
Very clean and at least 60 fps in Chrome on a 3 year old iPad. Amazing.
Note that you're really complementing WebKit here: alternative browsers on iDevices are just reskinned Safari.
I did not know that.
I see the polygon artifacts on chrome on android.
I get the same red polygons and low fps on Firefox and Chrome on my phone.
Is this actually refracting through the glass? The distortion doesn’t seem quite correct.

I wonder if this is actually a clever cheat. Perhaps it’s actually not transparent, but a mirror surface and the cube map for reflections is actually just the skybox inverted. So instead of actually looking through the glass sculpture, it’s reflecting the inverted skybox.

Of course it's not a real, physically accurate refraction. That could only be done via raytracing (or maybe some obscure depth-peeling technique, which would be super slow).
It isn't about inverting the skybox, it is done in the same way as reflection mapping, but instead of reflection ray directions you use refraction ray directions.

The reason these can look off is because the image is flat and on a cube or sphere and doesn't have depth and exists infinitely far away. Sometimes cubes or spheres with a defined size are used to give a little more plausibility.

Am I really naive to be so impressed by this running at 60fps on my Intel Iris Plus 645 graphics?

This is a potato-tier GPU and I can't make the frame rate drop below 60 with this demo.

Yes, because you should compare to how a similar DirectX 12, OpenGL 4.6 or Vulkan 1.1 like demo would achieve in FPS.

https://www.techpowerup.com/gpu-specs/iris-plus-graphics-645...

I am impressed. After a graphics card failure I'm running on Intel® HD Graphics 4600. It's more than adequate for work, but in this demo the frame rate started at 21fps and dropped to 15fps
45FPS on my 1050Ti, so it beats me.
60 FPS on iPhone SE (1st gen) zoomed in or out. Cool.
60fps on my iPhone X, impressive!
My MBP was absolutely crawling but my iPhone 12 had no problem keeping 60fps. Crazy. That gives me a lot of hope for the new Apple Silicon macs.

Edit: But the main link definitely doesn't work well on iPhone.

Same results on my Galaxy S10 (60fps) and Core i7 laptop (<20 fps). I'm pretty sure there is a software explanation for this, instead of the phone CPU being more powerful.
This has nothing to do with the processor in the system. If anything it is a bug that makes the rendering very inefficient on MacOS / your browser.

The Intel processor in your MBP is still leaps more powerful than the processor in your phone.

> The Intel processor in your MBP is still leaps more powerful than the processor in your phone.

Maybe the CPU part, but definitely not the integrated GPU (and this demo is all GPU).

Where do you take your assumption?

I was trying to find anything specific about the iphone 12 gpu and i only found the same Apple 4 Core GPU.

I was not able to find any benchmark comparision either.

I found this, which is very unspecific: "We didn't see as big a leap in graphics performance. On the 3DMark Wild Life test, the iPhone 12 hit 39 frames per second, while the iPhone 11 Pro Max scored an even higher 42 fps. But when we switched to the off-screen version of the test, the iPhone 12 Pro notched a higher 51 fps to the iPhone 11 Pro's 42 fps."

So if you don't have more details then i do, the basic assumption, you should make, is that its much easier to put much more silicon in a MBP than in a Smartphone and the chances, that a MBP is loosing against a Smartphone, would be very weird and very unrealistic.

And this has nothing to do with if someone likes apple or arm or whatever.

It is also not very easy to compare something like this if you don't know if there is a feature set difference and if one GPU can control 2-3 displays and the other only works for one display.

> Where do you take your assumption?

Simply by comparing my graphics demos running on my 13" MBP versus a recent iPhone or iPad Pro. The i-devices are usually slightly ahead (okay, my MBP is 5 years old by now, but progress has been slower on the Mac side than on the iPhone side).

It might not just be about fillrate though, I'm also seeing much higher drawcall throughput with Metal on iOS devices versus running Metal on Macs with Intel GPU. I guess the entire graphics stack is much better optimized on iOS.

In sustained multithreaded tasks, maybe, depending on how much money you paid on either and when you bought it.
Were you using safari on your mbp? The performance seem to be better in safari than in chrome or firefox.
MBP has a lot more pixels to push. If you scale your browser down, you'll see the framerate go up a bunch.
Strangely, only ~50 fps in Google Chrome on my ultrabook laptop -- which has a Ryzen 7 4700U with Vega 7 graphics.

The Ryzen 7 4700U's integrated Vega graphics is far more powerful than Intel's UHD and Iris, and even more powerful than Nvidia's MX line of GPUs (MX150, MX250, etc).

Strange that it only got ~50 fps when someone else on this thread with a Intel graphics got 60 fps.

It's not doing the same rendering on iOS as on the desktop. The desktop version allows the body to be seen through the arm while the mobile version doesn't (looks really like a variant of a cube map on mobile).
Zoom in and frame rate drops to under 20fps
Probably the GPU and the GPU drivers matter most.

On Linux Chromium browser with an NVIDIA GPU, using the NVIDIA Linux driver, the FPS is pinned to 60 no matter what zooms and rotations are done.

I tried on Chromium linux too, but probably driver's issue. My machine has Radeon pro card with just amdgpu driver that's bundled with kernel v5.4.
Zoomed in on iPhone X, still getting 60 fps
I agree. It is...um...smooth as glass on my iPad. Much more so, than the OP.