Skip to content

[core] Very low rendering quality on 4K displays on PLATFORM_WEB #3372

@ypujante

Description

@ypujante

I have been trying to port my application RE Edit which is a raylib/ImGui application to the web platform to offer a demo (since there is no filesystem access available I cannot really run it in a browser until it is available in wasm...)

I have a prototype running and it looks quite bad:

  • On macOS (showing web on the left, native on the right):
macOS
  • On Windows (showing that the resolution is 4K on the left, web on the right):
Windows

I have created a small reproducible test case to show the issue which uses raylib only (top is web, bottom is native):

test_case

The source code for the test case is this:

#include "raylib.h"

int main()
{
  InitWindow(800, 450, "raylib [core] example - basic window");

  SetTargetFPS(60);

  while (!WindowShouldClose())
  {
    BeginDrawing();
    ClearBackground(RAYWHITE);
    DrawText("The quick brown fox jumps over the lazy dog", 10, 10, 20, BLACK);
    DrawText("Congrats! You created your first window!", 10, 40, 20, LIGHTGRAY);
    DrawFPS(10, 70);

    EndDrawing();
  }

  CloseWindow();

  return 0;
}

Is this a bug in raylib? A bug in glfw3? Or a misconfiguration? I have followed the steps described here but there isn't any mention of the quality of the rendering nor how to make it look better on 4K displays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions