Skip to content

How to setup BGFX for 2D rendering #2621

Answered by pezcode
slewicki asked this question in Q&A
Discussion options

You must be logged in to vote

Your quad is most likely getting culled because you're looking at it from the opposite side (eye.z changed from 10 to -1). BGFX_STATE_DEFAULT implies clockwise culling, you can either turn off all culling or flip it to counter-clockwise:

// turn culling off
BGFX_STATE_DEFAULT & ~BGFX_STATE_CULL_MASK
// counter-clockwise
(BGFX_STATE_DEFAULT & ~BGFX_STATE_CULL_MASK) | BGFX_STATE_CULL_CCW

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@slewicki
Comment options

@pezcode
Comment options

@slewicki
Comment options

Answer selected by slewicki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants