Author Topic: Sun render problem with black pixels  (Read 585 times)

Offline FlynnAD

  • Member
  • *
  • Posts: 73
Sun render problem with black pixels
« on: June 14, 2017, 01:24:51 AM »
Hi all,

I rendered a simple scene that looks fine as rendered on screen and saved as an exr. When that image is opened in Affinity Photo/ Photoshop it still looks fine. But when an exposure layer is added, the exposure shows that the sun has a black spot in the center, whether the exposure is increased or decreased. When I tried to sample the color within that black spot, Affinity Photo crashed, which leads me to believe that there is something wrong with the exr.

I rendered the same scene with the original sun at a low elevation. It worked fine.

I rendered the same scene with a new sun that was copied from the problematic sun, then with the position adjusted slightly. The black spot returned.

Any solutions and/or causes as to what is going on? Screenshots from the post-processing work are attached.

Thanks,
Matt

Offline KyL

  • Member
  • *
  • Posts: 114
Re: Sun render problem with black pixels
« Reply #1 on: June 14, 2017, 02:46:14 AM »
This is more than likely that your black spot is made of value so bright that they could not be recorded on the file. This is typically displayed as NaNs (Not a Number) in some software. Basically the intensity is too strong to fit in 32 bit file format.

The reason why it is working at lower elevation might simply be that there is more atmosphere for the sunlight to be absorbed, resulting in a slightly lower value.

The easiest fix is to change your sun angular diameter to something larger, I guess 0.75 is enough to even out the luminosity of the hot spot over a larger area...

Offline pokoy

  • Member
  • *
  • Posts: 147
    • mswee.net
Re: Sun render problem with black pixels
« Reply #2 on: June 14, 2017, 08:01:45 AM »
As far as I remember a solution is to use the 'Cubic B-Spline' filter in the renderer instead of the 'Narrow Cubic' default filter. Not sure if it works in all cases, though.

The funny thing is that you can't paint over the spot in PS if you open the EXR. The solution is to resave as HDR and reload, you'll be able to retouch this then.

Offline FlynnAD

  • Member
  • *
  • Posts: 73
Re: Sun render problem with black pixels
« Reply #3 on: June 14, 2017, 06:26:15 PM »
Thanks KyL and pokoy.

It makes sense that the black pixels were exceedingly bright. The eyedropper in post measured them far above the 1-255 range (far above 100,000 actually; they were likely over 10,000,000). I didn't realize exr's had NaNs limits.

Neither the Cubic B-spline and the Catmull filter worked in this particular case to eliminate the black spot, but increasing the sun angular diameter even to 0.65 was enough.

Saving the problematic exr as an hdr, then painting over the hdr worked too. The issue to be aware of with this workaround is the quality of your painting. Even after I had painted over the black spot, once I reduced the exposures 6-8 stops, the sun had a gray halo in the center where my painting was not perfect. Getting the right intensity spot on is up to the user's talent.

Thanks,
Matt

Offline KyL

  • Member
  • *
  • Posts: 114
Re: Sun render problem with black pixels
« Reply #4 on: June 14, 2017, 06:36:29 PM »
Yeah usually the post-work paint can be tricky, especially if you have your sun behind clouds.
Easier to fix it at rendertime :)

Glad it's fixed!

Cheers!

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 11734
  • Holy snagging ducks!
Re: Sun render problem with black pixels
« Reply #5 on: June 14, 2017, 06:36:59 PM »
KyL's solution is the one we currently recommend, increase sun disc diameter to 0.75. However it should be noted that EXR output is currently 16 bit, not 32. 32 bit EXR will be available in an update soon and will probably fix this issue.

- Oshyan

Offline dorianvan

  • Member
  • *
  • Posts: 374
    • Vandegrift Renderings
Re: Sun render problem with black pixels
« Reply #6 on: June 16, 2017, 02:19:18 PM »
once I reduced the exposures 6-8 stops

Hi Flynn, what do you mean by 6-8 stops? Is this a setting in TG?
-Dorian

Offline FlynnAD

  • Member
  • *
  • Posts: 73
Re: Sun render problem with black pixels
« Reply #7 on: June 16, 2017, 04:04:48 PM »
Hi Flynn, what do you mean by 6-8 stops? Is this a setting in TG?

In Photoshop or Affinity Photo or whatever your image editor is for post, apply an Exposure Adjustment Layer and decrease the value. The Exposure Adjustment Layer defaults at 0.0. If you lower it to -1.0, that's one camera stop, as far as I understand it. Many HDRIs that you can buy online, shot from real skies, have maybe 12-15 stops (maybe from -6 to +6 before they bleed out completely). Cranking the Exposure Adjustment Layer down will let you see how crisp the sun becomes on those photo-shot HDRIs. Cranking down the exposure on a TG-rendered sky might give you 25-30 stops, which is far more accuracy and will give crisper sun shadows naturally in another 3d program (like using the TG-rendered sky as an HDRI skydome in 3dsmax) without using a separate sun.

Well, that's if I understand it correctly.

Anyways, cranking down the exposure adjustment layer in post allowed me to see the black spot in the rendering, because it looked fine at (and only at) an exposure of 0.0.

Matt

Offline dorianvan

  • Member
  • *
  • Posts: 374
    • Vandegrift Renderings
Re: Sun render problem with black pixels
« Reply #8 on: June 16, 2017, 10:50:22 PM »
Thanks. I opened my TG spherical exr in photoshop and did an adjustment layer with -20. It went totally black on the screen, I flattened it, and saved as hdr. Then went to 3dmax and put it in the environment as VrayHDRI. It rendered with a bit more contrast, darks are darker, not sure which is better. Thanks for the tip though.
-Dorian

Offline pokoy

  • Member
  • *
  • Posts: 147
    • mswee.net
Re: Sun render problem with black pixels
« Reply #9 on: June 17, 2017, 05:54:57 PM »
Thanks. I opened my TG spherical exr in photoshop and did an adjustment layer with -20. It went totally black on the screen, I flattened it, and saved as hdr. Then went to 3dmax and put it in the environment as VrayHDRI. It rendered with a bit more contrast, darks are darker, not sure which is better. Thanks for the tip though.
There's an issue with the EXR loader in 3dsmax, with certain compression types filtering of high energy pixels (like a sun from TG) may be inconsistent and result in different intensities with different map offset/rotation. The HDR format doesn't show this behavior, so if you want to stay on the safe side in 3dsmax always use HDRs.

Another thing to keep in mind with that black sun pixel is that it may lead to weird results in 3dsmax (or whatever program you use) when used as a light source. Always make sure that the black pixels are 'fixed' in a postprod software, as they can get interpreted as negative values and result in negative light contribution, 'subtracting' light from the result.