1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

Set vertex alpha for texrect to 1.

This is actually a hack. Rect functions use vertex color and alpha set to zero.
This hack is done to fix issue #721 in Pokemon Stadium 2. The game uses
texrects to render images in the auxiliary buffer. The texrects use SHADE
for alpha combiner. Since alpha is zero, the rendered image in the auxiliary buffer
has zero alpha. When the auxiliary buffer is used as texture, it is blended with
background, and zero alpha makes it invisible. I set vertex alpha to 1 to avoid it.

When N64 saves pixel to 16bit frame buffer, it uses pixel coverage for alpha value to store,
not calculated pixel's alpha. Thus, on real N64 the auxiliary buffer will have
full alpha and blending will not make it invisible. Thus, true emulation will
require pixel coverage calculation and shader-based blending.
This commit is contained in:
Sergey Lipskiy 2015-09-25 19:34:41 +06:00
parent 11317c2d85
commit d506d6134d

View File

@ -1010,7 +1010,7 @@ void OGLRender::drawTexturedRect(const TexturedRectParams & _params)
#ifdef RENDERSTATE_TEST
StateChanges++;
#endif
glVertexAttrib4f(SC_COLOR, 0, 0, 0, 0);
glVertexAttrib4f(SC_COLOR, 0, 0, 0, 1);
glVertexAttribPointer(SC_POSITION, 4, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].x);
glVertexAttribPointer(SC_TEXCOORD0, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].s0);
glVertexAttribPointer(SC_TEXCOORD1, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &m_rect[0].s1);