mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
8cca656df6
commit
24df14f9f3
1 changed files with 36 additions and 26 deletions
|
@ -41,6 +41,7 @@ struct PosColorUvVertex
|
||||||
float m_u;
|
float m_u;
|
||||||
float m_v;
|
float m_v;
|
||||||
uint32_t m_abgr;
|
uint32_t m_abgr;
|
||||||
|
|
||||||
static void init()
|
static void init()
|
||||||
{
|
{
|
||||||
ms_decl
|
ms_decl
|
||||||
|
@ -235,7 +236,10 @@ void VectorDisplay::endFrame()
|
||||||
|
|
||||||
bgfx::setViewFrameBuffer(viewCounter, m_glow0FrameBuffer); //first glow pass
|
bgfx::setViewFrameBuffer(viewCounter, m_glow0FrameBuffer); //first glow pass
|
||||||
bgfx::setViewRect(viewCounter, 0, 0, m_glowWidth, m_glowHeight);
|
bgfx::setViewRect(viewCounter, 0, 0, m_glowWidth, m_glowHeight);
|
||||||
bgfx::setState(BGFX_STATE_RGB_WRITE | BGFX_STATE_ALPHA_WRITE);
|
bgfx::setState(0
|
||||||
|
| BGFX_STATE_RGB_WRITE
|
||||||
|
| BGFX_STATE_ALPHA_WRITE
|
||||||
|
);
|
||||||
float scale[2];
|
float scale[2];
|
||||||
scale[0] = 1.0f / m_glowWidth;
|
scale[0] = 1.0f / m_glowWidth;
|
||||||
scale[1] = 0.0f;
|
scale[1] = 0.0f;
|
||||||
|
@ -263,7 +267,10 @@ void VectorDisplay::endFrame()
|
||||||
scale[1] = 1.0f / m_glowHeight;
|
scale[1] = 1.0f / m_glowHeight;
|
||||||
bgfx::setUniform(u_blur_scale, &scale);
|
bgfx::setUniform(u_blur_scale, &scale);
|
||||||
|
|
||||||
bgfx::setState(BGFX_STATE_RGB_WRITE | BGFX_STATE_ALPHA_WRITE);
|
bgfx::setState(0
|
||||||
|
| BGFX_STATE_RGB_WRITE
|
||||||
|
| BGFX_STATE_ALPHA_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
bgfx::setViewName(viewCounter, "BlendPassB");
|
bgfx::setViewName(viewCounter, "BlendPassB");
|
||||||
bgfx::submit(viewCounter);
|
bgfx::submit(viewCounter);
|
||||||
|
@ -280,7 +287,8 @@ void VectorDisplay::endFrame()
|
||||||
bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
|
bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
|
||||||
bgfx::setTexture(0, s_textureSampler, m_sceneFrameBuffer);
|
bgfx::setTexture(0, s_textureSampler, m_sceneFrameBuffer);
|
||||||
bgfx::setProgram(m_blitShader);
|
bgfx::setProgram(m_blitShader);
|
||||||
bgfx::setState(BGFX_STATE_RGB_WRITE
|
bgfx::setState(0
|
||||||
|
| BGFX_STATE_RGB_WRITE
|
||||||
| BGFX_STATE_ALPHA_WRITE
|
| BGFX_STATE_ALPHA_WRITE
|
||||||
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
|
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
|
||||||
);
|
);
|
||||||
|
@ -300,7 +308,8 @@ void VectorDisplay::endFrame()
|
||||||
bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
|
bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
|
||||||
bgfx::setTexture(0, s_textureSampler, m_glow1FrameBuffer);
|
bgfx::setTexture(0, s_textureSampler, m_glow1FrameBuffer);
|
||||||
bgfx::setProgram(m_blitShader);
|
bgfx::setProgram(m_blitShader);
|
||||||
bgfx::setState(BGFX_STATE_RGB_WRITE
|
bgfx::setState(0
|
||||||
|
| BGFX_STATE_RGB_WRITE
|
||||||
| BGFX_STATE_ALPHA_WRITE
|
| BGFX_STATE_ALPHA_WRITE
|
||||||
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
|
| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
|
||||||
);
|
);
|
||||||
|
@ -818,7 +827,8 @@ void VectorDisplay::screenSpaceQuad(float _textureWidth, float _textureHeight, f
|
||||||
|
|
||||||
void VectorDisplay::setupResDependent()
|
void VectorDisplay::setupResDependent()
|
||||||
{
|
{
|
||||||
const uint32_t samplerFlags = BGFX_TEXTURE_RT
|
const uint32_t samplerFlags = 0
|
||||||
|
| BGFX_TEXTURE_RT
|
||||||
| BGFX_TEXTURE_MIN_POINT
|
| BGFX_TEXTURE_MIN_POINT
|
||||||
| BGFX_TEXTURE_MAG_POINT
|
| BGFX_TEXTURE_MAG_POINT
|
||||||
| BGFX_TEXTURE_MIP_POINT
|
| BGFX_TEXTURE_MIP_POINT
|
||||||
|
@ -868,7 +878,7 @@ void VectorDisplay::genLinetex() // generate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t flags = 0
|
const uint32_t flags = 0
|
||||||
| BGFX_TEXTURE_U_CLAMP
|
| BGFX_TEXTURE_U_CLAMP
|
||||||
| BGFX_TEXTURE_V_CLAMP
|
| BGFX_TEXTURE_V_CLAMP
|
||||||
| BGFX_TEXTURE_MIN_POINT
|
| BGFX_TEXTURE_MIN_POINT
|
||||||
|
|
Loading…
Reference in a new issue