1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Make volumetric light effect strength server controllable

- Make volumetric light effect strength server controllable
- Separate volumetric and bloom shader pipeline
- Require bloom to be enable, scale godrays with bloom
This commit is contained in:
Lars 2023-10-23 17:05:31 -07:00 committed by lhofhansl
parent 04f0d545da
commit e0d4a9d575
16 changed files with 227 additions and 144 deletions

View file

@ -2495,7 +2495,14 @@ int ObjectRef::l_set_lighting(lua_State *L)
lighting.exposure.center_weight_power = getfloatfield_default(L, -1, "center_weight_power", lighting.exposure.center_weight_power);
}
lua_pop(L, 1); // exposure
}
lua_getfield(L, 2, "volumetric_light");
if (lua_istable(L, -1)) {
getfloatfield(L, -1, "strength", lighting.volumetric_light_strength);
lighting.volumetric_light_strength = rangelim(lighting.volumetric_light_strength, 0.0f, 1.0f);
}
lua_pop(L, 1); // volumetric_light
}
getServer(L)->setLighting(player, lighting);
return 0;
@ -2533,6 +2540,10 @@ int ObjectRef::l_get_lighting(lua_State *L)
lua_pushnumber(L, lighting.exposure.center_weight_power);
lua_setfield(L, -2, "center_weight_power");
lua_setfield(L, -2, "exposure");
lua_newtable(L); // "volumetric_light"
lua_pushnumber(L, lighting.volumetric_light_strength);
lua_setfield(L, -2, "strength");
lua_setfield(L, -2, "volumetric_light");
return 1;
}