Ver código fonte

gpu: add full support for alpha test in GL and D3D.

master
Sam Hocevar 11 anos atrás
pai
commit
f58a6615aa
2 arquivos alterados com 3 adições e 5 exclusões
  1. +2
    -4
      neercs/video/render.cpp
  2. +1
    -1
      neercs/video/text-render.cpp

+ 2
- 4
neercs/video/render.cpp Ver arquivo

@@ -862,8 +862,7 @@ void Render::ShaderSimple(Framebuffer *fbo_output, int n)
int Render::InitDraw(void)
{
glDepthMask(GL_TRUE); // do not write z-buffer
glEnable(GL_CULL_FACE); // disable cull face
glCullFace(GL_BACK); // don't draw front face

/* initialise framebuffer objects */
fbo_back = new Framebuffer(screen_size);
fbo_screen = new Framebuffer(screen_size);
@@ -1452,7 +1451,6 @@ void Render::Draw2D()
/* Clear the back buffer */

RenderContext rc;
rc.SetAlphaBlend(true);
rc.SetBlendFunc(BlendFunc::SrcColor, BlendFunc::DstAlpha);

glEnable(GL_TEXTURE_2D);
@@ -1479,7 +1477,7 @@ void Render::Draw3D()
return;

RenderContext rc;
rc.SetAlphaBlend(false);
rc.SetBlendFunc(BlendFunc::Disabled, BlendFunc::Disabled);
rc.SetDepthFunc(DepthFunc::Disabled);

glEnableClientState(GL_VERTEX_ARRAY);


+ 1
- 1
neercs/video/text-render.cpp Ver arquivo

@@ -186,7 +186,7 @@ void TextRender::Blit(ivec2 pos, ivec2 size)
uint64_t const &x = *(uint64_t const *)&t;

RenderContext rc;
rc.SetAlphaBlend(false);
rc.SetBlendFunc(BlendFunc::Disabled, BlendFunc::Disabled);

glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, (int)x);


Carregando…
Cancelar
Salvar