Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downscale JavaFX Scene Preview #1013

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

IceSelkie
Copy link
Member

@IceSelkie IceSelkie commented Jul 26, 2021

This takes the JavaFX preview window and downscales the preview view to fit within the JavaFX canvas sizes, thus avoiding crashes that might otherwise happen. If using fit-to-screen, there should be little to no noticeable difference on most standard scenes. Scenes that are very tall and thin, or wide and short may be downsized somewhat.

Most of this was pulled out of #786. This will fix #314 and should fix #27.

This allows for renders of sizes larger than 4k on all computers without crashing (as opposed to crashing on different computers at different sizes above 4k). This makes the new effective largest size 26.7k square, or 18* 1920x1080 (34560 x19440) before crashing due to maxing out the SampleBuffer (This can be solved by replacing the double[] with a double[][], as done in #786)

Here is what the canvas scale dropdown looks like now when the canvas is large enough to be scaled (previously, only had the % value on the right):
A screenshot showing the new Canvas Scale dropdown.

It confused me when I saw the original percents, since for large scenes, amount viewed on screen was far more zoomed out than expected. Displaying the actual viewed scale and from what it was downscaled to, should hopefully make more sense.
@IceSelkie
Copy link
Member Author

IceSelkie commented Jul 26, 2021

An addition to this could be to crop the displayed area (at full resolution) instead of downscaling (but keeping the whole image). Will look into this.

@IceSelkie
Copy link
Member Author

Most of this is from commit 3315256 in #786 (minor changes have been added since).

@leMaik leMaik added the GUI label Jul 26, 2021
@leMaik
Copy link
Member

leMaik commented Aug 5, 2021

tbh I don't get what the new context menu options do. Also the preview is terribly slow for high resolutions. Maybe we could always render the preview at the preview size and only render the real image at full resolution? 🤔

@IceSelkie
Copy link
Member Author

tbh I don't get what the new context menu options do. Also the preview is terribly slow for high resolutions. Maybe we could always render the preview at the preview size and only render the real image at full resolution? 🤔

render at preview size would be... more difficult. I can look into changing it to that later.

The menu with the size percents is telling you what its displaying it as is effectively 400% if it were the full image, but since it was downscaled its only zooming 200% on the downscaled image, as an example. I wanted to convey both values, because otherwise when you set the zoom, it may appear blurry or pixelated at a low zoom, and you might get confused about canvas size vs preview size (like I did at one point). idk how to otherwise convey both values.

(If you are below the size where it scales the preview though, it will just have the standard %s and not mention downscaling.)

@jackjt8
Copy link
Member

jackjt8 commented Aug 22, 2021

image

12800x12800 ~22,650.7MB

Well.. I can't really test the upper bounds of this fix due to how much memory it is using so far but it doesn't crash.... available options are a bit complex.

@IceSelkie
Copy link
Member Author

Any ideas on how to make the options better?

@jackjt8
Copy link
Member

jackjt8 commented Aug 23, 2021

As lemaik has pointed out the scaling options are confusing..
image

Surely instead of downscaling it should read upscaled/zoomed if above 100%? Would be a bit less confusing.

@IceSelkie
Copy link
Member Author

As lemaik has pointed out the scaling options are confusing..
[image]

Surely instead of downscaling it should read upscaled/zoomed if above 100%? Would be a bit less confusing.

hmmm yeah that wording is a bit strange. It should be describing that the preview is zoomed to 400%, but due to downscaling, that 400% is down scaled 100% (or same zoom level as the output file will be), but since its zoom is 400% in javafx, its only displaying 1/16th of the pixels.

Does that make sense? I didnt really know how else to describe it in a couple words...

Weird issue with afterimages on preview; the code comes from pixel duplication somewhere, but I cant figure out where that is done...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use resolution above 12800x12800 Changing canvas size sometimes does not resize the preview window
3 participants