mirror of
https://github.com/open-goal/jak-project
synced 2026-09-12 12:55:22 -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:
@@ -37,26 +37,26 @@ DoubleDraw setup_opengl_from_draw_mode(DrawMode mode, u32 tex_unit, bool mipmap)
|
||||
switch (mode.get_alpha_blend()) {
|
||||
case DrawMode::AlphaBlend::SRC_DST_SRC_DST:
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ZERO);
|
||||
break;
|
||||
case DrawMode::AlphaBlend::SRC_0_SRC_DST:
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ZERO);
|
||||
break;
|
||||
case DrawMode::AlphaBlend::SRC_0_FIX_DST:
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBlendFunc(GL_ONE, GL_ONE);
|
||||
glBlendFuncSeparate(GL_ONE, GL_ONE, GL_ONE, GL_ZERO);
|
||||
break;
|
||||
case DrawMode::AlphaBlend::SRC_DST_FIX_DST:
|
||||
// Cv = (Cs - Cd) * FIX + Cd
|
||||
// Cs * FIX * 0.5
|
||||
// Cd * FIX * 0.5
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glBlendFunc(GL_CONSTANT_COLOR, GL_CONSTANT_COLOR);
|
||||
glBlendFuncSeparate(GL_CONSTANT_COLOR, GL_CONSTANT_COLOR, GL_ONE, GL_ZERO);
|
||||
glBlendColor(0.5, 0.5, 0.5, 0.5);
|
||||
break;
|
||||
case DrawMode::AlphaBlend::ZERO_SRC_SRC_DST:
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ZERO);
|
||||
glBlendEquation(GL_FUNC_REVERSE_SUBTRACT);
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user