1

I am using the SSAO code from learnopengl, but there are different results between my laptop monitor(LM) and external monitor(EM).

EM result(Good):

External monitor result

LM result(Bad):

Laptop monitor result

And when I drag the result window from LM to EM, the window doesn't change, vice versa.

Also, I use

glfwGetFramebufferSize(window, &screenWidth, &screenHeight);
glViewport(0, 0, screenWidth, screenHeight);

to set viewport size[reason], and I got

  • EM : screenWidth = 800, screenHeight = 600 (equal to window size)
  • LM : screenWidth = 1600, screenHeight = 1200

While I set laptop monitor viewport size to (800, 600), the result is good:
viewport size (800*600) LM result

When I don't use SSAO or do some simple tasks(skybox, loading model, etc), the result is same.

My laptop monitor is:

Retina 13.3-inch(2560 x 1600)
Intel Iris 1536 MB Graphics Card

My external monitor is:

AOC 2489W1 23.5-inch(1920 x 1080)
Intel Iris 1536 MB Graphics Card
60Hz

Any ideas on how to achieve this?

heyanbai
  • 27
  • 4
  • Actually, I only use one graphics card on my mac(Intel Iris 1536 MB). And I use HDMI to connect my laptop and the external monitor. – heyanbai Nov 09 '19 at 08:50
  • Do you use the same viewport size on both monitors? Could the problem be related to the size of some render-buffers? – BDL Nov 09 '19 at 14:53
  • The viewport size is different on both monitors, I used `glfwGetFramebufferSize(window, &screenWidth, &screenHeight);` to set viewport size. I think the problem may be related to some SSAO render-buffers, but I don't know how to debug such this problem. – heyanbai Nov 10 '19 at 02:27
  • @heyanbai In general the SSAO algorithm needs to know the resolution of the source textures (respectively the viewport size). Do yous set the proper viewport size? – Rabbid76 Nov 10 '19 at 07:55
  • I use the viewport size by which the result can fill the window. When I use the viewport size (800 * 600) for the laptop monitor, the result is same as the external monitor, but only displayed in the bottom left corner of the window. – heyanbai Nov 10 '19 at 11:22

0 Answers0