I made a little test regarding HDRI Sampling and shadow casting as a collegue of mine always reports some issues in this regard. If Corona Sun/Sky is rendered, you get blurry ‘bokeh’ looking shadows casted. with an HDRI however the shadows appear pixelated. I tried different environment sampling options and it seems that nothing is changing this. I guess it is some kind of bug but I hope I’m wrong here. so If anyone could help/fix, it would be nice.
yes. it is a general HDRI sampling thing. It is of course much more pronounced if there is a high contrast/sunny situation with real dynamic range (unclipped full dynamic range) and not just some ldr hdri.
I guess the cause is a low-res HDR and what you see there is the effect of a pixel (or a rectangular area) being the main light source. Similar to how a camera works, the window acts as a lens and the shadows produce the blurry effect based on the shape of the light source, which is a circle. Similar to how shadow highlights get a crescent shape during a sun eclipse. So probably not a bug but rather the effect of accurate light simulation, and a low res HDR.
I now testet multiple HDRI’s. our own 20k ones, but also 16k polyheaven hdri’s. the effect with the polyheaven is still there, however they are a lot less intense and far away from beeing realistic reg. exposure range/colors. so all hdri’s do this and the effect also gets more intense as resolution increases. in lowres the effect is more blurry and gets less ‘edgy’
left is sun/sky, right is an unrealistic polyheaven hdri
I don’t see what’s wrong in your last comparison, it looks normal to me. Of course, it’s not realistic to expect same fidelity from limited resolution HDRI than you get from matematically perfect Corona sun. That’s why you need filterring - to blur out those jagged pixels. My guess is that you turned down filterring blurring to absolute minimum, or even completely disabled it in the first example and that what’s give you that unwanted result. Or it could be that that particular HDRI is flawed, or non-standard - there were cases when Corona bitmap couldn’t handle some HDRIs properly, but usually after you provide such HDRI example to the team, they are able to fix something in the code and the issue would be gone.
I tried all bitmap filtering options as well as all environment sampling options together now in a test scene. also testing out coronabitmaps and standard bitmap textures. nothing works.
this time I try to give you better insights of the test setup:
This test scene has a perforated part with some holes in it. the shadow on the inside wall is recorded by one camera, the sun is recorded also directly.
note that the hdri is 20k in size. the sun disk is perfectly round and has lots of pixel to be drawn round. the corona sun is obviously sharper but that does not explain why the shadows are square. suns are round, holes are round so shadows need to be as well for the hdri. examples below are all with default filtering and blur 1.0 - if I blur more, see the last image of still rectangular shadows - something here is really strange.
By environment sampler I meant the ‘Adaptive Light solver’, sorry for the confusion.
I tested this here, too, with a Corona Sun, an HDR (8Kx4K, Bitmap and CBitmap with both spherical and dome mode) and even a crescent shape with a Light Mtl, all aligned to produce the shadow in the same exact spot. Two holes in a box, one round, the other square shaped, same size… it works correctly, even the crescent shape producing (almost) same result for both holes, correctly picking up the light source shape.
I wonder if this has to do with units (mine are set to meters) but why should it matter.
Also, as this has helped others in similar weird cases, maybe reset Corona settings.
Other than that, I have no idea, a dev might have some more insight here.
I could imagine having your repro scene that produces wrong results would be good to have for others to test.
I also tried disabeling the Adaptive Light solver, no change
When it comes to the test scene: make sure the shadow casting is far away from the holes (and make the holes small). This is all about blurry shadows not beeing rendered correctly (such as outside trees casting nice fluffy shadows on interior walls) - in general the shadow casting works as expected. the blurrier the shadows get however, the more square they get as well. this is not happening with a corona sun that produces nice, almost - background out of focus ‘bokeh’ - like shadows. I would really like to see this with HDRI’s as well
That’s why I said you should provide your repro scene so people/devs have the right setup.
I can confirm it - with tiny holes I’m seeing it, too. Sun and Crescent shape with LightMtl still work fine, but the HDR produces a rectangular light spot.
A workaround you probably thought about yourself already would be to clamp the HDR (so the HDR only produces ambient light but not sunlight) and place a Corona Sun in the same spot. I guess probably wanted to avoid that, it’s making it all more cumbersome.
sorry - the scene itself would not be an issue. but the hdri itself and the creation of it is something bigger that i can not just give away atm. so i might only upload the scene then…
good that you can confirm it now. I also tested the HDRI mapped on a sphere now and this seems to work fine - however it renders a loooot longer and therefore is no excaptable workaround.
So I guess this is some kind of bug/limitation and I would kindly ask to fix it please - We are planning to make a whole hdri/light/camera system commercially avalible and the hdris that we scan ourselves should be spot on in corona as well (yes, the cromatic aberations will be removed for the sun )
UP!
I want to see some dev. involvement. I have had this exact same issue before, specially noticeable in interior images when using image base lighting only. It would be nice not having to resort to cumbersome workarounds (Im already cutting holes into my backplates to let the sun pass in order to avoid shader artifacts on reflective objects…).
Hi and apologies for not replying promptly, I will be reporting this task to the dev. team, please allow for some time to investigate the issue further and get a breather from the release schedule. Hopefully this is something that can be improved!
Any updates on this? Now it’s been mentioned I’m seeing it more and more, to be honest I hadn’t paid attention to it much before and just assumed things were working correctly, it’s clear its not right though now I’ve inspected it. Attached is a good example of PGSKIES 1714 casting light through some tropical planting and casting shadows onto the building facade. This is in Max 2021 and Corona 8 Official Stable Release