mirror of
https://github.com/open-goal/jak-project
synced 2026-07-31 08:16:02 -04:00
[graphics] fix ocean alpha and ocean near depth (#1236)
* fix up some graphics bugs * less of a hack fix
This commit is contained in:
@@ -251,35 +251,35 @@ void DirectRenderer2::setup_opengl_for_draw_mode(const Draw& draw,
|
||||
// (Cs - Cd) * As + Cd
|
||||
// Cs * As + (1 - As) * Cd
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (draw.mode.get_alpha_blend() == DrawMode::AlphaBlend::SRC_0_SRC_DST) {
|
||||
// (Cs - 0) * As + Cd
|
||||
// Cs * As + (1) * Cd
|
||||
// s, d
|
||||
ASSERT(draw.fix == 0);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ZERO);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (draw.mode.get_alpha_blend() == DrawMode::AlphaBlend::ZERO_SRC_SRC_DST) {
|
||||
// (0 - Cs) * As + Cd
|
||||
// Cd - Cs * As
|
||||
// s, d
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ZERO);
|
||||
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
|
||||
} else if (draw.mode.get_alpha_blend() == DrawMode::AlphaBlend::SRC_DST_FIX_DST) {
|
||||
// (Cs - Cd) * fix + Cd
|
||||
// Cs * fix + (1 - fx) * Cd
|
||||
glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
|
||||
glBlendFuncSeparate(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE, GL_ZERO);
|
||||
glBlendColor(0, 0, 0, draw.fix / 127.f);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (draw.mode.get_alpha_blend() == DrawMode::AlphaBlend::SRC_SRC_SRC_SRC) {
|
||||
// this is very weird...
|
||||
// Cs
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
} else if (draw.mode.get_alpha_blend() == DrawMode::AlphaBlend::SRC_0_DST_DST) {
|
||||
// (Cs - 0) * Ad + Cd
|
||||
glBlendFunc(GL_DST_ALPHA, GL_ONE);
|
||||
glBlendFuncSeparate(GL_DST_ALPHA, GL_ONE, GL_ONE, GL_ZERO);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
color_mult = 0.5;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user