EternalTrail / eeVR

Blender addon for rendering equirectangular and dome projection images using the eevee rendering engine.
GNU General Public License v3.0
164 stars 46 forks source link

Unable to render to anything but PNG when stereoscopy is enabled #60

Open AngryDraconequus opened 8 months ago

AngryDraconequus commented 8 months ago

Whenever stereoscopy is enabled the render gets saved to a file with a correct extension (be it JPEG, TIF, EXR etc.), however the saved file itself is always a PNG underneath (confirmed by looking at the file's header in Notepad++). This happens regardless of whether I set the stereoscopy to be in side-by-side format or individual - the file created is always side-by-side and is always a PNG underneath.

When stereoscopy is disabled the output is okay - the file created is a real file of the chosen type. There is a small secondary issue specifically with OpenEXR output - the color depth always changes to Float (Full) upon rendering with the addon. Would be nice to see this fixed as files with Float (Full) take A LOT more disk space while providing no actual benefit (Full is pretty much only useful for things like displacement maps. For regular renders there is no difference, even when pixel peeping while doing extreme color grading).

System information:

For now I was able to circumvent the issue by just rendering the left and right views separately with two cameras physically spaced apart, but would be nice to be able to use stereoscopy to do this automatically with a single camera (it could even save the views separately if there's no way to make it work otherwise).

SAM-tak commented 8 months ago

I didn’t notice at all… Thank you for the report. For now, I’ve fixed the bug where the contents of the file become PNG when stereoscopy is enabled.

The trouble related to OpenEXR couldn’t be fixed immediately, so it’s on hold.

AngryDraconequus commented 1 month ago

Welp, as it turns out the issue is deeper than I thought and I have not noticed it sooner because my previous scene didn't have as much dynamic range as the one I'm working on right now. Sadly the OpenEXR files that the addon creates are not actually OpenEXR underneath - just like with PNG before, now they're just Targa files which unfortunately are still just regular 8-bit files that don't preserve anything above what a regular PNG does and actually a 16-bit PNG is a bit better since it has no noticeable noise floor (you'll see it in the video comparison). I think the fundamental issue is working on intermediate files like Targa Raw (which is not actually RAW but 8-bit integer and uncompressed hence the 'raw') and PNG which can be only either 8 or 16-bit integer. Meanwhile OpenEXR is a 16 or 32-bit float which is a completely different thing and enables it to store a much wider dynamic range of numbers.

I think if you need to work on intermediate files to stitch them then there would be two options (besides OpenEXR itself of course) - TIF/TIFF (which does support 16 and even 32-bit float, however Blender only supports saving it in 8 or 16-bit integer format just like PNG) or FITS/FIT (an open format commonly used in astronomy, but has no native support in Blender). Anyway here's the video showing the problem: https://www.youtube.com/watch?v=E_qNQYTDbmU These are 4 single frames imported into DaVinci Resolve and then animated by changing the exposure in an identical way on all four of them - as you can see, only the real .EXR file has the dynamic range that lets you control the exposure freely (and also gives you massive color grading potential)

I'm also attaching some .blend files so that you might test this yourself. First open Render.blend and hit Render Animation (regular one, not eeVR) - that will create 3 files in EXR, PNG and Targa Raw formats. Then open up Preview.blend - at first you won't be able to see anything but the moment you change the exposure in the Exposure node the images should load and you will see in real time the dynamic range of each file. EXR Problem.zip

Edit: Oh also I should say that I'm testing on Blender 3.6, and I tested several versions of the addon and they all have this problem.