Welcome, Guest.
Username: Password: Remember me

TOPIC: ReShade::PixelSize

ReShade::PixelSize 4 months 4 days ago #1

I'm curious why 1.0 / ReShade::ScreenSize is significantly more precise than ReShade::PixelSize
It's really noticeable on the horizontal axis
The administrator has disabled public write access.

ReShade::PixelSize 4 months 4 days ago #2

How was it output
float2 A = 1.0 / ReShade::ScreenSize;
float2 B = ReShade::PixelSize;
[Statistics] -> [Show HLSL/GLSL]

My case (this is lower than FLT_EPSILON)
const float2 _50 = float2(0.00099206, 0.00131406);
float2 A;
A = _50;
const float2 _52 = float2(0.00099200, 0.00131400);
float2 B;
B = _52;

[Edit]
I guess out of precision was trimmed at float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT).
float precision is about 6 digits.
202px
A = 0.00495049 ... 202.000206
B = 0.00495000 ... 202.020202
3840px
A = 0.00026042 ... 3839.95
B = 0.00026000 ... 3846.15
Last Edit: 4 months 4 days ago by seri14.
The administrator has disabled public write access.

ReShade::PixelSize 4 months 4 days ago #3

Maybe I found the answer.
see line of pp.add_macro_definition("BUFFER_RCP_WIDTH", ...) in runtime.cpp.
The std::to_string(float) is using _scprintf("%f", ...).
default output float format precision is 6 digits. (see MSDN Format specification syntax: printf and wprintf functions)
The administrator has disabled public write access.
The following user(s) said Thank You: crosire, brussell