Screen Resolution Scale Issue

Hi,

I am not sure it is a bug or a feature which I did not dig deeply enough.

Basically, the following the blueprint is a just test to print out mouse location and the screen location which is converted from a world location, which is converted from mouse location. I hope you understand what I mean. So I expect the output result should be same.

However, with different resolution scale, it returned very different result. Here are the results, Red text is mouse location and blue text is location after conversion.
First Test: Resolution scale 100%,

22724-scale100p.png

22726-scale100pout.png

Second Test: Resolution scale 25%,

22727-scale25p.png

22728-scale25pout.png

So with 25% scale, the location is at half position location.

My question is if it is expected result or a bug. What is best way to get correct screen location independent from resolution scale?

Thanks a lot.

Hi ,

We were able to reproduce this behavior and have entered a bug report (UE-6191). We are not certain whether the Get Mouse Position or the Convert World Location to Screen Location is incorrect when the Resolution Scale is adjusted, but it seems that they should match. We will let you know when we see an update on the bug. Thanks for the report!

Cheers,

.

I’m pretty sure that the “Convert World Location to Screen Location” does not account for resolution scale either.
Do we have a fix for this yet?

The bug is still currently in testing and attempting to be resolved. This is all the information I can provide at this time. We will let you know when this bug has been fixed within the upcoming hot fixes and/or release notes for the engine.

Thank you,

Alright thanks, in the meantime however I figured out that it’s just a simple matter of dividing the Vector2D with the resolution scale.
For example in code you can do something like this:
static const auto CVarScreenPercentage = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT(“r.ScreenPercentage”));
float ScreenPercentage = CVarScreenPercentage->GetValueOnGameThread() / 100.f;

Location2D.X /= ScreenPercentage;
Location2D.Y /= ScreenPercentage;

But r.ScreenPercentage is not exposed in blueprints unfortunately so it’s only possible from C++ afaik.
At any case this seems like a simple fix so I would hate to see this not fixed in 4.7 because of priority reasons :stuck_out_tongue:
Thanks anyway! keep up the good work.

Great thank you for the little snippet of code fix! We always appreciate users offering help to others :slight_smile:

Thanks a lot. It is really helpful. For the sake of blueprint, we have to hack C++ code to return ScreenPercentage to BP somehow.

Any news if this will be fixed in 4.7?

We have plans to fix this issue soon, but this fix is not on the roadmap for 4.7.

As a note, TK-Masters code is not safe to call in packaged versions of the game, so make sure you wrap it in pre-processor commands:

#if WITH_EDITOR
#endif WITH_EDITOR