Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

seems framebuffer buffer has different Y+ direction on metal and opengl #2830

Closed
lemoon opened this issue Jun 29, 2022 · 1 comment
Closed

Comments

@lemoon
Copy link

lemoon commented Jun 29, 2022

i try to fill content to a framebuffer ,then present framebuffer to screen
for example ,i draw a full screen texture to a framebuffer,then draw framebuffer's color to the screen
it seems has different result on Metal/OpenGL backend, Screen result shows that will flip texture's Y-axis on OpenGL backend and looks good on Metal.

And how to solve this problem?

simple vs draw a full screen image

$input a_position,a_texcoord0
$output v_texcoord0

void main()
{
    gl_Position = vec4(a_position, 1.0);
    v_texcoord0 = a_texcoord0;
}

simple fs draw a full screen image

$input v_texcoord0
#include "../../../../core/shaders/common/common.sh"

SAMPLER2D(u_texture,0);


void main()
{
    gl_FragColor = texture2D(u_texture, v_texcoord0);
}

mesh data
float vertices[] =
{
x, y2, 0, 1,
x, y, 0, 0,
x2, y2, 1, 1,
x2, y, 1, 0
};

i think there are somthing bgfx need to do.
gpuweb/gpuweb#416

@bkaradzic
Copy link
Owner

You should check documentation and examples and you'll see how it's dealt with it... Search for originBottomLeft:
https://bkaradzic.github.io/bgfx/bgfx.html#_CPPv4N4bgfx4Caps16originBottomLeftE

Repository owner locked and limited conversation to collaborators Jun 29, 2022
@bkaradzic bkaradzic converted this issue into discussion #2831 Jun 29, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants