Better vines and lighting

This commit is contained in:
Joshua Barretto 2021-07-20 23:25:49 +01:00
parent a5309e1036
commit 086097cd56
3 changed files with 5 additions and 5 deletions

View File

@ -272,7 +272,7 @@ void main() {
max_light *= f_light;
// TODO: Apply AO after this
vec3 glow = glow_light(f_pos) * (pow(f_glow, 6) * 5 + pow(f_glow, 1.5) * 2);
vec3 glow = glow_light(f_pos) * (pow(f_glow, 3) * 5 + pow(f_glow, 2.0) * 2);
reflected_light += glow;
max_light += lights_at(f_pos, f_norm, view_dir, mu, cam_attenuation, fluid_alt, k_a, k_d, k_s, alpha, f_norm, 1.0, emitted_light, reflected_light);

View File

@ -178,7 +178,7 @@ impl Block {
pub fn get_glow(&self) -> Option<u8> {
match self.kind() {
BlockKind::Lava => Some(24),
BlockKind::GlowingRock | BlockKind::GlowingWeakRock => Some(15),
BlockKind::GlowingRock | BlockKind::GlowingWeakRock => Some(10),
BlockKind::GlowingMushroom => Some(20),
_ => match self.get_sprite()? {
SpriteKind::StreetLamp | SpriteKind::StreetLampTall => Some(24),

View File

@ -822,7 +822,7 @@ pub fn apply_caverns_to<R: Rng>(canvas: &mut Canvas, dynamic_rng: &mut R) {
.magnitude_squared()
< 1.0f32
{
let kind = if dynamic_rng.gen_bool(0.01) {
let kind = if dynamic_rng.gen_bool(0.025) {
BlockKind::GlowingRock
} else {
BlockKind::Leaves
@ -830,9 +830,9 @@ pub fn apply_caverns_to<R: Rng>(canvas: &mut Canvas, dynamic_rng: &mut R) {
Some(Block::new(
kind,
Rgb::new(
0,
85,
(vine_y + vine_reach).mul(0.05).sin().mul(35.0).add(85.0) as u8,
90,
20,
),
))
} else {