Author Topic: Set right camera height with hdri Environment?  (Read 790 times)

2024-02-13, 18:33:16

Giovanni Stengel

  • Active Users
  • **
  • Posts: 31
    • View Profile
Given an hdri environment, how do I know the actual camera height to set? is it written somewhere? Thanks.

2024-02-13, 19:23:40
Reply #1

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5468
    • View Profile
Depends where you get the HDRI from - some sites will give all sorts of useful info, some will just give you the file. HDRIs themselves are not all created equal, some at different exposures etc. So a lot of this just comes down to "eyeballs and gut feel".
Tom Grimes | chaos-corona.com
Product Manager | contact us

2024-02-13, 19:35:22
Reply #2

Giovanni Stengel

  • Active Users
  • **
  • Posts: 31
    • View Profile
Thank you TomG. I downloaded this hdri from Poly Haven. I wrote them on discord.

2024-02-13, 19:45:44
Reply #3

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Im not sure about your question but general rule for HDRI/EXR environment is that the horizon is the center point.

So camera height doesnt actually matter since the photographer could be on a roof, on on a tripod when below ground, aslong as the center point is on the horizon.

Example attached (Boco Pano, Greg Zaal, Peter Guthrie)

2024-02-13, 20:11:47
Reply #4

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5468
    • View Profile
The one time I know it has an effect is in Dome Mapping mode, where setting the camera height is important (that is, setting it to the height the image was taken at). For regular lighting use, it isn't important :)
Tom Grimes | chaos-corona.com
Product Manager | contact us

2024-02-13, 20:21:29
Reply #5

James Vella

  • Active Users
  • **
  • Posts: 540
    • View Profile
Sure, but general heights are going to be 1-1.8m so why not just eye ball it until you have no distortion? It wont be that far off the horizon line for most HDRIs, unless the photographer did something strange.

2024-02-13, 22:11:49
Reply #6

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
For outdoor HDRIs, the horizon line will be at the vertical center probably for all HDRs that you come across, unless the panorama was taken really high up which is improbable.
For indoor HDRIs, dome mapping really makes sense since light sources and objects will be closer to the camera and will make a difference when rendered from the correct vs incorrect height. Even using a wrong camera height can be interesting sometimes.
Dome mapping is preferable too when you render an object on a surface that uses the HDRIs projection on the ground with a shadow catcher for example . Anything close to the surface will look definitely better as there's quite some difference between how the surroundings look to an object at 0.1m vs 1.6m.

In order to determine a somewhat correct height at which the cam was placed you'll need to know the physical scale of a feature visible the pano, best one that's on the ground. It can be anything like street markings, a tile, a curb, something that you know to some certainty, the bigger the object/feature the better.
Create a plane at 0/0/0 big enough to cover the ground of your HDRI and assign to it an UVW modifier in spherical mode.
Create a material for the plane, assign the HDRI in question to it and display it in the viewport.

Once you have the plane display the HDRI on it, you can move the UVW mod's gizmo up/down and see how the projection/mapping of the HDRI on the plane changes. You might have to increase the plane's tesselation for a better result in the viewport.
Now create an object similar in size to the feature in the HDRI and place it somewhere where the feature is projected on the plane. If you move the gizmo and the feature projected/displayed on the plane and the object you created match in size then read what the Z value for the UVW mod's gizmo says - that's roughly the height the pano was taken at.

I'm saying 'roughly' because the method is not accurate. Accuracy will improve with increasing size of the feature though, that's why it's important not to use small objects as features. It will also work only somewhat reliably on the things that are on the ground closer to the camera. The farther the object from the camera the more it gets distorted when projected on the plane, making it hard to determine the correct height.

Still, this method can work surprisingly well since it 'maps' the surroundings on a plane and helps to get an idea of its physical scale. Once you have some other 3d geometry in the scene to compare the projected HDRI's feature to, you quickly see whether the scale (or better projection center / UVW mod's gizmo) is far off or not.

Note - I'm not in front of the PC right now so can't check - I've done this a lot in the past but can't remember if I used camera projection or spherical projection from a UVW modifier on the plane. I know one of these methods had an advantage because it works better in the viewports. If the above method doesnt work for you, let me know so I can check.
« Last Edit: 2024-02-13, 22:48:07 by pokoy »

2024-02-14, 12:36:34
Reply #7

Giovanni Stengel

  • Active Users
  • **
  • Posts: 31
    • View Profile
Thank you! I will check every step! This is the HDRI that I am using: https://polyhaven.com/a/sunset_jhbcentral 

As you can see, also in the attached screenshot, it is quite difficult to understand if the height of the camera was 1.8 m or 2m for example.

And I have other 2 questios. I didn't find solution yet on this forum. (Do I have to create a new thread?)

1) Is it possibile to link and hdri image to a camera so that when you rotate the camera the environment follows?

2) If i change camera's focal lenght  the hdri changes automatically. Is there a way to detach this connection? That would be stupid? Thank you!




2024-02-14, 13:28:06
Reply #8

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
Thank you! I will check every step! This is the HDRI that I am using: https://polyhaven.com/a/sunset_jhbcentral 

As you can see, also in the attached screenshot, it is quite difficult to understand if the height of the camera was 1.8 m or 2m for example.

And I have other 2 questios. I didn't find solution yet on this forum. (Do I have to create a new thread?)

1) Is it possibile to link and hdri image to a camera so that when you rotate the camera the environment follows?

2) If i change camera's focal lenght  the hdri changes automatically. Is there a way to detach this connection? That would be stupid? Thank you!

1.8m or 2m - with a value range so narrow it will probably be impossible to tell without knowing some dimensions in the HDRI, for example the distance between the tile borders or those cylindrical whatever-they-are. Also, I'm not sure the roof in that HDRI is level, if it isn't this introduces another level of uncertainty.

1. I guess it should be possible with parameter wiring, where you'd wire the HDRI's U offset to camera Z rotation. But I'm not sure this will help as parameter wiring in Max tends to be slow and with the texture being recalculated whenever you rotate/change the camera it might be too slow to work interactively.
2. Yes, this is correct and expected. If you think about it, changing the FOV should of course show less of more of the world surrounding you. I don't think you can expect this to work independently without creating other problems - for example you could change the scaling of the U/V parameters of the HDRI but this will cause problems where the HDRI wraps around, the seams wouldn't match anymore. Plus, you're likely to see that something's not right.

2024-02-14, 14:27:07
Reply #9

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8854
  • Let's move this topic, shall we?
    • View Profile
    • My Models
1) Is it possibile to link and hdri image to a camera so that when you rotate the camera the environment follows?

Corona bitmap allows you to link environment rotation to arbitrary object's transform.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2024-02-14, 14:37:29
Reply #10

pokoy

  • Active Users
  • **
  • Posts: 1865
    • View Profile
1) Is it possibile to link and hdri image to a camera so that when you rotate the camera the environment follows?

Corona bitmap allows you to link environment rotation to arbitrary object's transform.
Yeah totally forgot about that - true, way easier than wiring parameters.

2024-02-14, 20:48:11
Reply #11

Giovanni Stengel

  • Active Users
  • **
  • Posts: 31
    • View Profile