Hey
I played around with reflections and came across the basic examples here: Reflections and Refractions | Babylon.js Documentation
I figured that on a sphere the reflection looks like it is more zoomed out than on a cube. Is there a reason why this is the case? I tried to showcase it by combining 2 examples here: https://playground.babylonjs.com/#UU7RQ#2426
Here is additionally a picture which shows the reflections. You can see much more details of the cloud in the cube than in the sphere.
Hi JPeer264,
This is because of optics!
Probably the easiest way to think about it is from a ray-tracing perspective. Suppose your vision works by firing a ray as a “probe” through every pixel into the world, then setting that pixel to the color of whatever the ray hits. The color of a reflective surface isn’t determined (much) by the surface itself; instead, it’s determined by the color of whatever is being reflected in the surface. Thus, when a ray “probe” hits a reflective surface, it has to bounce (reflect) off it and go in a different direction until it finds something it can get color from. The different direction the ray goes is determined by the angle of incidence — basically the direction from which you’re looking — as well as the surface normal — basically the direction the surface is “facing.” The sides of a cube are flat, so every ray that hits the same side reflects based on the same surface normal; thus, when they continue on, they stay relatively close together and thus see a smaller area. The sphere, in contrast, has a curved surface, so all the rays that hit the sphere reflect off at different angles; and because the curved surface of the sphere is convex (curved “out” instead of “in”), the reflected rays spread out and ultimately sample color from a much larger area. Because the rays reflected off the sphere pull color from a larger reflected area (compared to the cube) into a similarly sized reflection area, that gives the appearance of the reflection being “zoomed out.”
Hope this helps, and best of luck!
2 Likes
Thanks a lot for this detailed explanation. It makes total sense actually.
Which means in this case I cannot trick the reflection so it seems smaller right?
You can do that — probably most easily with a custom shader where you can manipulate the normals based on view direction — but I’m not sure the result will be something you actually want. The reason it looks round is because the light it’s mimicking behaves like light hitting a round object in the real world. You can cause it to mimic a different behavior of light, which would give you a different-looking reflection, but the result will be that the object no longer looks like a reflective ball.
Yes you are right. I rather stick with the right approach and leave that to how optics really work. Thanks a lot for your answers.