Jump to content

image gets distorted in windowed mode


long_gone

Recommended Posts

2 hours ago, IIYAMA said:

With what resolution (math) do you draw your image?

float GetCoord(float a) {
    float base = RsGlobal.maximumWidth > RsGlobal.maximumHeight ? static_cast<float>(RsGlobal.maximumHeight) : static_cast<float>(RsGlobal.maximumWidth);
    return static_cast<float>(static_cast<int>(a * base / gScreenResolution));
}

i pass 0/0/ and 2084 / 128 for vertices

Edited by long_gone
Link to comment
  • Moderators
5 hours ago, long_gone said:
float GetCoord(float a) {
    float base = RsGlobal.maximumWidth > RsGlobal.maximumHeight ? static_cast<float>(RsGlobal.maximumHeight) : static_cast<float>(RsGlobal.maximumWidth);
    return static_cast<float>(static_cast<int>(a * base / gScreenResolution));
}

i pass 0/0/ and 2084 / 128 for vertices

It might be a ppi issue. (I am not a shader expert) but let me speculate a bit.

Afaik: When playing with border less settings and window mode, the same resolution is returned on https://wiki.multitheftauto.com/wiki/GuiGetScreenSize

Not sure if you used that one to create your render target.

This might put a difference between the resolution the shader is placing the texture on the screen and the resolution delivered by the texture.

If this situation is matching yours, what if you do not scale the texture? But placing it with the exact size. Either by the texture size or by the pixels the shader is about to draw.

Anyway, those artifacts are most of the time caused by some sort of scaling.

  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...