Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[examples] shaders_julia_set doesn't fill screen on Macbook Retina #837

Closed
a3f opened this issue May 15, 2019 · 11 comments
Closed

[examples] shaders_julia_set doesn't fill screen on Macbook Retina #837

a3f opened this issue May 15, 2019 · 11 comments
Labels
funding needed Required some funds/resources to work on this issue platform: macOS macOS platform

Comments

@a3f
Copy link
Contributor

a3f commented May 15, 2019

Screen Shot 2019-05-15 at 18 01 08

I am running raylib master with macOS 10.14.4 on a macbook pro retina.

@raysan5
Copy link
Owner

raysan5 commented May 15, 2019

@a3f is high-dpi support flag enabled?

@a3f
Copy link
Contributor Author

a3f commented May 15, 2019

SUPPORT_HIGH_DPI is defined by default and if I manually undef it, the texture doesn't change size, but moves:
Screen Shot 2019-05-15 at 23 44 03

In both cases, the console output is the same:

INFO: Display size: 1680 x 1050
INFO: Render size: 800 x 450
INFO: Screen size: 800 x 450
INFO: Viewport offsets: 0, 0

@raysan5
Copy link
Owner

raysan5 commented May 16, 2019

@a3f, does it only happen with this example?

GLSL shader julia_set.fs uses the internally OpenGL provided variable gl_FragCoord (unnormalized screen coordinates) instead of provided fragTexCoord, it's the only shader using this... probably related.

@raysan5 raysan5 added the platform: macOS macOS platform label May 16, 2019
@raysan5
Copy link
Owner

raysan5 commented May 16, 2019

Replaced gl_fragCoord coordinates by provided fragTexCoord (that refer to the full screen texture drawing) on commit 9fd410b

@a3f
Copy link
Contributor Author

a3f commented May 17, 2019

@a3f, does it only happen with this example?

Just ran them and it happens as well with:

  • shaders_custom_uniform, shaders_eratosthenes, shaders_postprocessing

The others are unaffected.

Replaced gl_fragCoord coordinates by provided fragTexCoord (that refer to the full screen texture drawing) on commit 9fd410b

Still looks the same:
Screen Shot 2019-05-17 at 20 38 34

@raysan5
Copy link
Owner

raysan5 commented May 17, 2019

ok, I detected the issue, the screenWidth-screenHeight provided to those shaders do not match render size (scaled to HighDPI)

@MikeDX
Copy link
Sponsor Contributor

MikeDX commented Dec 22, 2019

As an additional feature to this bug, the following code causes the text to be zoomed 2x

BeginTextureMode(F_renderTarget);
    ClearBackground(colour);

    BeginMode3D(camera);
        DrawModel(F_objects[0].model, Vector3Zero(), 1.0f, WHITE);
        DrawGrid(10, 1.0f);         // Draw a grid
    EndMode3D();
  
    DrawTextEx(F_font, text, (Vector2){cur_x,cur_y},fontSize, 0, F_Ink);
EndTextureMode();

BeginDrawing();
    ClearBackground(BLACK);

    DrawTextureRec(F_framebuffer.texture, (Rectangle){ 0, 0, F_framebuffer.texture.width, -F_framebuffer.texture.height }, (Vector2){ 0,0}, WHITE);
EndDrawing();

Screenshot 2019-12-22 at 23 14 26

however, with the 3d block removed, the text is the correct size

BeginTextureMode(F_renderTarget);
    ClearBackground(colour);

    DrawTextEx(F_font, text, (Vector2){cur_x,cur_y},fontSize, 0, F_Ink);
EndTextureMode();

BeginDrawing();
    ClearBackground(BLACK);

    DrawTextureRec(F_framebuffer.texture, (Rectangle){ 0, 0, F_framebuffer.texture.width, -F_framebuffer.texture.height }, (Vector2){ 0,0}, WHITE);
EndDrawing();

Screenshot 2019-12-22 at 23 14 13

@raysan5 raysan5 added the funding needed Required some funds/resources to work on this issue label Jan 8, 2020
@raysan5
Copy link
Owner

raysan5 commented Jan 8, 2020

funding needed: I don't have a Macbook Retina device to work on this issue, if someone could provide one it would be great.

@raysan5
Copy link
Owner

raysan5 commented Jan 29, 2020

Closing this issue, moved to a more specific description.

@raysan5 raysan5 closed this as completed Jan 29, 2020
raysan5 added a commit that referenced this issue Jan 29, 2020
heretique pushed a commit to heretique/raylib that referenced this issue Apr 6, 2020
@thevojacek
Copy link

Will this ever get fixed? I am using Raylib 3.0.0 and this is exact behavior i get. What helps is to manually move the window, then everything gets rendered correctly.

@raysan5
Copy link
Owner

raysan5 commented May 28, 2020

@thevojacek actually this issue is related to #1086. It's also macOS dependant. No solution found yet...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
funding needed Required some funds/resources to work on this issue platform: macOS macOS platform
Projects
None yet
Development

No branches or pull requests

4 participants