reshape() mess

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

reshape() mess

nickreserved
The following code is my reshape() function.
When I have application window maximized (4K) I get results around 2255 x 1370 which are totally wrong, because 4K is 3840 x 2160, so an output 3600+ x 1900+ will be ok.

Is this a bug, or I miss something?

Windows 7 x64, JDK/JRE 9.0.x, JOGL 2.3.2

@Override
public void reshape(GLAutoDrawable glad, int i, int i1, int i2, int i3) {
	System.out.println("reshape: " + glad.getSurfaceWidth() + " x " + glad.getSurfaceHeight());
	// program.use()
	// Projection*Modeview calculation
	// glUniformMatrix <- Projection * Modelview
}
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

nickreserved
This post was updated on .
It is a bug.

I had change text size (in Control Panel) from smaller (100%) to larger (150%).
2255 * 150% = 3382 which has pretty logic.

I change text size to smaller (100%) and reshape() works ok.

Fix it.

I use a canvas in swing.
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

gouessej
Administrator
Hey

nickreserved wrote
Fix it.
If that's the way you'd like to communicate with us, don't expect any help.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

Xerxes Rånby
In reply to this post by nickreserved
The control dialog you refer to makes "text and other items" larger by changing the DPI.
Windows makes "text and other items" larger by giving applications a smaller window and then streaching the window to match the new DPI. It is a Windows feature.
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

nickreserved
In reply to this post by gouessej
Sorry for my language.
It was the elation of "I found a bug!".
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

Xerxes Rånby
It is not a bug, it is a Microsoft windows feature to scale everything to look 150% bigger by lower the DPI and sacrificing detail.

Den tis 15 maj 2018 18:23nickreserved [via jogamp] <[hidden email]> skrev:
Sorry for my language.
It was the elation of "I found a bug!".


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/reshape-mess-tp4038859p4038870.html
To start a new topic under jogl, email [hidden email]
To unsubscribe from jogamp, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

nickreserved
In reply to this post by Xerxes Rånby
It is a windows feature.
But when I render the scene, it takes only a part of drawable.
So, there is a problem.
Because implied glViewport() called with wrong parameters.
And even if I want to correct glViewport(), there is no a
float GLAutoDrawable.getScale()

Getters return the scaled dimensions.
Rendering happens in real dimensions.
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

nickreserved
In reply to this post by Xerxes Rånby
I have my doubts that you are wrong. I am not so sure by the way.
I believe there is no detail sacrifice.
Just bigger fonts.
Certainly some gui bitmaps upscaled without more detail. But fonts rendered bigger and they are vector graphics.

The point is that in my 4K monitor I must have 150% upscaling.
With 150% upscaling, JOGL getters return smaller surface dimensions but rendering happens in physical dimensions, and there is no conversion between them.
Reply | Threaded
Open this post in threaded view
|

Re: reshape() mess

Xerxes Rånby
This article describe how microsoft thinks developers should deal with DPI awareness on windows. There is no silver bullet. most of the DPI aware API's are not available on all windows versions.

How windows handle DPI cause unexpected user experience for many opengl frameworks.

what really complicate it is that different opengl drivers (nvidia and intel) has bugs that only appear when trying to use the DPI aware api's.
example images on how one opengl application can behave differently depending on the opengl driver in combination wih DPi settings.

thus a potential fix needs to take in account
A: all windows versions. a fix need to work for both when DPI aware APIs are available and when DPI aware apis are missing all depending on the windows version.
B: we do not know all driver bugs, we need to add workaround for each driver when the bug is identified

thus if you want to help fix DPI on windows you can work on extending a junit testcase that break with your driver and windows version.



2018-05-15 18:50 GMT+02:00 nickreserved [via jogamp] <[hidden email]>:
I have my doubts that you are wrong. I am not so sure by the way.
I believe there is no detail sacrifice.
Just bigger fonts.
Certainly some gui bitmaps upscaled without more detail. But fonts rendered bigger and they are vector graphics.

The point is that in my 4K monitor I must have 150% upscaling.
With 150% upscaling, JOGL getters return smaller surface dimensions but rendering happens in physical dimensions, and there is no conversion between them.


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/reshape-mess-tp4038859p4038873.html
To start a new topic under jogl, email [hidden email]
To unsubscribe from jogamp, click here.
NAML