DrawText produces wrong output

  • Posts: 280
4 weeks 4 hours ago - 4 weeks 4 hours ago #1 by brussell
There seems to be a bug in the "DrawText_Digit" function from DrawText.fxh.
See this example file:

DrawDigitTest.fx
#include "ReShadeUI.fxh"

uniform float testfloat < __UNIFORM_SLIDER_FLOAT1
    ui_min = 0; ui_max = 1000;
    ui_step = 1;
> = 100;

#include "ReShade.fxh"
#include "DrawText.fxh"

float4 PS_DrawDigitTest(float4 pos : SV_Position, float2 texcoord : TEXCOORD) : SV_Target
{
    float res = 0;
    
    DrawText_Digit(float2(500.0 , 500.0), 32, 1, texcoord,  0, testfloat , res);
        
    return res;
}


technique DrawDigitTest
{
    pass {
        VertexShader = PostProcessVS;
        PixelShader = PS_DrawDigitTest;
    }
}

Input 82 results in output: 81


Other examples are:
100 -> 00
380 -> 370

Please Log in or Create an account to join the conversation.