Falcor icon indicating copy to clipboard operation
Falcor copied to clipboard

Incorrect Frame Size at 4k

Open NTimmons opened this issue 6 years ago • 4 comments

I am dumping image captures from scenes for comparison at different resolutions.

Setting the window size from Window.h to 1920x1080 lets me capture frames which output as 1080p as expected.

Setting this to 3840x2160 gives me an image with output dimensions of 3840x2130

aa_fxaa aa_4k_ss

NTimmons avatar Oct 26 '18 14:10 NTimmons

This is the cause:

void Window::checkWindowSize()
{
    // Actual window size may be clamped to slightly lower than monitor resolution
    int32_t actualWidth, actualHeight;
    glfwGetWindowSize(mpGLFWWindow, &actualWidth, &actualHeight);

    mWidth = uint32_t(actualWidth);
    mHeight = uint32_t(actualHeight);
    mMouseScale.x = 1.0f / (float)mWidth;
    mMouseScale.y = 1.0f / (float)mHeight;
}

mWidth and mHeight begin correct but glfwGetWindowSize returns the clipped height.

My current guess is that: GLFWwindow* pGLFWWindow = glfwCreateWindow(desc.width, desc.height, desc.title.c_str(), mon, nullptr);

Can't create a window larger than the desktop resolution?

Investigating further.

NTimmons avatar Oct 26 '18 15:10 NTimmons

That's not a GLFW issue, it's a Windows issue. CreateWindows clamps the size of the requested window the desktop size. If you want 4K:

  • If you have a 4K monitor, run the samples in fullscreen mode
  • If you don't have a 4K monitor you can create a 4K render-target and blit it

nbentyNV avatar Oct 26 '18 18:10 nbentyNV

Fair enough. If I push a commit with a warning that pops up when this happens would that be accepted? Just in-case any one hits or trips on this behaviour, as its odd. Windows supports windows of (basically) any size.

NTimmons avatar Oct 26 '18 19:10 NTimmons

Sure. I just found this - https://stackoverflow.com/questions/445893/create-window-larger-than-desktop-display-resolution

Apparently it's an OS restriction but there's a way to override it. I'm keeping this issue open for now

nbentyNV avatar Oct 26 '18 19:10 nbentyNV