fall back to black
This commit is contained in:
@@ -141,30 +141,13 @@ bool SimpleMotionRenderer::InitializeGl(unsigned width, unsigned height)
|
|||||||
|
|
||||||
void SimpleMotionRenderer::RenderFrame(uint64_t frameIndex)
|
void SimpleMotionRenderer::RenderFrame(uint64_t frameIndex)
|
||||||
{
|
{
|
||||||
if (!EnsurePatternProgram())
|
(void)frameIndex;
|
||||||
{
|
|
||||||
glViewport(0, 0, static_cast<GLsizei>(mWidth), static_cast<GLsizei>(mHeight));
|
|
||||||
glDisable(GL_SCISSOR_TEST);
|
|
||||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
glViewport(0, 0, static_cast<GLsizei>(mWidth), static_cast<GLsizei>(mHeight));
|
glViewport(0, 0, static_cast<GLsizei>(mWidth), static_cast<GLsizei>(mHeight));
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
glUseProgram(mPatternProgram);
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
const GLint resolutionLocation = glGetUniformLocation(mPatternProgram, "uResolution");
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
if (resolutionLocation >= 0)
|
|
||||||
glUniform2f(resolutionLocation, static_cast<float>(mWidth), static_cast<float>(mHeight));
|
|
||||||
const GLint frameIndexLocation = glGetUniformLocation(mPatternProgram, "uFrameIndex");
|
|
||||||
if (frameIndexLocation >= 0)
|
|
||||||
glUniform1f(frameIndexLocation, static_cast<float>(frameIndex));
|
|
||||||
glBindVertexArray(mPatternVertexArray);
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, 3);
|
|
||||||
glBindVertexArray(0);
|
|
||||||
glUseProgram(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleMotionRenderer::RenderTexture(GLuint texture)
|
void SimpleMotionRenderer::RenderTexture(GLuint texture)
|
||||||
|
|||||||
@@ -169,9 +169,9 @@ bool RuntimeShaderRenderer::EnsureStaticGlResources(std::string& error)
|
|||||||
{
|
{
|
||||||
const unsigned char pixels[] = {
|
const unsigned char pixels[] = {
|
||||||
0, 0, 0, 255,
|
0, 0, 0, 255,
|
||||||
96, 64, 32, 255,
|
0, 0, 0, 255,
|
||||||
64, 96, 160, 255,
|
0, 0, 0, 255,
|
||||||
255, 255, 255, 255
|
0, 0, 0, 255
|
||||||
};
|
};
|
||||||
glGenTextures(1, &mFallbackSourceTexture);
|
glGenTextures(1, &mFallbackSourceTexture);
|
||||||
glBindTexture(GL_TEXTURE_2D, mFallbackSourceTexture);
|
glBindTexture(GL_TEXTURE_2D, mFallbackSourceTexture);
|
||||||
|
|||||||
Reference in New Issue
Block a user