ReignEngine: Set correct initial value for fog parameters

This fixes rendering issue of the model viewer in Alice's Mansion.
This commit is contained in:
kichikuou
2022-11-05 22:17:38 +09:00
parent 581593f9b5
commit 5f17dafdf8
4 changed files with 10 additions and 1 deletions
+1
View File
@@ -42,6 +42,7 @@ enum RE_motion_state {
};
enum RE_fog_type {
RE_FOG_NONE = 0,
RE_FOG_LINEAR = 1,
RE_FOG_LIGHT_SCATTERING = 2,
};
+3
View File
@@ -50,6 +50,7 @@ static const char *motion_state_name(enum RE_motion_state state)
static const char *fog_type_name(enum RE_fog_type type)
{
switch (type) {
case RE_FOG_NONE: return "NONE";
case RE_FOG_LINEAR: return "LINEAR";
case RE_FOG_LIGHT_SCATTERING: return "LIGHT_SCATTERING";
}
@@ -136,6 +137,8 @@ void RE_debug_print(struct sact_sprite *sp, int indent)
indent_printf(indent, "fog_type = %s,\n", fog_type_name(p->fog_type));
switch (p->fog_type) {
case RE_FOG_NONE:
break;
case RE_FOG_LINEAR:
indent_printf(indent, "fog_near = %f, fog_far = %f,\n", p->fog_near, p->fog_far);
indent_printf(indent, "fog_color = {r=%f, g=%f, b=%f},\n", SPREAD_VEC3(p->fog_color));
+4 -1
View File
@@ -188,7 +188,10 @@ struct RE_plugin *RE_plugin_new(void)
plugin->aar = aar;
for (int i = 0; i < RE_NR_BACK_CGS; i++)
RE_back_cg_init(&plugin->back_cg[i]);
plugin->fog_type = RE_FOG_LINEAR;
plugin->fog_type = RE_FOG_NONE;
plugin->fog_near = 1.0;
plugin->fog_far = 10.0;
glm_vec3_one(plugin->fog_color);
return plugin;
}
+2
View File
@@ -806,6 +806,8 @@ void RE_render(struct sact_sprite *sp)
glUniform1f(r->shadow_bias, plugin->shadow_bias);
if (plugin->fog_mode) {
switch (plugin->fog_type) {
case RE_FOG_NONE:
break;
case RE_FOG_LINEAR:
glUniform1f(r->fog_near, plugin->fog_near);
glUniform1f(r->fog_far, plugin->fog_far);