veloren/voxygen/src/hud/mod.rs

3894 lines
158 KiB
Rust
Raw Normal View History

mod bag;
mod buffs;
mod buttons;
mod chat;
2020-07-14 20:11:39 +00:00
mod crafting;
mod diary;
mod esc_menu;
mod group;
2020-04-11 06:33:06 +00:00
mod hotbar;
2021-03-16 12:19:31 +00:00
pub mod img_ids;
pub mod item_imgs;
mod loot_scroller;
mod map;
mod minimap;
mod overhead;
mod overitem;
2020-05-14 16:56:10 +00:00
mod popup;
mod prompt_dialog;
mod settings_window;
mod skillbar;
2020-04-06 15:25:45 +00:00
mod slots;
mod social;
mod trade;
2021-03-16 12:19:31 +00:00
pub mod util;
2021-04-17 18:35:48 +00:00
pub use crafting::CraftingTab;
pub use hotbar::{SlotContents as HotbarSlotContents, State as HotbarState};
pub use item_imgs::animate_by_pulse;
pub use loot_scroller::LootMessage;
2019-07-26 02:28:53 +00:00
pub use settings_window::ScaleChange;
use bag::Bag;
use buffs::BuffsBar;
use buttons::Buttons;
use chat::Chat;
2019-09-01 19:04:03 +00:00
use chrono::NaiveTime;
2021-04-17 14:58:43 +00:00
use crafting::Crafting;
use diary::{Diary, SelectedSkillTree};
use esc_menu::EscMenu;
use group::Group;
use img_ids::Imgs;
2019-10-09 19:28:05 +00:00
use item_imgs::ItemImgs;
use loot_scroller::LootScroller;
use map::Map;
use minimap::{MiniMap, VoxelMinimap};
2020-05-14 16:56:10 +00:00
use popup::Popup;
use prompt_dialog::PromptDialog;
2019-07-23 01:02:57 +00:00
use serde::{Deserialize, Serialize};
use settings_window::{SettingsTab, SettingsWindow};
use skillbar::Skillbar;
use social::Social;
use trade::Trade;
use crate::{
ecs::{comp as vcomp, comp::HpFloaterList},
hud::{img_ids::ImgsRot, prompt_dialog::DialogOutcomeEvent},
i18n::Localization,
2021-04-26 03:19:23 +00:00
render::UiDrawer,
2020-11-18 15:32:37 +00:00
scene::camera::{self, Camera},
session::{
2021-05-14 12:27:15 +00:00
settings_change::{Chat as ChatChange, Interface as InterfaceChange, SettingsChange},
Interactable,
},
2021-05-14 12:27:15 +00:00
settings::chat::ChatFilter,
ui::{
self, fonts::Fonts, img_ids::Rotations, slot, slot::SlotKey, Graphic, Ingameable,
ScaleMode, Ui,
},
window::{Event as WinEvent, GameInput},
GlobalState,
};
2020-06-02 02:42:26 +00:00
use client::Client;
2020-10-07 02:23:20 +00:00
use common::{
combat,
comp::{
self,
inventory::trade_pricing::TradePricing,
item::{tool::ToolKind, ItemDesc, MaterialStatManifest, Quality},
skills::{Skill, SkillGroupKind},
2021-04-25 23:06:47 +00:00
BuffData, BuffKind, Item,
},
2021-04-17 22:27:42 +00:00
consts::MAX_PICKUP_RANGE,
outcome::Outcome,
slowjob::SlowJobPool,
2021-04-17 18:35:48 +00:00
terrain::{SpriteKind, TerrainChunk},
trade::{ReducedInventory, TradeAction},
uid::Uid,
2020-11-20 14:01:04 +00:00
util::srgba_to_linear,
2020-10-07 02:23:20 +00:00
vol::RectRasterableVol,
};
2021-06-19 05:04:05 +00:00
use common_base::{prof_span, span};
use common_net::{
msg::{world_msg::SiteId, Notification, PresenceKind},
sync::WorldSyncExt,
};
use conrod_core::{
2019-07-05 16:21:11 +00:00
text::cursor::Index,
2020-06-03 17:59:09 +00:00
widget::{self, Button, Image, Text},
widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget,
};
use hashbrown::{HashMap, HashSet};
use rand::Rng;
use specs::{Entity as EcsEntity, Join, WorldExt};
use std::{
2021-04-25 23:06:47 +00:00
borrow::Cow,
2020-12-12 01:45:46 +00:00
collections::VecDeque,
sync::Arc,
time::{Duration, Instant},
};
use vek::*;
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
2021-05-01 16:26:13 +00:00
const TEXT_VELORITE: Color = Color::Rgba(0.0, 0.66, 0.66, 1.0);
const TEXT_BLUE_COLOR: Color = Color::Rgba(0.8, 0.9, 1.0, 1.0);
2020-07-14 20:11:39 +00:00
const TEXT_GRAY_COLOR: Color = Color::Rgba(0.5, 0.5, 0.5, 1.0);
const TEXT_DULL_RED_COLOR: Color = Color::Rgba(0.56, 0.2, 0.2, 1.0);
2020-03-26 21:22:21 +00:00
const TEXT_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
const TEXT_COLOR_GREY: Color = Color::Rgba(1.0, 1.0, 1.0, 0.5);
2019-10-04 18:27:12 +00:00
//const TEXT_COLOR_2: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
const TEXT_COLOR_3: Color = Color::Rgba(1.0, 1.0, 1.0, 0.1);
const TEXT_BIND_CONFLICT_COLOR: Color = Color::Rgba(1.0, 0.0, 0.0, 1.0);
2020-03-28 17:06:00 +00:00
const BLACK: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
//const BG_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 0.8);
const HP_COLOR: Color = Color::Rgba(0.33, 0.63, 0.0, 1.0);
const LOW_HP_COLOR: Color = Color::Rgba(0.93, 0.59, 0.03, 1.0);
const CRITICAL_HP_COLOR: Color = Color::Rgba(0.79, 0.19, 0.17, 1.0);
const STAMINA_COLOR: Color = Color::Rgba(0.29, 0.62, 0.75, 0.9);
const ENEMY_HP_COLOR: Color = Color::Rgba(0.93, 0.1, 0.29, 1.0);
const XP_COLOR: Color = Color::Rgba(0.59, 0.41, 0.67, 1.0);
//const TRANSPARENT: Color = Color::Rgba(0.0, 0.0, 0.0, 0.0);
//const FOCUS_COLOR: Color = Color::Rgba(1.0, 0.56, 0.04, 1.0);
//const RAGE_COLOR: Color = Color::Rgba(0.5, 0.04, 0.13, 1.0);
const BUFF_COLOR: Color = Color::Rgba(0.06, 0.69, 0.12, 1.0);
const DEBUFF_COLOR: Color = Color::Rgba(0.79, 0.19, 0.17, 1.0);
2020-10-07 02:23:20 +00:00
// Item Quality Colors
const QUALITY_LOW: Color = Color::Rgba(0.41, 0.41, 0.41, 1.0); // Grey - Trash, can be sold to vendors
const QUALITY_COMMON: Color = Color::Rgba(0.79, 1.00, 1.00, 1.0); // No Color - Crafting mats, food, starting equipment, quest items (like keys), rewards for easy quests
2020-10-07 02:23:20 +00:00
const QUALITY_MODERATE: Color = Color::Rgba(0.06, 0.69, 0.12, 1.0); // Green - Quest Rewards, commonly looted items from NPCs
const QUALITY_HIGH: Color = Color::Rgba(0.18, 0.32, 0.9, 1.0); // Blue - Dungeon rewards, boss loot, rewards for hard quests
const QUALITY_EPIC: Color = Color::Rgba(0.58, 0.29, 0.93, 1.0); // Purple - Rewards for epic quests and very hard bosses
const QUALITY_LEGENDARY: Color = Color::Rgba(0.92, 0.76, 0.0, 1.0); // Gold - Legendary items that require a big effort to acquire
const QUALITY_ARTIFACT: Color = Color::Rgba(0.74, 0.24, 0.11, 1.0); // Orange - Not obtainable by normal means, "artifacts"
const QUALITY_DEBUG: Color = Color::Rgba(0.79, 0.19, 0.17, 1.0); // Red - Admin and debug items
// Chat Colors
/// Color for chat command errors (yellow !)
const ERROR_COLOR: Color = Color::Rgba(1.0, 1.0, 0.0, 1.0);
/// Color for chat command info (blue i)
const INFO_COLOR: Color = Color::Rgba(0.28, 0.83, 0.71, 1.0);
/// Online color
const ONLINE_COLOR: Color = Color::Rgba(0.3, 1.0, 0.3, 1.0);
/// Offline color
const OFFLINE_COLOR: Color = Color::Rgba(1.0, 0.3, 0.3, 1.0);
2020-06-02 02:42:26 +00:00
/// Color for a private message from another player
2019-07-29 14:40:46 +00:00
const TELL_COLOR: Color = Color::Rgba(0.98, 0.71, 1.0, 1.0);
2020-06-02 02:42:26 +00:00
/// Color for local chat
const SAY_COLOR: Color = Color::Rgba(1.0, 0.8, 0.8, 1.0);
2020-06-02 02:42:26 +00:00
/// Color for group chat
2019-07-29 14:40:46 +00:00
const GROUP_COLOR: Color = Color::Rgba(0.47, 0.84, 1.0, 1.0);
2020-06-02 02:42:26 +00:00
/// Color for factional chat
2019-07-29 14:40:46 +00:00
const FACTION_COLOR: Color = Color::Rgba(0.24, 1.0, 0.48, 1.0);
2020-06-02 02:42:26 +00:00
/// Color for regional chat
const REGION_COLOR: Color = Color::Rgba(0.8, 1.0, 0.8, 1.0);
2020-10-07 02:23:20 +00:00
/// Color for death messagesw
2019-07-29 14:40:46 +00:00
const KILL_COLOR: Color = Color::Rgba(1.0, 0.17, 0.17, 1.0);
2020-06-02 02:42:26 +00:00
/// Color for global messages
const WORLD_COLOR: Color = Color::Rgba(0.95, 1.0, 0.95, 1.0);
2020-07-12 11:10:26 +00:00
//Nametags
const GROUP_MEMBER: Color = Color::Rgba(0.47, 0.84, 1.0, 1.0);
const DEFAULT_NPC: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
// UI Color-Theme
const UI_MAIN: Color = Color::Rgba(0.61, 0.70, 0.70, 1.0); // Greenish Blue
//const UI_MAIN: Color = Color::Rgba(0.1, 0.1, 0.1, 0.97); // Dark
const UI_HIGHLIGHT_0: Color = Color::Rgba(0.79, 1.09, 1.09, 1.0);
// Pull-Down menu BG color
const MENU_BG: Color = Color::Rgba(0.1, 0.12, 0.12, 1.0);
//const UI_DARK_0: Color = Color::Rgba(0.25, 0.37, 0.37, 1.0);
2020-07-12 03:12:03 +00:00
/// Distance at which nametags are visible for group members
2020-08-25 19:54:47 +00:00
const NAMETAG_GROUP_RANGE: f32 = 1000.0;
/// Distance at which nametags are visible for merchants
const NAMETAG_MERCHANT_RANGE: f32 = 50.0;
/// Distance at which nametags are visible
const NAMETAG_RANGE: f32 = 40.0;
/// Time nametags stay visible after doing damage even if they are out of range
/// in seconds
const NAMETAG_DMG_TIME: f32 = 60.0;
/// Range damaged triggered nametags can be seen
const NAMETAG_DMG_RANGE: f32 = 120.0;
/// Range to display speech-bubbles at
const SPEECH_BUBBLE_RANGE: f32 = NAMETAG_RANGE;
widget_ids! {
struct Ids {
2019-07-02 19:54:38 +00:00
// Crosshair
2019-07-06 23:04:30 +00:00
crosshair_inner,
crosshair_outer,
2019-07-02 19:54:38 +00:00
2020-01-10 00:33:38 +00:00
// SCT
player_scts[],
player_sct_bgs[],
player_rank_up,
player_rank_up_txt_number,
player_rank_up_txt_0,
player_rank_up_txt_0_bg,
player_rank_up_txt_1,
player_rank_up_txt_1_bg,
player_rank_up_icon,
2020-01-10 00:33:38 +00:00
sct_exp_bgs[],
sct_exps[],
sct_exp_icons[],
2020-01-10 00:33:38 +00:00
sct_lvl_bg,
sct_lvl,
hurt_bg,
death_bg,
sct_bgs[],
scts[],
overheads[],
overitems[],
2020-06-24 13:44:39 +00:00
// Alpha Disclaimer
alpha_text,
2019-06-23 19:49:15 +00:00
// Debug
debug_bg,
fps_counter,
ping,
coordinates,
2019-08-06 21:51:13 +00:00
velocity,
2020-04-25 00:30:20 +00:00
orientation,
2019-06-23 19:49:15 +00:00
loaded_distance,
2019-09-01 19:04:03 +00:00
time,
2019-11-29 06:04:37 +00:00
entity_count,
num_chunks,
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
num_lights,
num_figures,
2020-07-21 15:48:20 +00:00
num_particles,
graphics_backend,
gpu_timings[],
// Game Version
version,
// Help
help,
2019-10-06 19:19:08 +00:00
help_info,
2020-01-10 00:33:38 +00:00
debug_info,
lantern_info,
// Window Frames
window_frame_0,
window_frame_1,
window_frame_2,
window_frame_3,
window_frame_4,
window_frame_5,
button_help2,
button_help3,
// External
chat,
loot_scroller,
map,
world_map,
character_window,
2020-05-14 16:56:10 +00:00
popup,
minimap,
prompt_dialog,
bag,
trade,
social,
quest,
diary,
skillbar,
buttons,
buffs,
esc_menu,
small_window,
social_window,
2020-07-14 20:11:39 +00:00
crafting_window,
settings_window,
group_window,
2021-03-02 00:45:02 +00:00
item_info,
2020-03-26 21:22:21 +00:00
// Free look indicator
free_look_txt,
free_look_bg,
2020-06-03 17:59:09 +00:00
// Auto walk indicator
auto_walk_txt,
auto_walk_bg,
2021-03-23 22:41:13 +00:00
// Camera clamp indicator
camera_clamp_txt,
camera_clamp_bg,
// Tutorial
2020-06-03 17:59:09 +00:00
quest_bg,
q_headline_bg,
q_headline,
q_text_bg,
q_text,
accept_button,
intro_button,
tut_arrow,
tut_arrow_txt_bg,
tut_arrow_txt,
}
}
#[derive(Clone, Copy)]
pub struct BuffInfo {
kind: comp::BuffKind,
data: comp::BuffData,
is_buff: bool,
dur: Option<Duration>,
}
pub struct ExpFloater {
pub owner: Uid,
pub exp_change: i32,
pub timer: f32,
pub rand_offset: (f32, f32),
pub xp_pools: HashSet<SkillGroupKind>,
}
pub struct SkillPointGain {
pub owner: Uid,
pub skill_tree: SkillGroupKind,
pub total_points: u16,
pub timer: f32,
}
2021-03-04 20:43:58 +00:00
#[derive(Debug, Clone, Copy)]
pub struct ComboFloater {
pub owner: Uid,
pub combo: u32,
pub timer: f64,
}
pub struct BlockFloater {
pub owner: Uid,
pub timer: f32,
}
pub struct DebugInfo {
pub tps: f64,
pub frame_time: Duration,
pub ping_ms: f64,
pub coordinates: Option<comp::Pos>,
2019-08-06 21:51:13 +00:00
pub velocity: Option<comp::Vel>,
2020-04-25 00:30:20 +00:00
pub ori: Option<comp::Ori>,
pub num_chunks: u32,
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
pub num_lights: u32,
pub num_visible_chunks: u32,
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
pub num_shadow_chunks: u32,
pub num_figures: u32,
pub num_figures_visible: u32,
2020-07-21 15:48:20 +00:00
pub num_particles: u32,
pub num_particles_visible: u32,
}
2019-07-27 19:26:31 +00:00
2020-05-18 22:40:28 +00:00
pub struct HudInfo {
pub is_aiming: bool,
pub is_first_person: bool,
2020-04-24 08:02:47 +00:00
pub target_entity: Option<specs::Entity>,
pub selected_entity: Option<(specs::Entity, std::time::Instant)>,
2020-05-18 22:40:28 +00:00
}
#[derive(Clone)]
pub enum Event {
SendMessage(String),
SendCommand(String, Vec<String>),
CharacterSelection,
UseSlot {
slot: comp::slot::Slot,
bypass_dialog: bool,
},
2021-05-17 00:43:19 +00:00
SwapEquippedWeapons,
SwapSlots {
slot_a: comp::slot::Slot,
slot_b: comp::slot::Slot,
bypass_dialog: bool,
},
2021-03-02 00:08:46 +00:00
SplitSwapSlots {
slot_a: comp::slot::Slot,
slot_b: comp::slot::Slot,
bypass_dialog: bool,
},
DropSlot(comp::slot::Slot),
2021-03-02 00:08:46 +00:00
SplitDropSlot(comp::slot::Slot),
2021-04-17 16:24:33 +00:00
SortInventory,
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
ChangeHotbarState(Box<HotbarState>),
TradeAction(TradeAction),
2020-04-11 06:33:06 +00:00
Ability3(bool),
Ability4(bool),
Logout,
Quit,
2021-04-17 18:35:48 +00:00
CraftRecipe {
recipe: String,
craft_sprite: Option<(Vec3<i32>, SpriteKind)>,
},
InviteMember(Uid),
AcceptInvite,
2020-07-19 21:49:18 +00:00
DeclineInvite,
KickMember(Uid),
LeaveGroup,
AssignLeader(Uid),
RemoveBuff(BuffKind),
UnlockSkill(Skill),
Implement /price_list (work in progress), stub for /buy and /sell remove outdated economic simulation code remove old values, document add natural resources to economy Remove NaturalResources from Place (now in Economy) find closest site to each chunk implement natural resources (the distance scale is wrong) cargo fmt working distance calculation this collection of natural resources seem to make sense, too much Wheat though use natural resources and controlled area to replenish goods increase the amount of chunks controlled by one guard to 50 add new professions and goods to the list implement multiple products per worker remove the old code and rename the new code to the previous name correctly determine which goods guards will give you access to correctly estimate the amount of natural resources controlled adapt to new server API instrument tooltips Now I just need to figure out how to store a (reference to) a closure closures for tooltip content generation pass site/cave id to the client Add economic information to the client structure (not yet exchanged with the server) Send SiteId to the client, prepare messages for economy request Make client::sites a HashMap Specialize the Crafter into Brewer,Bladesmith and Blacksmith working server request for economic info from within tooltip fully operational economic tooltips I need to fix the id clash between caves and towns though fix overlapping ids between caves and sites display stock amount correctly handle invalid (cave) ids in the request some initial balancing, turn off most info logging less intrusive way of implementing the dynamic tool tips in map further tooltip cleanup further cleanup, dynamic tooltip not fully working as intended correctly working tooltip visibility logic cleanup, display labor value separate economy info request in a separate translation unit display values as well nicer display format for economy add last_exports and coin to the new economy do not allocate natural resources to Dungeons (making town so much larger) balancing attempt print town size statistics cargo fmt (dead code) resource tweaks, csv debugging output a more interesting town (and then all sites) fix the labor value logic (now we have meaningful prices) load professions from ron (WIP) use assets manager in economy loading professions works use professions from ron file fix Labor debug logic count chunks per type separately (preparing for better resource control) better structured resource data traders, more professions (WIP) fix exception when starting the simulation fix replenish function TODO: - use area_ratio for resource usage (chunks should be added to stock, ratio on usage?) - fix trading documentation clean up fix merge artifact Revise trader mechanic start Coin with a reasonable default remove the outdated economy code preserve documentation from removed old structure output neighboring sites (preparation) pass list of neighbors to economy add trade structures trading stub Description of purpose by zesterer on Discord remember prices (needed for planning) avoid growing the order vector unboundedly into_iter doesn't clear the Vec, so clear it manually use drain to process Vecs, avoid clone fix the test server implement a test stub (I need to get it faster than 30 seconds to be more useful) enable info output in test debug missing and extra goods use the same logging extension as water, activate feature update dependencies determine good prices, good exchange goods a working set of revisions a cozy world which economy tests in 2s first order planning version fun with package version buy according to value/priority, not missing amount introduce min price constant, fix order priority in depth debugging with a correct sign the trading plans start to make sense move the trade planning to a separate function rename new function reorganize code into subroutines (much cleaner) each trading step now has its own function cut down the number of debugging output introduce RoadSecurity and Transportation transport capacity bookkeeping only plan to pay with valuable goods, you can no longer stockpile unused options (which interestingly shows a huge impact, to be investigated) Coin is now listed as a payment (although not used) proper transportation estimation (although 0) remove more left overs uncovered by viewing the code in a merge request use the old default values, handle non-pileable stocks directly before increasing it (as economy is based on last year's products) don't order the missing good multiple times also it uses coin to buy things! fix warnings and use the transportation from stock again cargo fmt prepare evaluation of trade don't count transportation multiple times fix merge artifact operational trade planning trade itself is still misleading make clippy happy clean up correct labor ratio of merchants (no need to multiply with amount produced) incomplete merchant labor_value computation correct last commit make economy of scale more explicit make clippy happy (and code cleaner) more merchant tweaks (more pop=better) beginning of real trading code revert the update of dependencies remove stale comments/unused code trading implementation complete (but untested) something is still strange ... fix sign in trading another sign fix some bugfixes and plenty of debugging code another bug fixed, more to go fix another invariant (rounding will lead to very small negative value) introduce Terrain and Territory fix merge mistakes
2021-03-14 03:18:32 +00:00
RequestSiteInfo(SiteId),
SettingsChange(SettingsChange),
}
// TODO: Are these the possible layouts we want?
// TODO: Maybe replace this with bitflags.
// `map` is not here because it currently is displayed over the top of other
// open windows.
#[derive(PartialEq)]
pub enum Windows {
Settings, // Display settings window.
None,
}
2019-07-23 01:02:57 +00:00
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum CrosshairType {
RoundEdges,
Edges,
#[serde(other)]
Round,
2019-07-23 01:02:57 +00:00
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum Intro {
Never,
#[serde(other)]
Show,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum XpBar {
OnGain,
#[serde(other)]
Always,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum BarNumbers {
Percent,
Off,
#[serde(other)]
Values,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum ShortcutNumbers {
Off,
#[serde(other)]
On,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum BuffPosition {
Map,
#[serde(other)]
Bar,
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum PressBehavior {
Hold = 1,
#[serde(other)]
Toggle = 0,
}
2021-05-14 12:27:15 +00:00
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct ChatTab {
pub label: String,
pub filter: ChatFilter,
}
impl Default for ChatTab {
fn default() -> Self {
Self {
label: String::from("Chat"),
filter: ChatFilter::default(),
}
}
}
2019-07-23 01:02:57 +00:00
impl PressBehavior {
pub fn update(&self, keystate: bool, setting: &mut bool, f: impl FnOnce(bool)) {
match (self, keystate) {
// flip the state on key press in toggle mode
(PressBehavior::Toggle, true) => {
*setting ^= true;
f(*setting);
},
// do nothing on key release in toggle mode
(PressBehavior::Toggle, false) => {},
// set the setting to the key state in hold mode
(PressBehavior::Hold, state) => {
*setting = state;
f(*setting);
},
}
}
}
pub struct Show {
ui: bool,
intro: bool,
help: bool,
2020-07-14 20:11:39 +00:00
crafting: bool,
debug: bool,
bag: bool,
bag_inv: bool,
trade: bool,
social: bool,
diary: bool,
group: bool,
group_menu: bool,
esc_menu: bool,
open_windows: Windows,
map: bool,
ingame: bool,
2021-05-14 12:27:15 +00:00
chat_tab_settings_index: Option<usize>,
settings_tab: SettingsTab,
skilltreetab: SelectedSkillTree,
crafting_tab: CraftingTab,
crafting_search_key: Option<String>,
2021-04-17 14:58:43 +00:00
craft_sprite: Option<(Vec3<i32>, SpriteKind)>,
social_search_key: Option<String>,
want_grab: bool,
stats: bool,
2020-03-26 21:22:21 +00:00
free_look: bool,
2020-11-20 14:01:04 +00:00
auto_walk: bool,
camera_clamp: bool,
prompt_dialog: Option<PromptDialogSettings>,
2021-05-01 16:26:13 +00:00
location_marker: Option<Vec2<f32>>,
map_marker: bool,
}
impl Show {
fn bag(&mut self, open: bool) {
2020-07-14 20:11:39 +00:00
if !self.esc_menu {
self.bag = open;
self.map = false;
self.want_grab = !open;
if !open {
self.crafting = false;
}
2020-07-14 20:11:39 +00:00
}
}
fn trade(&mut self, open: bool) {
if !self.esc_menu {
self.bag = open;
self.trade = open;
self.map = false;
self.want_grab = !open;
}
}
fn map(&mut self, open: bool) {
2020-11-17 20:45:44 +00:00
if !self.esc_menu {
2020-07-14 20:11:39 +00:00
self.map = open;
self.bag = false;
self.crafting = false;
self.social = false;
self.diary = false;
2020-07-14 20:11:39 +00:00
self.want_grab = !open;
}
}
fn social(&mut self, open: bool) {
2020-07-14 20:11:39 +00:00
if !self.esc_menu {
if !self.social && open {
// rising edge detector
self.search_social_players(None);
}
2020-07-14 20:11:39 +00:00
self.social = open;
self.diary = false;
2020-07-14 20:11:39 +00:00
self.want_grab = !open;
}
}
fn crafting(&mut self, open: bool) {
if !self.esc_menu {
if !self.crafting && open {
// rising edge detector
self.search_crafting_recipe(None);
}
2020-07-14 20:11:39 +00:00
self.crafting = open;
self.bag = open;
self.map = false;
2020-07-14 20:11:39 +00:00
self.want_grab = !open;
}
}
2021-04-17 18:35:48 +00:00
pub fn open_crafting_tab(
&mut self,
tab: CraftingTab,
craft_sprite: Option<(Vec3<i32>, SpriteKind)>,
) {
2021-04-17 14:58:43 +00:00
self.selected_crafting_tab(tab);
self.crafting(true);
self.craft_sprite = self.craft_sprite.or(craft_sprite);
2021-04-17 14:58:43 +00:00
}
fn diary(&mut self, open: bool) {
2020-07-14 20:11:39 +00:00
if !self.esc_menu {
self.social = false;
self.crafting = false;
self.bag = false;
self.map = false;
self.diary = open;
2020-07-14 20:11:39 +00:00
self.want_grab = !open;
}
}
fn settings(&mut self, open: bool) {
2020-07-14 20:11:39 +00:00
if !self.esc_menu {
self.open_windows = if open {
Windows::Settings
} else {
Windows::None
};
self.bag = false;
self.social = false;
self.crafting = false;
self.diary = false;
2020-07-14 20:11:39 +00:00
self.want_grab = !open;
}
}
fn toggle_bag(&mut self) { self.bag(!self.bag); }
fn toggle_trade(&mut self) { self.trade(!self.trade); }
fn toggle_map(&mut self) { self.map(!self.map) }
fn toggle_social(&mut self) { self.social(!self.social); }
fn toggle_crafting(&mut self) { self.crafting(!self.crafting) }
fn toggle_spell(&mut self) { self.diary(!self.diary) }
fn toggle_ui(&mut self) { self.ui = !self.ui; }
fn toggle_settings(&mut self, global_state: &GlobalState) {
match self.open_windows {
Windows::Settings => {
#[cfg(feature = "singleplayer")]
global_state.unpause();
self.settings(false);
},
_ => {
#[cfg(feature = "singleplayer")]
global_state.pause();
self.settings(true)
},
};
2021-03-28 23:40:53 +00:00
#[cfg(not(feature = "singleplayer"))]
let _global_state = global_state;
}
// TODO: Add self updating key-bindings element
//fn toggle_help(&mut self) { self.help = !self.help }
fn toggle_windows(&mut self, global_state: &mut GlobalState) {
if self.bag
|| self.trade
|| self.esc_menu
|| self.map
|| self.social
2020-07-14 20:11:39 +00:00
|| self.crafting
|| self.diary
2020-04-04 21:51:06 +00:00
|| self.help
|| self.intro
2020-08-17 09:08:11 +00:00
|| !matches!(self.open_windows, Windows::None)
{
self.bag = false;
self.trade = false;
self.esc_menu = false;
2020-04-04 21:51:06 +00:00
self.help = false;
self.intro = false;
self.map = false;
self.social = false;
self.diary = false;
2020-07-14 20:11:39 +00:00
self.crafting = false;
self.open_windows = Windows::None;
self.want_grab = true;
// Unpause the game if we are on singleplayer
#[cfg(feature = "singleplayer")]
global_state.unpause();
} else {
self.esc_menu = true;
self.want_grab = false;
// Pause the game if we are on singleplayer
#[cfg(feature = "singleplayer")]
global_state.pause();
}
2021-03-28 23:40:53 +00:00
#[cfg(not(feature = "singleplayer"))]
let _global_state = global_state;
}
fn open_setting_tab(&mut self, tab: SettingsTab) {
self.open_windows = Windows::Settings;
self.esc_menu = false;
self.settings_tab = tab;
self.bag = false;
self.want_grab = false;
}
fn open_skill_tree(&mut self, tree_sel: SelectedSkillTree) {
self.skilltreetab = tree_sel;
self.social = false;
}
2021-04-04 13:02:27 +00:00
fn selected_crafting_tab(&mut self, sel_cat: CraftingTab) { self.crafting_tab = sel_cat; }
fn search_crafting_recipe(&mut self, search_key: Option<String>) {
self.crafting_search_key = search_key;
}
fn search_social_players(&mut self, search_key: Option<String>) {
self.social_search_key = search_key;
2021-04-04 13:02:27 +00:00
}
/// If all of the menus are closed, adjusts coordinates of cursor to center
/// of screen
fn toggle_cursor_on_menu_close(&self, global_state: &mut GlobalState, ui: &mut Ui) {
if !self.bag
&& !self.trade
&& !self.esc_menu
&& !self.map
&& !self.social
&& !self.crafting
&& !self.diary
&& !self.help
&& !self.intro
&& global_state.window.is_cursor_grabbed()
{
ui.handle_event(ui::Event(
conrod_core::input::Motion::MouseCursor { x: 0.0, y: 0.0 }.into(),
));
global_state.window.center_cursor();
}
}
}
pub struct PromptDialogSettings {
message: String,
affirmative_event: Event,
negative_event: Option<Event>,
outcome_via_keypress: Option<bool>,
}
impl PromptDialogSettings {
pub fn new(message: String, affirmative_event: Event, negative_event: Option<Event>) -> Self {
Self {
message,
affirmative_event,
negative_event,
outcome_via_keypress: None,
}
}
pub fn set_outcome_via_keypress(&mut self, outcome: bool) {
self.outcome_via_keypress = Some(outcome);
}
}
pub struct Floaters {
pub exp_floaters: Vec<ExpFloater>,
pub skill_point_displays: Vec<SkillPointGain>,
pub combo_floaters: VecDeque<ComboFloater>,
pub block_floaters: Vec<BlockFloater>,
}
2019-09-25 20:18:40 +00:00
pub struct Hud {
ui: Ui,
ids: Ids,
2021-04-06 05:15:42 +00:00
world_map: (/* Id */ Vec<Rotations>, Vec2<u32>),
imgs: Imgs,
2019-10-09 19:28:05 +00:00
item_imgs: ItemImgs,
fonts: Fonts,
2019-09-25 16:51:47 +00:00
rot_imgs: ImgsRot,
failed_block_pickups: HashMap<Vec3<i32>, f32>,
failed_entity_pickups: HashMap<EcsEntity, f32>,
new_loot_messages: VecDeque<LootMessage>,
2020-06-02 02:42:26 +00:00
new_messages: VecDeque<comp::ChatMsg>,
new_notifications: VecDeque<Notification>,
speech_bubbles: HashMap<Uid, comp::SpeechBubble>,
2021-04-17 14:58:43 +00:00
pub show: Show,
2020-06-03 17:59:09 +00:00
//never_show: bool,
//intro: bool,
//intro_2: bool,
to_focus: Option<Option<widget::Id>>,
2019-07-26 21:05:39 +00:00
force_ungrab: bool,
2019-07-05 16:21:11 +00:00
force_chat_input: Option<String>,
force_chat_cursor: Option<Index>,
2020-05-08 21:38:58 +00:00
tab_complete: Option<String>,
2020-11-17 20:45:44 +00:00
pulse: f32,
2020-04-06 15:25:45 +00:00
slot_manager: slots::SlotManager,
2020-04-11 06:33:06 +00:00
hotbar: hotbar::State,
events: Vec<Event>,
2020-05-18 22:40:28 +00:00
crosshair_opacity: f32,
floaters: Floaters,
voxel_minimap: VoxelMinimap,
}
2019-09-25 20:18:40 +00:00
impl Hud {
pub fn new(global_state: &mut GlobalState, client: &Client) -> Self {
2019-07-26 02:28:53 +00:00
let window = &mut global_state.window;
let settings = &global_state.settings;
let mut ui = Ui::new(window).unwrap();
ui.set_scaling_mode(settings.interface.ui_scale);
// Generate ids.
let ids = Ids::new(ui.id_generator());
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
// NOTE: Use a border the same color as the LOD ocean color (but with a
// translucent alpha since UI have transparency and LOD doesn't).
2020-11-25 16:53:48 +00:00
let water_color = srgba_to_linear(Rgba::new(0.0, 0.18, 0.37, 1.0));
// Load world map
2021-04-03 23:27:51 +00:00
let mut layers = Vec::new();
for layer in client.world_data().map_layers() {
2021-04-06 05:15:42 +00:00
layers.push(
ui.add_graphic_with_rotations(Graphic::Image(Arc::clone(layer), Some(water_color))),
);
2021-04-03 23:27:51 +00:00
}
2021-04-06 05:15:42 +00:00
let world_map = (layers, client.world_data().chunk_size().map(|e| e as u32));
// Load images.
let imgs = Imgs::load(&mut ui).expect("Failed to load images!");
2019-09-25 20:18:40 +00:00
// Load rotation images.
let rot_imgs = ImgsRot::load(&mut ui).expect("Failed to load rot images!");
2019-10-09 19:28:05 +00:00
// Load item images.
let item_imgs = ItemImgs::new(&mut ui, imgs.not_found);
// Load fonts.
let fonts = Fonts::load(global_state.i18n.read().fonts(), &mut ui)
2020-12-13 01:09:57 +00:00
.expect("Impossible to load fonts!");
// Get the server name.
let server = &client.server_info().name;
// Get the id, unwrap is safe because this CANNOT be None at this
// point.
let character_id = match client.presence().unwrap() {
PresenceKind::Character(id) => id,
PresenceKind::Spectator => unreachable!("HUD creation in Spectator mode!"),
};
// Create a new HotbarState from the persisted slots.
let hotbar_state =
HotbarState::new(global_state.profile.get_hotbar_slots(server, character_id));
2021-03-02 00:08:46 +00:00
let slot_manager = slots::SlotManager::new(
ui.id_generator(),
Vec2::broadcast(40.0)
// TODO(heyzoos) Will be useful for whoever works on rendering the number of items "in hand".
// fonts.cyri.conrod_id,
// Vec2::new(1.0, 1.0),
// fonts.cyri.scale(12),
// TEXT_COLOR,
);
2020-04-06 06:15:22 +00:00
Self {
voxel_minimap: VoxelMinimap::new(&mut ui),
ui,
imgs,
2021-04-06 05:15:42 +00:00
world_map,
2019-09-25 16:51:47 +00:00
rot_imgs,
2019-10-09 19:28:05 +00:00
item_imgs,
fonts,
2019-07-26 21:05:39 +00:00
ids,
failed_block_pickups: HashMap::default(),
failed_entity_pickups: HashMap::default(),
new_loot_messages: VecDeque::new(),
new_messages: VecDeque::new(),
new_notifications: VecDeque::new(),
speech_bubbles: HashMap::new(),
2020-06-03 17:59:09 +00:00
//intro: false,
//intro_2: false,
show: Show {
help: false,
intro: false,
2020-01-10 00:33:38 +00:00
debug: false,
bag: false,
bag_inv: false,
trade: false,
esc_menu: false,
open_windows: Windows::None,
map: false,
2020-07-14 20:11:39 +00:00
crafting: false,
ui: true,
social: false,
diary: false,
group: false,
group_menu: false,
2021-05-14 12:27:15 +00:00
chat_tab_settings_index: None,
settings_tab: SettingsTab::Interface,
skilltreetab: SelectedSkillTree::General,
crafting_tab: CraftingTab::All,
crafting_search_key: None,
2021-04-17 14:58:43 +00:00
craft_sprite: None,
social_search_key: None,
want_grab: true,
ingame: true,
stats: false,
2020-03-26 21:22:21 +00:00
free_look: false,
2020-11-20 14:01:04 +00:00
auto_walk: false,
camera_clamp: false,
prompt_dialog: None,
2021-05-01 16:26:13 +00:00
location_marker: None,
map_marker: false,
},
to_focus: None,
2020-06-03 17:59:09 +00:00
//never_show: false,
force_ungrab: false,
2019-07-05 16:21:11 +00:00
force_chat_input: None,
force_chat_cursor: None,
2020-05-08 21:38:58 +00:00
tab_complete: None,
2020-11-17 20:45:44 +00:00
pulse: 0.0,
2020-04-06 06:15:22 +00:00
slot_manager,
hotbar: hotbar_state,
2020-04-11 06:33:06 +00:00
events: Vec::new(),
2020-05-18 22:40:28 +00:00
crosshair_opacity: 0.0,
floaters: Floaters {
exp_floaters: Vec::new(),
skill_point_displays: Vec::new(),
combo_floaters: VecDeque::new(),
block_floaters: Vec::new(),
},
}
}
pub fn set_prompt_dialog(&mut self, prompt_dialog: PromptDialogSettings) {
self.show.prompt_dialog = Some(prompt_dialog);
}
2020-12-12 22:14:24 +00:00
pub fn update_fonts(&mut self, i18n: &Localization) {
self.fonts = Fonts::load(i18n.fonts(), &mut self.ui).expect("Impossible to load fonts!");
}
#[allow(clippy::assign_op_pattern)] // TODO: Pending review in #587
#[allow(clippy::single_match)] // TODO: Pending review in #587
fn update_layout(
&mut self,
client: &Client,
global_state: &GlobalState,
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
debug_info: &Option<DebugInfo>,
dt: Duration,
2020-05-18 22:40:28 +00:00
info: HudInfo,
2020-07-10 14:00:20 +00:00
camera: &Camera,
interactable: Option<Interactable>,
) -> Vec<Event> {
span!(_guard, "update_layout", "Hud::update_layout");
let mut events = core::mem::take(&mut self.events);
if global_state.settings.interface.map_show_voxel_map {
self.voxel_minimap.maintain(&client, &mut self.ui);
}
2021-03-16 12:19:31 +00:00
let (ref mut ui_widgets, ref mut item_tooltip_manager, ref mut tooltip_manager) =
&mut self.ui.set_widgets();
// self.ui.set_item_widgets(); pulse time for pulsating elements
self.pulse = self.pulse + dt.as_secs_f32();
// FPS
let fps = global_state.clock.stats().average_tps;
let version = common::util::DISPLAY_VERSION_LONG.clone();
let i18n = &global_state.i18n.read();
let key_layout = &global_state.window.key_layout;
2019-07-02 19:54:38 +00:00
2020-01-10 00:33:38 +00:00
if self.show.ingame {
2021-06-19 05:04:05 +00:00
prof_span!("ingame elements");
let ecs = client.state().ecs();
let pos = ecs.read_storage::<comp::Pos>();
let stats = ecs.read_storage::<comp::Stats>();
let skill_sets = ecs.read_storage::<comp::SkillSet>();
let healths = ecs.read_storage::<comp::Health>();
let buffs = ecs.read_storage::<comp::Buffs>();
let energy = ecs.read_storage::<comp::Energy>();
2020-01-10 00:33:38 +00:00
let hp_floater_lists = ecs.read_storage::<vcomp::HpFloaterList>();
let uids = ecs.read_storage::<Uid>();
2020-01-10 00:33:38 +00:00
let interpolated = ecs.read_storage::<vcomp::Interpolated>();
let scales = ecs.read_storage::<comp::Scale>();
let bodies = ecs.read_storage::<comp::Body>();
let items = ecs.read_storage::<comp::Item>();
let inventories = ecs.read_storage::<comp::Inventory>();
let players = ecs.read_storage::<comp::Player>();
let msm = ecs.read_resource::<MaterialStatManifest>();
2021-03-04 20:43:58 +00:00
let entities = ecs.entities();
let me = client.entity();
if (client.pending_trade().is_some() && !self.show.trade)
|| (client.pending_trade().is_none() && self.show.trade)
{
self.show.toggle_trade();
}
2020-01-18 01:10:12 +00:00
//self.input = client.read_storage::<comp::ControllerInputs>();
if let Some(health) = healths.get(me) {
2020-01-10 00:33:38 +00:00
// Hurt Frame
let hp_percentage = health.current() as f32 / health.maximum() as f32 * 100.0;
if hp_percentage < 10.0 && !health.is_dead {
2020-01-10 00:33:38 +00:00
let hurt_fade =
(self.pulse * (10.0 - hp_percentage as f32) * 0.1/* speed factor */).sin()
2020-01-10 00:33:38 +00:00
* 0.5
+ 0.6; //Animation timer
Image::new(self.imgs.hurt_bg)
.wh_of(ui_widgets.window)
.middle_of(ui_widgets.window)
.graphics_for(ui_widgets.window)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, hurt_fade)))
.set(self.ids.hurt_bg, ui_widgets);
}
2020-06-24 13:44:39 +00:00
// Alpha Disclaimer
Text::new(&format!("Veloren {}", &version))
2020-06-24 13:44:39 +00:00
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(10))
.color(TEXT_COLOR)
.mid_top_with_margin_on(ui_widgets.window, 2.0)
.set(self.ids.alpha_text, ui_widgets);
2020-01-10 00:33:38 +00:00
// Death Frame
if health.is_dead {
2020-01-10 00:33:38 +00:00
Image::new(self.imgs.death_bg)
.wh_of(ui_widgets.window)
.middle_of(ui_widgets.window)
.graphics_for(ui_widgets.window)
.color(Some(Color::Rgba(0.0, 0.0, 0.0, 1.0)))
.set(self.ids.death_bg, ui_widgets);
} // Crosshair
let show_crosshair = (info.is_aiming || info.is_first_person) && !health.is_dead;
2020-05-18 23:35:58 +00:00
self.crosshair_opacity = Lerp::lerp(
self.crosshair_opacity,
if show_crosshair { 1.0 } else { 0.0 },
5.0 * dt.as_secs_f32(),
);
2020-05-18 22:40:28 +00:00
if !self.show.help {
2020-01-10 00:33:38 +00:00
Image::new(
// TODO: Do we want to match on this every frame?
match global_state.settings.interface.crosshair_type {
2020-01-10 00:33:38 +00:00
CrosshairType::Round => self.imgs.crosshair_outer_round,
CrosshairType::RoundEdges => self.imgs.crosshair_outer_round_edges,
CrosshairType::Edges => self.imgs.crosshair_outer_edges,
},
)
.w_h(21.0 * 1.5, 21.0 * 1.5)
.middle_of(ui_widgets.window)
.color(Some(Color::Rgba(
1.0,
1.0,
1.0,
self.crosshair_opacity * global_state.settings.interface.crosshair_transp,
2020-01-10 00:33:38 +00:00
)))
.set(self.ids.crosshair_outer, ui_widgets);
Image::new(self.imgs.crosshair_inner)
.w_h(21.0 * 2.0, 21.0 * 2.0)
.middle_of(self.ids.crosshair_outer)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.6)))
.set(self.ids.crosshair_inner, ui_widgets);
}
}
// Max amount the sct font size increases when "flashing"
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
const FLASH_MAX: u32 = 2;
// Get player position.
let player_pos = client
.state()
.ecs()
.read_storage::<comp::Pos>()
.get(client.entity())
.map_or(Vec3::zero(), |pos| pos.0);
// SCT Output values are called hp_damage and floater.hp_change
// Numbers are currently divided by 10 and rounded
if global_state.settings.interface.sct {
2020-01-10 00:33:38 +00:00
// Render Player SCT numbers
let mut player_sct_bg_id_walker = self.ids.player_sct_bgs.walk();
let mut player_sct_id_walker = self.ids.player_scts.walk();
if let (Some(HpFloaterList { floaters, .. }), Some(health)) = (
2020-01-10 00:33:38 +00:00
hp_floater_lists
.get(me)
.filter(|fl| !fl.floaters.is_empty()),
healths.get(me),
2020-01-10 00:33:38 +00:00
) {
if global_state.settings.interface.sct_player_batch {
2020-01-10 00:33:38 +00:00
let number_speed = 100.0; // Player Batched Numbers Speed
let player_sct_bg_id = player_sct_bg_id_walker.next(
&mut self.ids.player_sct_bgs,
&mut ui_widgets.widget_id_generator(),
);
let player_sct_id = player_sct_id_walker.next(
&mut self.ids.player_scts,
&mut ui_widgets.widget_id_generator(),
);
// Calculate total change
// Ignores healing
let hp_damage = floaters.iter().fold(0, |acc, f| f.hp_change.min(0) + acc);
// Divide by 10 to stay in the same dimension as the HP display
let hp_dmg_rounded_abs = ((hp_damage + 5) / 10).abs();
let max_hp_frac = hp_damage.abs() as f32 / health.maximum() as f32;
2020-01-10 00:33:38 +00:00
let timer = floaters
.last()
.expect("There must be at least one floater")
.timer;
// Increase font size based on fraction of maximum health
// "flashes" by having a larger size in the first 100ms
let font_size = 30
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
+ ((max_hp_frac * 10.0) as u32) * 3
2020-01-10 00:33:38 +00:00
+ if timer < 0.1 {
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
FLASH_MAX * (((1.0 - timer / 0.1) * 10.0) as u32)
2020-01-10 00:33:38 +00:00
} else {
0
};
// Timer sets the widget offset
let y = timer as f64 * number_speed * -1.0;
// Timer sets text transparency
let hp_fade =
((crate::ecs::sys::floater::MY_HP_SHOWTIME - timer) * 0.25) + 0.2;
Text::new(&format!("{}", hp_dmg_rounded_abs))
2020-01-10 00:33:38 +00:00
.font_size(font_size)
2020-02-17 16:22:49 +00:00
.font_id(self.fonts.cyri.conrod_id)
.color(if hp_damage < 0 {
Color::Rgba(0.0, 0.0, 0.0, hp_fade)
} else {
Color::Rgba(0.0, 0.0, 0.0, 0.0)
})
2020-01-10 00:33:38 +00:00
.mid_bottom_with_margin_on(ui_widgets.window, 297.0 + y)
.set(player_sct_bg_id, ui_widgets);
Text::new(&format!("{}", hp_dmg_rounded_abs))
2020-01-10 00:33:38 +00:00
.font_size(font_size)
2020-02-17 16:22:49 +00:00
.font_id(self.fonts.cyri.conrod_id)
2020-01-10 00:33:38 +00:00
.color(if hp_damage < 0 {
Color::Rgba(1.0, 0.1, 0.0, hp_fade)
} else {
Color::Rgba(0.0, 0.0, 0.0, 0.0)
})
2020-01-10 00:33:38 +00:00
.mid_bottom_with_margin_on(ui_widgets.window, 300.0 + y)
.set(player_sct_id, ui_widgets);
};
for floater in floaters {
// Healing always single numbers so just skip damage when in batch mode
if global_state.settings.interface.sct_player_batch && floater.hp_change < 0
2020-01-10 00:33:38 +00:00
{
continue;
}
let number_speed = 50.0; // Player Heal Speed
let player_sct_bg_id = player_sct_bg_id_walker.next(
&mut self.ids.player_sct_bgs,
&mut ui_widgets.widget_id_generator(),
);
let player_sct_id = player_sct_id_walker.next(
&mut self.ids.player_scts,
&mut ui_widgets.widget_id_generator(),
);
let max_hp_frac = floater.hp_change.abs() as f32 / health.maximum() as f32;
2020-01-10 00:33:38 +00:00
// Increase font size based on fraction of maximum health
// "flashes" by having a larger size in the first 100ms
let font_size = 30
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
+ ((max_hp_frac * 10.0) as u32) * 3
2020-01-10 00:33:38 +00:00
+ if floater.timer < 0.1 {
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
FLASH_MAX * (((1.0 - floater.timer / 0.1) * 10.0) as u32)
2020-01-10 00:33:38 +00:00
} else {
0
};
// Timer sets the widget offset
let y = if floater.hp_change < 0 {
floater.timer as f64
* number_speed
* floater.hp_change.signum() as f64
//* -1.0
+ 300.0
- ui_widgets.win_h * 0.5
} else {
2020-01-10 00:33:38 +00:00
floater.timer as f64
* number_speed
* floater.hp_change.signum() as f64
* -1.0
+ 300.0
- ui_widgets.win_h * 0.5
};
2020-01-10 00:33:38 +00:00
// Healing is offset randomly
let x = if floater.hp_change < 0 {
0.0
} else {
(floater.rand as f64 - 0.5) * 0.2 * ui_widgets.win_w
};
// Timer sets text transparency
let hp_fade = ((crate::ecs::sys::floater::MY_HP_SHOWTIME - floater.timer)
* 0.25)
+ 0.2;
if floater.hp_change.abs() > 10 {
Text::new(&format!("{}", (floater.hp_change / 10).abs()))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, hp_fade))
.x_y(x, y - 3.0)
.set(player_sct_bg_id, ui_widgets);
Text::new(&format!("{}", (floater.hp_change / 10).abs()))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(if floater.hp_change < 0 {
Color::Rgba(1.0, 0.1, 0.0, hp_fade)
} else {
Color::Rgba(0.1, 1.0, 0.1, hp_fade)
})
.x_y(x, y)
.set(player_sct_id, ui_widgets);
} else {
Text::new(&format!("{}", (floater.hp_change as f32 / 10.0).abs()))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, hp_fade))
.x_y(x, y - 3.0)
.set(player_sct_bg_id, ui_widgets);
Text::new(&format!("{}", (floater.hp_change as f32 / 10.0).abs()))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(if floater.hp_change < 0 {
Color::Rgba(1.0, 0.1, 0.0, hp_fade)
} else {
Color::Rgba(0.1, 1.0, 0.1, hp_fade)
})
.x_y(x, y)
.set(player_sct_id, ui_widgets);
}
2020-01-10 00:33:38 +00:00
}
}
// EXP Numbers
self.floaters
.exp_floaters
.iter_mut()
.for_each(|f| f.timer -= dt.as_secs_f32());
self.floaters.exp_floaters.retain(|f| f.timer > 0_f32);
if let Some(uid) = uids.get(me) {
for floater in self
.floaters
.exp_floaters
.iter_mut()
.filter(|f| f.owner == *uid)
{
let number_speed = 50.0; // Number Speed for Single EXP
let player_sct_bg_id = player_sct_bg_id_walker.next(
&mut self.ids.player_sct_bgs,
&mut ui_widgets.widget_id_generator(),
);
let player_sct_id = player_sct_id_walker.next(
&mut self.ids.player_scts,
&mut ui_widgets.widget_id_generator(),
);
/*let player_sct_icon_id = player_sct_id_walker.next(
&mut self.ids.player_scts,
&mut ui_widgets.widget_id_generator(),
);*/
// Increase font size based on fraction of maximum Experience
// "flashes" by having a larger size in the first 100ms
let font_size_xp =
30 + ((floater.exp_change as f32 / 300.0).min(1.0) * 50.0) as u32;
let y = floater.timer as f64 * number_speed; // Timer sets the widget offset
//let fade = ((4.0 - floater.timer as f32) * 0.25) + 0.2; // Timer sets
// text transparency
let fade = if floater.timer < 1.0 {
floater.timer as f32
} else {
1.0
};
if floater.exp_change > 0 {
let xp_pool = &floater.xp_pools;
// Don't show 0 Exp
Text::new(&format!("{} Exp", floater.exp_change.max(1)))
.font_size(font_size_xp)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
.x_y(
ui_widgets.win_w * (0.5 * floater.rand_offset.0 as f64 - 0.25),
ui_widgets.win_h * (0.15 * floater.rand_offset.1 as f64) + y
- 3.0,
)
.set(player_sct_bg_id, ui_widgets);
Text::new(&format!("{} Exp", floater.exp_change.max(1)))
.font_size(font_size_xp)
.font_id(self.fonts.cyri.conrod_id)
.color(
if xp_pool.contains(&SkillGroupKind::Weapon(ToolKind::Pick)) {
Color::Rgba(0.18, 0.32, 0.9, fade)
} else {
Color::Rgba(0.59, 0.41, 0.67, fade)
},
)
.x_y(
ui_widgets.win_w * (0.5 * floater.rand_offset.0 as f64 - 0.25),
ui_widgets.win_h * (0.15 * floater.rand_offset.1 as f64) + y,
)
.set(player_sct_id, ui_widgets);
// Exp Source Image (TODO: fix widget id crash)
/*if xp_pool.contains(&SkillGroupKind::Weapon(ToolKind::Pick)) {
Image::new(self.imgs.pickaxe_ico)
.w_h(font_size_xp as f64, font_size_xp as f64)
.left_from(player_sct_id, 5.0)
.set(player_sct_icon_id, ui_widgets);
}*/
}
}
}
// Skill points
self.floaters
.skill_point_displays
.iter_mut()
.for_each(|f| f.timer -= dt.as_secs_f32());
self.floaters
.skill_point_displays
.retain(|d| d.timer > 0_f32);
if let Some(uid) = uids.get(me) {
if let Some(display) = self
.floaters
.skill_point_displays
.iter_mut()
.find(|d| d.owner == *uid)
{
let fade = if display.timer < 3.0 {
display.timer as f32 * 0.33
} else if display.timer < 2.0 {
display.timer as f32 * 0.33 * 0.1
} else {
1.0
};
// Background image
let offset = if display.timer < 2.0 {
300.0 - (display.timer as f64 - 2.0) * -300.0
} else {
300.0
};
Image::new(self.imgs.level_up)
.w_h(328.0, 126.0)
.mid_top_with_margin_on(ui_widgets.window, offset)
.graphics_for(ui_widgets.window)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, fade)))
.set(self.ids.player_rank_up, ui_widgets);
// Rank Number
let rank = display.total_points;
Text::new(&format!("{}", rank))
.font_size(20)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(1.0, 1.0, 1.0, fade))
.mid_top_with_margin_on(self.ids.player_rank_up, 8.0)
.set(self.ids.player_rank_up_txt_number, ui_widgets);
// Static "New Rank!" text
Text::new(&i18n.get("hud.rank_up"))
.font_size(40)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
.mid_bottom_with_margin_on(self.ids.player_rank_up, 20.0)
.set(self.ids.player_rank_up_txt_0_bg, ui_widgets);
Text::new(&i18n.get("hud.rank_up"))
.font_size(40)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(1.0, 1.0, 1.0, fade))
.bottom_left_with_margins_on(self.ids.player_rank_up_txt_0_bg, 2.0, 2.0)
.set(self.ids.player_rank_up_txt_0, ui_widgets);
// Variable skilltree text
let skill = match display.skill_tree {
General => &i18n.get("common.weapons.general"),
Weapon(ToolKind::Hammer) => &i18n.get("common.weapons.hammer"),
Weapon(ToolKind::Axe) => &i18n.get("common.weapons.axe"),
Weapon(ToolKind::Sword) => &i18n.get("common.weapons.sword"),
Weapon(ToolKind::Sceptre) => &i18n.get("common.weapons.sceptre"),
Weapon(ToolKind::Bow) => &i18n.get("common.weapons.bow"),
Weapon(ToolKind::Staff) => &i18n.get("common.weapons.staff"),
Weapon(ToolKind::Pick) => &i18n.get("common.tool.mining"),
_ => "Unknown",
};
Text::new(skill)
.font_size(20)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
.mid_top_with_margin_on(self.ids.player_rank_up, 45.0)
.set(self.ids.player_rank_up_txt_1_bg, ui_widgets);
Text::new(skill)
.font_size(20)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(1.0, 1.0, 1.0, fade))
.bottom_left_with_margins_on(self.ids.player_rank_up_txt_1_bg, 2.0, 2.0)
.set(self.ids.player_rank_up_txt_1, ui_widgets);
// Variable skilltree icon
use crate::hud::SkillGroupKind::{General, Weapon};
Image::new(match display.skill_tree {
General => self.imgs.swords_crossed,
Weapon(ToolKind::Hammer) => self.imgs.hammer,
Weapon(ToolKind::Axe) => self.imgs.axe,
Weapon(ToolKind::Sword) => self.imgs.sword,
Weapon(ToolKind::Sceptre) => self.imgs.sceptre,
Weapon(ToolKind::Bow) => self.imgs.bow,
Weapon(ToolKind::Staff) => self.imgs.staff,
Weapon(ToolKind::Pick) => self.imgs.mining,
_ => self.imgs.swords_crossed,
})
.w_h(20.0, 20.0)
.left_from(self.ids.player_rank_up_txt_1_bg, 5.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, fade)))
.set(self.ids.player_rank_up_icon, ui_widgets);
}
}
// Scrolling Combat Text for Parrying an attack
self.floaters
.block_floaters
.iter_mut()
.for_each(|f| f.timer -= dt.as_secs_f32());
self.floaters.block_floaters.retain(|f| f.timer > 0_f32);
if let Some(uid) = uids.get(me) {
for floater in self
.floaters
.block_floaters
.iter_mut()
.filter(|f| f.owner == *uid)
{
let number_speed = 50.0;
let player_sct_bg_id = player_sct_bg_id_walker.next(
&mut self.ids.player_sct_bgs,
&mut ui_widgets.widget_id_generator(),
);
let player_sct_id = player_sct_id_walker.next(
&mut self.ids.player_scts,
&mut ui_widgets.widget_id_generator(),
);
let font_size = 30;
let y = floater.timer as f64 * number_speed; // Timer sets the widget offset
// text transparency
let fade = if floater.timer < 0.25 {
floater.timer as f32 / 0.25
} else {
1.0
};
Text::new(&i18n.get("hud.sct.block"))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
.x_y(
ui_widgets.win_w * (0.0),
ui_widgets.win_h * (-0.3) + y - 3.0,
)
.set(player_sct_bg_id, ui_widgets);
Text::new(&i18n.get("hud.sct.block"))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.69, 0.82, 0.88, fade))
.x_y(ui_widgets.win_w * 0.0, ui_widgets.win_h * -0.3 + y)
.set(player_sct_id, ui_widgets);
}
}
2020-01-10 00:33:38 +00:00
}
// Pop speech bubbles
let now = Instant::now();
self.speech_bubbles
.retain(|_uid, bubble| bubble.timeout > now);
// Push speech bubbles
for msg in self.new_messages.iter() {
if let Some((bubble, uid)) = msg.to_bubble() {
self.speech_bubbles.insert(uid, bubble);
}
}
let mut overhead_walker = self.ids.overheads.walk();
let mut overitem_walker = self.ids.overitems.walk();
let mut sct_walker = self.ids.scts.walk();
let mut sct_bg_walker = self.ids.sct_bgs.walk();
let pulse = self.pulse;
let make_overitem = |item: &Item, pos, distance, properties, fonts| {
let text = if item.amount() > 1 {
format!("{} x {}", item.amount(), item.name())
} else {
item.name().to_string()
};
2021-03-02 00:45:02 +00:00
let quality = get_quality_col(item);
// Item
overitem::Overitem::new(
text.into(),
quality,
distance,
fonts,
&i18n,
&global_state.settings.controls,
properties,
pulse,
&global_state.window.key_layout,
)
.x_y(0.0, 100.0)
.position_ingame(pos)
};
self.failed_block_pickups
.retain(|_, t| pulse - *t < overitem::PICKUP_FAILED_FADE_OUT_TIME);
self.failed_entity_pickups
.retain(|_, t| pulse - *t < overitem::PICKUP_FAILED_FADE_OUT_TIME);
// Render overitem: name, etc.
for (entity, pos, item, distance) in (&entities, &pos, &items)
.join()
.map(|(entity, pos, item)| (entity, pos, item, pos.0.distance_squared(player_pos)))
.filter(|(_, _, _, distance)| distance < &common::consts::MAX_PICKUP_RANGE.powi(2))
{
let overitem_id = overitem_walker.next(
&mut self.ids.overitems,
&mut ui_widgets.widget_id_generator(),
);
make_overitem(
item,
pos.0 + Vec3::unit_z() * 1.2,
distance,
overitem::OveritemProperties {
active: interactable.as_ref().and_then(|i| i.entity()) == Some(entity),
pickup_failed_pulse: self.failed_entity_pickups.get(&entity).copied(),
},
&self.fonts,
)
.set(overitem_id, ui_widgets);
}
// Render overtime for an interactable block
2021-04-17 14:58:43 +00:00
if let Some(Interactable::Block(block, pos, _)) = interactable {
let overitem_id = overitem_walker.next(
&mut self.ids.overitems,
&mut ui_widgets.widget_id_generator(),
);
let overitem_properties = overitem::OveritemProperties {
active: true,
pickup_failed_pulse: self.failed_block_pickups.get(&pos).copied(),
};
let pos = pos.map(|e| e as f32 + 0.5);
let over_pos = pos + Vec3::unit_z() * 0.7;
// This is only done once per frame, so it's not a performance issue
if block.get_sprite().map_or(false, |s| s.is_container()) {
overitem::Overitem::new(
"???".into(),
overitem::TEXT_COLOR,
pos.distance_squared(player_pos),
&self.fonts,
&i18n,
&global_state.settings.controls,
overitem_properties,
self.pulse,
&global_state.window.key_layout,
)
.x_y(0.0, 100.0)
.position_ingame(over_pos)
.set(overitem_id, ui_widgets);
} else if let Some(item) = Item::try_reclaim_from_block(block) {
make_overitem(
&item,
over_pos,
pos.distance_squared(player_pos),
overitem_properties,
&self.fonts,
)
.set(overitem_id, ui_widgets);
2021-04-17 14:58:43 +00:00
} else if let Some(sprite) = block.get_sprite() {
overitem::Overitem::new(
2021-04-17 18:35:48 +00:00
format!("{:?}", sprite).into(), /* TODO: A better way to generate text
* for this */
2021-04-17 14:58:43 +00:00
overitem::TEXT_COLOR,
pos.distance_squared(player_pos),
&self.fonts,
&i18n,
2021-04-17 14:58:43 +00:00
&global_state.settings.controls,
overitem_properties,
self.pulse,
2021-04-17 14:58:43 +00:00
&global_state.window.key_layout,
)
.x_y(0.0, 100.0)
.position_ingame(over_pos)
.set(overitem_id, ui_widgets);
}
}
let speech_bubbles = &self.speech_bubbles;
// Render overhead name tags and health bars
for (pos, info, bubble, _, _, health, _, height_offset, hpfl, in_group) in (
2020-01-10 00:33:38 +00:00
&entities,
&pos,
interpolated.maybe(),
&stats,
&skill_sets,
healths.maybe(),
&buffs,
2020-07-05 12:39:28 +00:00
energy.maybe(),
2020-01-10 00:33:38 +00:00
scales.maybe(),
&bodies,
&hp_floater_lists,
&uids,
&inventories,
players.maybe(),
2020-01-10 00:33:38 +00:00
)
.join()
.filter(|t| {
let health = t.5;
let entity = t.0;
entity != me && !health.map_or(false, |h| h.is_dead)
2020-07-12 03:12:03 +00:00
})
.filter_map(
|(
entity,
pos,
interpolated,
stats,
skill_set,
health,
buffs,
energy,
scale,
body,
hpfl,
uid,
inventory,
player,
)| {
// Use interpolated position if available
let pos = interpolated.map_or(pos.0, |i| i.pos);
let in_group = client.group_members().contains_key(uid);
// TODO: once the site2 rework lands and merchants have dedicated stalls or
// buildings, they no longer need to be emphasized via the higher overhead
// text radius relative to other NPCs
let is_merchant = stats.name == "Merchant" && player.is_none();
let dist_sqr = pos.distance_squared(player_pos);
// Determine whether to display nametag and healthbar based on whether the
// entity has been damaged, is targeted/selected, or is in your group
// Note: even if this passes the healthbar can be hidden in some cases if it
// is at maximum
let display_overhead_info =
(info.target_entity.map_or(false, |e| e == entity)
|| info.selected_entity.map_or(false, |s| s.0 == entity)
|| health.map_or(true, overhead::should_show_healthbar)
|| in_group
|| is_merchant)
&& dist_sqr
< (if in_group {
NAMETAG_GROUP_RANGE
} else if is_merchant {
NAMETAG_MERCHANT_RANGE
} else if hpfl
.time_since_last_dmg_by_me
.map_or(false, |t| t < NAMETAG_DMG_TIME)
{
NAMETAG_DMG_RANGE
} else {
NAMETAG_RANGE
})
.powi(2);
let info = display_overhead_info.then(|| overhead::Info {
name: &stats.name,
health,
buffs,
energy,
combat_rating: health.map_or(0.0, |health| {
combat::combat_rating(inventory, health, skill_set, *body, &msm)
}),
});
let bubble = if dist_sqr < SPEECH_BUBBLE_RANGE.powi(2) {
speech_bubbles.get(uid)
} else {
None
};
(info.is_some() || bubble.is_some()).then(|| {
(
pos,
info,
bubble,
stats,
skill_set,
health,
buffs,
body.height() * scale.map_or(1.0, |s| s.0) + 0.5,
hpfl,
in_group,
)
2020-01-10 00:33:38 +00:00
})
2020-07-12 03:12:03 +00:00
},
)
{
let overhead_id = overhead_walker.next(
&mut self.ids.overheads,
&mut ui_widgets.widget_id_generator(),
);
let ingame_pos = pos + Vec3::unit_z() * height_offset;
2020-08-25 19:54:47 +00:00
//
// * height_offset
// Speech bubble, name, level, and hp bars
overhead::Overhead::new(
info,
2020-05-24 22:18:41 +00:00
bubble,
2020-07-12 03:12:03 +00:00
in_group,
&global_state.settings.interface,
self.pulse,
2020-12-12 22:14:24 +00:00
i18n,
&self.imgs,
&self.fonts,
)
.x_y(0.0, 100.0)
.position_ingame(ingame_pos)
.set(overhead_id, ui_widgets);
// Enemy SCT
if global_state.settings.interface.sct && !hpfl.floaters.is_empty() {
let floaters = &hpfl.floaters;
// Colors
const WHITE: Rgb<f32> = Rgb::new(1.0, 0.9, 0.8);
const LIGHT_OR: Rgb<f32> = Rgb::new(1.0, 0.925, 0.749);
const LIGHT_MED_OR: Rgb<f32> = Rgb::new(1.0, 0.85, 0.498);
const MED_OR: Rgb<f32> = Rgb::new(1.0, 0.776, 0.247);
const DARK_ORANGE: Rgb<f32> = Rgb::new(1.0, 0.7, 0.0);
const RED_ORANGE: Rgb<f32> = Rgb::new(1.0, 0.349, 0.0);
const DAMAGE_COLORS: [Rgb<f32>; 6] = [
WHITE,
LIGHT_OR,
LIGHT_MED_OR,
MED_OR,
DARK_ORANGE,
RED_ORANGE,
];
// Largest value that select the first color is 40, then it shifts colors
// every 5
let font_col = |font_size: u32| {
DAMAGE_COLORS[(font_size.saturating_sub(36) / 5).min(5) as usize]
};
if global_state.settings.interface.sct_damage_batch {
let number_speed = 50.0; // Damage number speed
let sct_id = sct_walker
.next(&mut self.ids.scts, &mut ui_widgets.widget_id_generator());
let sct_bg_id = sct_bg_walker
.next(&mut self.ids.sct_bgs, &mut ui_widgets.widget_id_generator());
// Calculate total change
// Ignores healing
let hp_damage = floaters.iter().fold(0, |acc, f| {
if f.hp_change < 0 {
acc + f.hp_change
} else {
acc
}
});
// Divide by 10 to stay in the same dimension as the HP display
let hp_dmg_rounded_abs = ((hp_damage + 5) / 10).abs();
let max_hp_frac =
hp_damage.abs() as f32 / health.map_or(1.0, |h| h.maximum() as f32);
let timer = floaters
.last()
.expect("There must be at least one floater")
.timer;
// Increase font size based on fraction of maximum health
// "flashes" by having a larger size in the first 100ms
let font_size = 30
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
+ ((max_hp_frac * 10.0) as u32) * 3
+ if timer < 0.1 {
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
FLASH_MAX * (((1.0 - timer / 0.1) * 10.0) as u32)
} else {
0
};
let font_col = font_col(font_size);
// Timer sets the widget offset
let y = (timer as f64 / crate::ecs::sys::floater::HP_SHOWTIME as f64
* number_speed)
+ 100.0;
// Timer sets text transparency
let fade = ((crate::ecs::sys::floater::HP_SHOWTIME - timer) * 0.25) + 0.2;
2020-09-15 11:11:05 +00:00
if hp_damage.abs() < 10 {
// Damage and heal below 10/10 are shown as decimals
2020-09-13 05:32:50 +00:00
Text::new(&format!("{}", hp_damage.abs() as f32 / 10.0))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
.x_y(0.0, y - 3.0)
.position_ingame(ingame_pos)
.set(sct_bg_id, ui_widgets);
2020-09-13 05:32:50 +00:00
Text::new(&format!("{}", hp_damage.abs() as f32 / 10.0))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.x_y(0.0, y)
.color(if hp_damage < 0 {
Color::Rgba(font_col.r, font_col.g, font_col.b, fade)
} else {
Color::Rgba(0.1, 1.0, 0.1, fade)
})
.position_ingame(ingame_pos)
.set(sct_id, ui_widgets);
} else {
// Damage and heal above 10/10 are shown rounded
Text::new(&format!("{}", hp_dmg_rounded_abs))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
.x_y(0.0, y - 3.0)
.position_ingame(ingame_pos)
.set(sct_bg_id, ui_widgets);
Text::new(&format!("{}", hp_dmg_rounded_abs))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.x_y(0.0, y)
.color(if hp_damage < 0 {
Color::Rgba(font_col.r, font_col.g, font_col.b, fade)
} else {
Color::Rgba(0.1, 1.0, 0.1, fade)
})
.position_ingame(ingame_pos)
.set(sct_id, ui_widgets);
};
} else {
for floater in floaters {
let number_speed = 250.0; // Single Numbers Speed
let sct_id = sct_walker
.next(&mut self.ids.scts, &mut ui_widgets.widget_id_generator());
let sct_bg_id = sct_bg_walker
.next(&mut self.ids.sct_bgs, &mut ui_widgets.widget_id_generator());
// Calculate total change
let max_hp_frac = floater.hp_change.abs() as f32
/ health.map_or(1.0, |h| h.maximum() as f32);
// Increase font size based on fraction of maximum health
// "flashes" by having a larger size in the first 100ms
let font_size = 30
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
+ ((max_hp_frac * 10.0) as u32) * 3
+ if floater.timer < 0.1 {
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
FLASH_MAX * (((1.0 - floater.timer / 0.1) * 10.0) as u32)
} else {
0
};
let font_col = font_col(font_size);
// Timer sets the widget offset
let y = (floater.timer as f64
/ crate::ecs::sys::floater::HP_SHOWTIME as f64
* number_speed)
+ 100.0;
// Timer sets text transparency
let fade = ((crate::ecs::sys::floater::HP_SHOWTIME - floater.timer)
* 0.25)
+ 0.2;
if floater.hp_change.abs() < 10 {
// Damage and heal below 10/10 are shown as decimals
2020-09-15 11:11:05 +00:00
Text::new(&format!("{}", (floater.hp_change.abs() as f32 / 10.0)))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(if floater.hp_change < 0 {
Color::Rgba(0.0, 0.0, 0.0, fade)
} else {
Color::Rgba(0.0, 0.0, 0.0, 1.0)
})
.x_y(0.0, y - 3.0)
.position_ingame(ingame_pos)
.set(sct_bg_id, ui_widgets);
2020-09-15 11:11:05 +00:00
Text::new(&format!("{}", (floater.hp_change.abs() as f32 / 10.0)))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.x_y(0.0, y)
.color(if floater.hp_change < 0 {
Color::Rgba(font_col.r, font_col.g, font_col.b, fade)
} else {
Color::Rgba(0.1, 1.0, 0.1, 1.0)
})
.position_ingame(ingame_pos)
.set(sct_id, ui_widgets);
} else {
// Damage and heal above 10/10 are shown rounded
Text::new(&format!("{}", (floater.hp_change / 10).abs()))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.color(if floater.hp_change < 0 {
Color::Rgba(0.0, 0.0, 0.0, fade)
} else {
Color::Rgba(0.0, 0.0, 0.0, 1.0)
})
.x_y(0.0, y - 3.0)
.position_ingame(ingame_pos)
.set(sct_bg_id, ui_widgets);
Text::new(&format!("{}", (floater.hp_change / 10).abs()))
.font_size(font_size)
.font_id(self.fonts.cyri.conrod_id)
.x_y(0.0, y)
.color(if floater.hp_change < 0 {
Color::Rgba(font_col.r, font_col.g, font_col.b, fade)
} else {
Color::Rgba(0.1, 1.0, 0.1, 1.0)
})
.position_ingame(ingame_pos)
.set(sct_id, ui_widgets);
}
}
}
}
}
}
2020-01-10 00:33:38 +00:00
2020-06-03 17:59:09 +00:00
// Temporary Example Quest
let arrow_ani = (self.pulse * 4.0/* speed factor */).cos() * 0.5 + 0.8; //Animation timer
2021-06-19 05:04:05 +00:00
let show_intro = self.show.intro; // borrow check doesn't understand closures
if let Some(toggle_cursor_key) = global_state
.settings
.controls
.get_binding(GameInput::ToggleCursor)
2021-06-19 05:04:05 +00:00
.filter(|_| !show_intro)
{
2021-06-19 05:04:05 +00:00
prof_span!("temporary example quest");
match global_state.settings.interface.intro_show {
Intro::Show => {
if Button::image(self.imgs.button)
.w_h(150.0, 40.0)
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.bottom_left_with_margins_on(ui_widgets.window, 200.0, 120.0)
.label(&i18n.get("hud.tutorial_btn"))
.label_font_id(self.fonts.cyri.conrod_id)
.label_font_size(self.fonts.cyri.scale(18))
.label_color(TEXT_COLOR)
.label_y(conrod_core::position::Relative::Scalar(2.0))
.image_color(ENEMY_HP_COLOR)
.set(self.ids.intro_button, ui_widgets)
.was_clicked()
{
self.show.intro = true;
self.show.want_grab = true;
}
Image::new(self.imgs.sp_indicator_arrow)
.w_h(20.0, 11.0)
.mid_top_with_margin_on(self.ids.intro_button, -20.0 + arrow_ani as f64)
.color(Some(QUALITY_LEGENDARY))
.set(self.ids.tut_arrow, ui_widgets);
Text::new(&i18n.get("hud.tutorial_click_here").replace(
"{key}",
toggle_cursor_key.display_string(key_layout).as_str(),
))
.mid_top_with_margin_on(self.ids.tut_arrow, -18.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.color(BLACK)
.set(self.ids.tut_arrow_txt_bg, ui_widgets);
Text::new(&i18n.get("hud.tutorial_click_here").replace(
"{key}",
toggle_cursor_key.display_string(key_layout).as_str(),
))
.bottom_right_with_margins_on(self.ids.tut_arrow_txt_bg, 1.0, 1.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.color(QUALITY_LEGENDARY)
.set(self.ids.tut_arrow_txt, ui_widgets);
},
Intro::Never => {
self.show.intro = false;
},
}
}
// TODO: Add event/stat based tutorial system
2020-06-03 17:59:09 +00:00
if self.show.intro && !self.show.esc_menu {
2021-06-19 05:04:05 +00:00
prof_span!("intro show");
match global_state.settings.interface.intro_show {
Intro::Show => {
if self.show.intro {
2020-06-03 17:59:09 +00:00
self.show.want_grab = false;
2020-12-12 22:14:24 +00:00
let quest_headline = &i18n.get("hud.temp_quest_headline");
let quest_text = &i18n.get("hud.temp_quest_text");
2020-06-03 17:59:09 +00:00
Image::new(self.imgs.quest_bg)
.w_h(404.0, 858.0)
.middle_of(ui_widgets.window)
.set(self.ids.quest_bg, ui_widgets);
Text::new(quest_headline)
.mid_top_with_margin_on(self.ids.quest_bg, 310.0)
.font_size(self.fonts.cyri.scale(30))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_BG)
.set(self.ids.q_headline_bg, ui_widgets);
Text::new(quest_headline)
.bottom_left_with_margins_on(self.ids.q_headline_bg, 1.0, 1.0)
.font_size(self.fonts.cyri.scale(30))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(self.ids.q_headline, ui_widgets);
Text::new(quest_text)
.mid_top_with_margin_on(self.ids.quest_bg, 360.0)
.w(350.0)
2020-06-03 17:59:09 +00:00
.font_size(self.fonts.cyri.scale(17))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_BG)
.set(self.ids.q_text_bg, ui_widgets);
Text::new(quest_text)
.bottom_left_with_margins_on(self.ids.q_text_bg, 1.0, 1.0)
.w(350.0)
2020-06-03 17:59:09 +00:00
.font_size(self.fonts.cyri.scale(17))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(self.ids.q_text, ui_widgets);
if Button::image(self.imgs.button)
.w_h(212.0, 52.0)
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.mid_bottom_with_margin_on(self.ids.q_text_bg, -80.0)
.label(&i18n.get("common.close"))
2020-06-03 17:59:09 +00:00
.label_font_id(self.fonts.cyri.conrod_id)
.label_font_size(self.fonts.cyri.scale(22))
.label_color(TEXT_COLOR)
2020-06-03 19:32:54 +00:00
.label_y(conrod_core::position::Relative::Scalar(2.0))
2020-06-03 17:59:09 +00:00
.set(self.ids.accept_button, ui_widgets)
.was_clicked()
{
self.show.intro = false;
events.push(Event::SettingsChange(
InterfaceChange::Intro(Intro::Never).into(),
));
2020-06-03 17:59:09 +00:00
self.show.want_grab = true;
}
if !self.show.crafting && !self.show.bag {
Image::new(self.imgs.sp_indicator_arrow)
.w_h(20.0, 11.0)
.bottom_right_with_margins_on(
ui_widgets.window,
40.0 + arrow_ani as f64,
205.0,
)
.color(Some(QUALITY_LEGENDARY))
.set(self.ids.tut_arrow, ui_widgets);
Text::new(&i18n.get("hud.tutorial_elements"))
.mid_top_with_margin_on(self.ids.tut_arrow, -50.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(40))
.color(BLACK)
.floating(true)
.set(self.ids.tut_arrow_txt_bg, ui_widgets);
Text::new(&i18n.get("hud.tutorial_elements"))
.bottom_right_with_margins_on(self.ids.tut_arrow_txt_bg, 1.0, 1.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(40))
.color(QUALITY_LEGENDARY)
.floating(true)
.set(self.ids.tut_arrow_txt, ui_widgets);
}
2020-06-03 17:59:09 +00:00
}
},
2020-06-03 19:32:54 +00:00
Intro::Never => {
self.show.intro = false;
},
}
}
// Display debug window.
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
if let Some(debug_info) = debug_info {
2021-06-19 05:04:05 +00:00
prof_span!("debug info");
// Alpha Version
2019-06-28 12:08:12 +00:00
Text::new(&version)
.top_left_with_margins_on(ui_widgets.window, 5.0, 5.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(self.ids.version, ui_widgets);
2019-06-23 19:49:15 +00:00
// Ticks per second
Text::new(&format!(
"FPS: {:.0} ({}ms)",
debug_info.tps,
debug_info.frame_time.as_millis()
))
.color(TEXT_COLOR)
.down_from(self.ids.version, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.fps_counter, ui_widgets);
2019-06-23 19:49:15 +00:00
// Ping
2019-08-22 17:44:35 +00:00
Text::new(&format!("Ping: {:.0}ms", debug_info.ping_ms))
.color(TEXT_COLOR)
.down_from(self.ids.fps_counter, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.ping, ui_widgets);
2019-08-06 21:51:13 +00:00
// Player's position
let coordinates_text = match debug_info.coordinates {
2019-08-22 17:44:35 +00:00
Some(coordinates) => format!(
"Coordinates: ({:.0}, {:.0}, {:.0})",
coordinates.0.x, coordinates.0.y, coordinates.0.z,
),
None => "Player has no Pos component".to_owned(),
};
Text::new(&coordinates_text)
.color(TEXT_COLOR)
.down_from(self.ids.ping, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.coordinates, ui_widgets);
// Player's velocity
2019-08-06 21:51:13 +00:00
let velocity_text = match debug_info.velocity {
2019-08-22 19:26:35 +00:00
Some(velocity) => format!(
"Velocity: ({:.1}, {:.1}, {:.1}) [{:.1} u/s]",
velocity.0.x,
velocity.0.y,
velocity.0.z,
velocity.0.magnitude()
),
2019-08-06 21:51:13 +00:00
None => "Player has no Vel component".to_owned(),
};
Text::new(&velocity_text)
.color(TEXT_COLOR)
.down_from(self.ids.coordinates, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
2019-08-06 21:51:13 +00:00
.set(self.ids.velocity, ui_widgets);
2020-04-25 00:30:20 +00:00
// Player's orientation vector
let orientation_text = match debug_info.ori {
2021-02-04 09:17:38 +00:00
Some(ori) => {
let look_dir = ori.look_dir();
format!(
"Orientation: ({:.1}, {:.1}, {:.1})",
look_dir.x, look_dir.y, look_dir.z,
)
},
2020-04-25 00:30:20 +00:00
None => "Player has no Ori component".to_owned(),
};
Text::new(&orientation_text)
.color(TEXT_COLOR)
.down_from(self.ids.velocity, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.orientation, ui_widgets);
2019-06-23 19:49:15 +00:00
// Loaded distance
Text::new(&format!(
"View distance: {:.2} blocks ({:.2} chunks)",
client.loaded_distance(),
client.loaded_distance() / TerrainChunk::RECT_SIZE.x as f32,
2019-06-23 19:49:15 +00:00
))
.color(TEXT_COLOR)
2020-04-25 00:30:20 +00:00
.down_from(self.ids.orientation, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
2019-06-23 19:49:15 +00:00
.set(self.ids.loaded_distance, ui_widgets);
2019-09-01 19:04:03 +00:00
// Time
let time_in_seconds = client.state().get_time_of_day();
let current_time = NaiveTime::from_num_seconds_from_midnight(
// Wraps around back to 0s if it exceeds 24 hours (24 hours = 86400s)
(time_in_seconds as u64 % 86400) as u32,
0,
);
Text::new(&format!(
"Time: {}",
current_time.format("%H:%M").to_string()
))
.color(TEXT_COLOR)
.down_from(self.ids.loaded_distance, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
2019-09-01 19:04:03 +00:00
.set(self.ids.time, ui_widgets);
2019-11-29 06:04:37 +00:00
// Number of entities
let entity_count = client.state().ecs().entities().join().count();
Text::new(&format!("Entity count: {}", entity_count))
.color(TEXT_COLOR)
.down_from(self.ids.time, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
2019-11-29 06:04:37 +00:00
.set(self.ids.entity_count, ui_widgets);
2020-01-08 17:09:54 +00:00
// Number of chunks
Text::new(&format!(
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
"Chunks: {} ({} visible) & {} (shadow)",
debug_info.num_chunks, debug_info.num_visible_chunks, debug_info.num_shadow_chunks,
))
.color(TEXT_COLOR)
.down_from(self.ids.entity_count, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.num_chunks, ui_widgets);
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
// Number of lights
Text::new(&format!("Lights: {}", debug_info.num_lights,))
.color(TEXT_COLOR)
.down_from(self.ids.num_chunks, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.num_lights, ui_widgets);
// Number of figures
Text::new(&format!(
"Figures: {} ({} visible)",
debug_info.num_figures, debug_info.num_figures_visible,
))
.color(TEXT_COLOR)
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
.down_from(self.ids.num_lights, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.num_figures, ui_widgets);
2019-10-06 19:19:08 +00:00
2020-07-21 15:48:20 +00:00
// Number of particles
Text::new(&format!(
"Particles: {} ({} visible)",
debug_info.num_particles, debug_info.num_particles_visible,
))
.color(TEXT_COLOR)
.down_from(self.ids.num_figures, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.num_particles, ui_widgets);
// Graphics backend
Text::new(&format!(
"Graphics backend: {}",
global_state.window.renderer().graphics_backend(),
))
.color(TEXT_COLOR)
.down_from(self.ids.num_particles, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.graphics_backend, ui_widgets);
// GPU timing for different pipelines
let gpu_timings = global_state.window.renderer().timings();
if !gpu_timings.is_empty() {
let num_timings = gpu_timings.len();
// Make sure we have enough ids
if self.ids.gpu_timings.len() < num_timings {
self.ids
.gpu_timings
.resize(num_timings, &mut ui_widgets.widget_id_generator());
}
for (i, timing) in gpu_timings.iter().enumerate() {
Text::new(&format!(
"{:16}{:.3} ms",
&format!("{}:", timing.1),
timing.2 * 1000.0,
))
.color(TEXT_COLOR)
.down(5.0)
.x_place_on(
ui_widgets.window,
conrod_core::position::Place::Start(Some(5.0 + 10.0 * timing.0 as f64)),
)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.gpu_timings[i], ui_widgets);
}
}
2019-10-06 19:19:08 +00:00
// Help Window
2020-04-08 17:36:37 +00:00
if let Some(help_key) = global_state.settings.controls.get_binding(GameInput::Help) {
Text::new(
2020-12-12 22:14:24 +00:00
&i18n
2020-04-08 17:36:37 +00:00
.get("hud.press_key_to_toggle_keybindings_fmt")
.replace("{key}", help_key.display_string(key_layout).as_str()),
2020-04-08 17:36:37 +00:00
)
.color(TEXT_COLOR)
.down(5.0)
2020-04-08 17:36:37 +00:00
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.help_info, ui_widgets);
}
2020-01-10 00:33:38 +00:00
// Info about Debug Shortcut
2020-04-08 17:36:37 +00:00
if let Some(toggle_debug_key) = global_state
.settings
.controls
.get_binding(GameInput::ToggleDebug)
{
Text::new(&i18n.get("hud.press_key_to_toggle_debug_info_fmt").replace(
"{key}",
toggle_debug_key.display_string(key_layout).as_str(),
))
2020-04-08 17:36:37 +00:00
.color(TEXT_COLOR)
.down_from(self.ids.help_info, 5.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.set(self.ids.debug_info, ui_widgets);
}
2020-01-10 00:33:38 +00:00
} else {
2021-06-19 05:04:05 +00:00
prof_span!("help window");
2020-01-10 00:33:38 +00:00
// Help Window
2020-04-08 17:36:37 +00:00
if let Some(help_key) = global_state.settings.controls.get_binding(GameInput::Help) {
Text::new(
2020-12-12 22:14:24 +00:00
&i18n
2020-04-08 17:36:37 +00:00
.get("hud.press_key_to_show_keybindings_fmt")
.replace("{key}", help_key.display_string(key_layout).as_str()),
2020-04-08 17:36:37 +00:00
)
.color(TEXT_COLOR)
.bottom_left_with_margins_on(ui_widgets.window, 210.0, 10.0)
2020-04-08 17:36:37 +00:00
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(12))
2020-04-08 17:36:37 +00:00
.set(self.ids.help_info, ui_widgets);
}
2020-01-10 00:33:38 +00:00
// Info about Debug Shortcut
2020-04-08 17:36:37 +00:00
if let Some(toggle_debug_key) = global_state
.settings
.controls
.get_binding(GameInput::ToggleDebug)
{
Text::new(&i18n.get("hud.press_key_to_show_debug_info_fmt").replace(
"{key}",
toggle_debug_key.display_string(key_layout).as_str(),
))
2020-04-08 17:36:37 +00:00
.color(TEXT_COLOR)
.top_left_with_margins_on(ui_widgets.window, 5.0, 5.0)
2020-04-08 17:36:37 +00:00
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(12))
.set(self.ids.debug_info, ui_widgets);
}
// Lantern Key
if let Some(toggle_lantern_key) = global_state
.settings
.controls
.get_binding(GameInput::ToggleLantern)
{
Text::new(&i18n.get("hud.press_key_to_toggle_lantern_fmt").replace(
"{key}",
toggle_lantern_key.display_string(key_layout).as_str(),
))
.color(TEXT_COLOR)
.up_from(self.ids.help_info, 2.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(12))
.set(self.ids.lantern_info, ui_widgets);
}
}
// Help Text
// TODO Add dynamic controls display
/*if self.show.help && !self.show.map && !self.show.esc_menu {
2019-10-06 19:19:08 +00:00
Image::new(self.imgs.help)
.middle_of(ui_widgets.window)
2020-04-04 21:51:06 +00:00
.w_h(1260.0, 519.0)
.set(self.ids.help, ui_widgets);
// X-button
if Button::image(self.imgs.close_button)
2019-10-06 19:19:08 +00:00
.w_h(40.0, 40.0)
.hover_image(self.imgs.close_button_hover)
.press_image(self.imgs.close_button_press)
2019-10-06 19:19:08 +00:00
.top_right_with_margins_on(self.ids.help, 0.0, 0.0)
.color(Color::Rgba(1.0, 1.0, 1.0, 0.8))
.set(self.ids.button_help2, ui_widgets)
.was_clicked()
{
self.show.help = false;
};
}*/
// Bag button and nearby icons
2020-04-26 01:44:56 +00:00
let ecs = client.state().ecs();
let entity = client.entity();
2020-04-26 01:44:56 +00:00
let stats = ecs.read_storage::<comp::Stats>();
let skill_sets = ecs.read_storage::<comp::SkillSet>();
let buffs = ecs.read_storage::<comp::Buffs>();
let msm = ecs.read_resource::<MaterialStatManifest>();
if let (Some(player_stats), Some(skill_set)) = (stats.get(entity), skill_sets.get(entity)) {
match Buttons::new(
client,
self.show.bag,
&self.imgs,
&self.fonts,
global_state,
&self.rot_imgs,
tooltip_manager,
2020-12-12 22:14:24 +00:00
i18n,
&player_stats,
&skill_set,
self.pulse,
)
.set(self.ids.buttons, ui_widgets)
{
Some(buttons::Event::ToggleBag) => self.show.toggle_bag(),
Some(buttons::Event::ToggleSettings) => self.show.toggle_settings(global_state),
Some(buttons::Event::ToggleSocial) => self.show.toggle_social(),
Some(buttons::Event::ToggleSpell) => self.show.toggle_spell(),
Some(buttons::Event::ToggleMap) => self.show.toggle_map(),
2020-07-14 20:11:39 +00:00
Some(buttons::Event::ToggleCrafting) => self.show.toggle_crafting(),
None => {},
}
}
// Group Window
for event in Group::new(
&mut self.show,
client,
&global_state.settings,
&self.imgs,
&self.rot_imgs,
&self.fonts,
2020-12-12 22:14:24 +00:00
i18n,
self.pulse,
&global_state,
tooltip_manager,
&msm,
)
.set(self.ids.group_window, ui_widgets)
{
match event {
group::Event::Accept => events.push(Event::AcceptInvite),
group::Event::Decline => events.push(Event::DeclineInvite),
group::Event::Kick(uid) => events.push(Event::KickMember(uid)),
group::Event::LeaveGroup => events.push(Event::LeaveGroup),
group::Event::AssignLeader(uid) => events.push(Event::AssignLeader(uid)),
}
}
2020-06-02 02:42:26 +00:00
// Popup (waypoint saved and similar notifications)
2020-06-03 17:59:09 +00:00
Popup::new(
2020-12-12 22:14:24 +00:00
i18n,
2020-06-03 17:59:09 +00:00
client,
2020-06-02 02:42:26 +00:00
&self.new_notifications,
2020-06-03 17:59:09 +00:00
&self.fonts,
&self.show,
)
.set(self.ids.popup, ui_widgets);
2020-05-14 16:56:10 +00:00
// MiniMap
for event in MiniMap::new(
2021-05-01 16:26:13 +00:00
&self.show,
client,
&self.imgs,
&self.rot_imgs,
2021-04-06 05:15:42 +00:00
&self.world_map,
&self.fonts,
2020-07-10 14:00:20 +00:00
camera.get_orientation(),
&global_state,
2021-05-01 16:26:13 +00:00
self.show.location_marker,
&self.voxel_minimap,
)
.set(self.ids.minimap, ui_widgets)
2019-06-19 14:55:26 +00:00
{
match event {
minimap::Event::SettingsChange(interface_change) => {
events.push(Event::SettingsChange(interface_change.into()));
},
}
}
if let Some(prompt_dialog_settings) = &self.show.prompt_dialog {
// Prompt Dialog
match PromptDialog::new(
&self.imgs,
&self.fonts,
&global_state.i18n,
&global_state.settings,
&prompt_dialog_settings,
&global_state.window.key_layout,
)
.set(self.ids.prompt_dialog, ui_widgets)
{
Some(dialog_outcome_event) => {
match dialog_outcome_event {
DialogOutcomeEvent::Affirmative(event) => events.push(event),
DialogOutcomeEvent::Negative(event) => {
if let Some(event) = event {
events.push(event);
};
},
};
// Close the prompt dialog once an option has been chosen
self.show.prompt_dialog = None;
},
None => {},
}
}
// Skillbar
// Get player stats
let ecs = client.state().ecs();
let entity = client.entity();
let healths = ecs.read_storage::<comp::Health>();
let inventories = ecs.read_storage::<comp::Inventory>();
let energies = ecs.read_storage::<comp::Energy>();
let skillsets = ecs.read_storage::<comp::SkillSet>();
let character_states = ecs.read_storage::<comp::CharacterState>();
let controllers = ecs.read_storage::<comp::Controller>();
let bodies = ecs.read_storage::<comp::Body>();
2021-03-04 20:43:58 +00:00
// Combo floater stuffs
self.floaters
.combo_floaters
.iter_mut()
.for_each(|f| f.timer -= dt.as_secs_f64());
self.floaters.combo_floaters.retain(|f| f.timer > 0_f64);
2021-03-04 20:43:58 +00:00
let combo = if let Some(uid) = ecs.read_storage::<Uid>().get(entity) {
self.floaters
.combo_floaters
2021-03-04 20:43:58 +00:00
.iter()
.find(|c| c.owner == *uid)
.copied()
} else {
None
};
2020-04-11 06:33:06 +00:00
if let (
Some(health),
Some(inventory),
2020-04-11 06:33:06 +00:00
Some(energy),
Some(skillset),
Some(_character_state),
Some(_controller),
2020-04-11 06:33:06 +00:00
) = (
healths.get(entity),
inventories.get(entity),
energies.get(entity),
skillsets.get(entity),
character_states.get(entity),
controllers.get(entity).map(|c| &c.inputs),
2020-01-17 22:00:00 +00:00
) {
Skillbar::new(
2021-03-24 21:02:01 +00:00
client,
global_state,
&self.imgs,
2020-04-11 06:33:06 +00:00
&self.item_imgs,
&self.fonts,
2020-04-12 01:20:48 +00:00
&self.rot_imgs,
&health,
&inventory,
&energy,
&skillset,
//&character_state,
self.pulse,
//&controller,
2020-04-11 06:33:06 +00:00
&self.hotbar,
2020-04-12 01:20:48 +00:00
tooltip_manager,
2021-03-02 00:45:02 +00:00
item_tooltip_manager,
2020-04-11 06:33:06 +00:00
&mut self.slot_manager,
2020-12-12 22:14:24 +00:00
i18n,
&msm,
2021-03-04 20:43:58 +00:00
combo,
)
.set(self.ids.skillbar, ui_widgets);
2019-06-30 11:48:28 +00:00
}
// Bag contents
if self.show.bag {
if let (Some(player_stats), Some(skill_set), Some(health), Some(energy), Some(body)) = (
stats.get(client.entity()),
skill_sets.get(client.entity()),
healths.get(entity),
energies.get(entity),
bodies.get(entity),
) {
match Bag::new(
client,
global_state,
&self.imgs,
&self.item_imgs,
&self.fonts,
&self.rot_imgs,
tooltip_manager,
2021-03-02 00:45:02 +00:00
item_tooltip_manager,
&mut self.slot_manager,
self.pulse,
i18n,
&player_stats,
&skill_set,
&health,
&energy,
&self.show,
&body,
&msm,
)
.set(self.ids.bag, ui_widgets)
{
Some(bag::Event::BagExpand) => self.show.bag_inv = !self.show.bag_inv,
Some(bag::Event::Close) => {
self.show.stats = false;
self.show.bag(false);
if !self.show.social {
self.show.want_grab = true;
self.force_ungrab = false;
} else {
self.force_ungrab = true
};
},
2021-04-17 16:24:33 +00:00
Some(bag::Event::SortInventory) => self.events.push(Event::SortInventory),
2021-05-17 00:43:19 +00:00
Some(bag::Event::SwapEquippedWeapons) => {
self.events.push(Event::SwapEquippedWeapons)
},
None => {},
}
}
}
// Trade window
if self.show.trade {
match Trade::new(
client,
&self.imgs,
&self.item_imgs,
&self.fonts,
&self.rot_imgs,
2021-03-16 12:19:31 +00:00
item_tooltip_manager,
&mut self.slot_manager,
i18n,
&msm,
self.pulse,
)
.set(self.ids.trade, ui_widgets)
{
Some(action) => {
if let TradeAction::Decline = action {
self.show.stats = false;
self.show.trade(false);
if !self.show.social {
self.show.want_grab = true;
self.force_ungrab = false;
} else {
self.force_ungrab = true
};
}
events.push(Event::TradeAction(action));
},
None => {},
}
}
// Buffs
let ecs = client.state().ecs();
let entity = client.entity();
let health = ecs.read_storage::<comp::Health>();
let energy = ecs.read_storage::<comp::Energy>();
if let (Some(player_buffs), Some(health), Some(energy)) = (
buffs.get(client.entity()),
health.get(entity),
energy.get(entity),
) {
for event in BuffsBar::new(
&self.imgs,
&self.fonts,
&self.rot_imgs,
tooltip_manager,
i18n,
&player_buffs,
self.pulse,
&global_state,
&health,
&energy,
)
.set(self.ids.buffs, ui_widgets)
{
match event {
buffs::Event::RemoveBuff(buff_id) => events.push(Event::RemoveBuff(buff_id)),
}
}
}
2020-07-14 20:11:39 +00:00
// Crafting
if self.show.crafting {
if let Some(inventory) = inventories.get(entity) {
for event in Crafting::new(
//&self.show,
client,
&self.imgs,
&self.fonts,
&*i18n,
self.pulse,
2020-07-14 20:11:39 +00:00
&self.rot_imgs,
item_tooltip_manager,
2020-07-14 20:11:39 +00:00
&self.item_imgs,
&inventory,
&msm,
2021-04-04 13:02:27 +00:00
tooltip_manager,
&mut self.show,
2020-07-14 20:11:39 +00:00
)
.set(self.ids.crafting_window, ui_widgets)
{
match event {
2021-04-17 14:58:43 +00:00
crafting::Event::CraftRecipe(recipe) => {
2021-04-17 18:35:48 +00:00
events.push(Event::CraftRecipe {
recipe,
craft_sprite: self.show.craft_sprite,
});
2020-07-14 20:11:39 +00:00
},
crafting::Event::Close => {
self.show.stats = false;
2020-07-14 20:11:39 +00:00
self.show.crafting(false);
if !self.show.social {
self.show.want_grab = true;
self.force_ungrab = false;
} else {
self.force_ungrab = true
};
2020-07-14 20:11:39 +00:00
},
2021-04-04 13:02:27 +00:00
crafting::Event::ChangeCraftingTab(sel_cat) => {
2021-04-17 14:58:43 +00:00
self.show.open_crafting_tab(sel_cat, None);
2021-04-04 13:02:27 +00:00
},
crafting::Event::Focus(widget_id) => {
self.to_focus = Some(Some(widget_id));
},
crafting::Event::SearchRecipe(search_key) => {
self.show.search_crafting_recipe(search_key);
},
2020-07-14 20:11:39 +00:00
}
}
}
}
// Don't put NPC messages in chat box.
self.new_messages
.retain(|m| !matches!(m.chat_type, comp::ChatType::Npc(_, _)));
// Chat box
2021-06-21 19:16:03 +00:00
if global_state.settings.interface.toggle_chat {
for event in Chat::new(
&mut self.new_messages,
&client,
global_state,
self.pulse,
&self.imgs,
&self.fonts,
i18n,
)
.and_then(self.force_chat_input.take(), |c, input| c.input(input))
.and_then(self.tab_complete.take(), |c, input| {
c.prepare_tab_completion(input)
})
.and_then(self.force_chat_cursor.take(), |c, pos| c.cursor_pos(pos))
.set(self.ids.chat, ui_widgets)
{
match event {
chat::Event::TabCompletionStart(input) => {
self.tab_complete = Some(input);
},
chat::Event::SendMessage(message) => {
events.push(Event::SendMessage(message));
},
chat::Event::SendCommand(name, args) => {
events.push(Event::SendCommand(name, args));
},
chat::Event::Focus(focus_id) => {
self.to_focus = Some(Some(focus_id));
},
chat::Event::ChangeChatTab(tab) => {
events.push(Event::SettingsChange(ChatChange::ChangeChatTab(tab).into()));
},
chat::Event::ShowChatTabSettings(tab) => {
self.show.chat_tab_settings_index = Some(tab);
self.show.settings_tab = SettingsTab::Chat;
self.show.settings(true);
},
}
2021-05-14 12:27:15 +00:00
}
}
self.new_messages = VecDeque::new();
2020-06-02 02:42:26 +00:00
self.new_notifications = VecDeque::new();
//Loot
LootScroller::new(
&mut self.new_loot_messages,
client,
&self.show,
&self.imgs,
&self.item_imgs,
&self.rot_imgs,
&self.fonts,
&*i18n,
&msm,
item_tooltip_manager,
self.pulse,
)
.set(self.ids.loot_scroller, ui_widgets);
self.new_loot_messages = VecDeque::new();
// Windows
// Char Window will always appear at the left side. Other Windows default to the
// left side, but when the Char Window is opened they will appear to the right
// of it.
// Settings
if let Windows::Settings = self.show.open_windows {
for event in SettingsWindow::new(
&global_state,
&self.show,
&self.imgs,
&self.fonts,
2020-12-12 22:14:24 +00:00
i18n,
fps as f32,
)
.set(self.ids.settings_window, ui_widgets)
{
match event {
settings_window::Event::ChangeTab(tab) => self.show.open_setting_tab(tab),
settings_window::Event::Close => {
// Unpause the game if we are on singleplayer so that we can logout
#[cfg(feature = "singleplayer")]
global_state.unpause();
self.show.want_grab = true;
self.force_ungrab = false;
self.show.settings(false)
},
2021-05-14 12:27:15 +00:00
settings_window::Event::ChangeChatSettingsTab(tab) => {
self.show.chat_tab_settings_index = tab;
},
settings_window::Event::SettingsChange(settings_change) => {
match &settings_change {
SettingsChange::Interface(interface_change) => match interface_change {
InterfaceChange::ToggleHelp(toggle_help) => {
self.show.help = *toggle_help;
},
InterfaceChange::ToggleDebug(toggle_debug) => {
self.show.debug = *toggle_debug;
},
InterfaceChange::ResetInterfaceSettings => {
self.show.help = false;
self.show.debug = false;
},
_ => {},
},
_ => {},
}
events.push(Event::SettingsChange(settings_change));
2021-03-08 16:24:03 +00:00
},
}
}
}
// Social Window
if self.show.social {
2020-07-27 03:37:09 +00:00
let ecs = client.state().ecs();
2020-08-02 23:53:02 +00:00
let _stats = ecs.read_storage::<comp::Stats>();
2020-07-27 03:37:09 +00:00
let me = client.entity();
2020-08-02 23:53:02 +00:00
if let Some(_stats) = stats.get(me) {
2020-07-27 03:37:09 +00:00
for event in Social::new(
&self.show,
client,
&self.imgs,
&self.fonts,
2020-12-12 22:14:24 +00:00
i18n,
2020-07-27 03:37:09 +00:00
info.selected_entity,
&self.rot_imgs,
tooltip_manager,
2020-07-27 03:37:09 +00:00
)
.set(self.ids.social_window, ui_widgets)
{
match event {
2020-08-02 23:53:02 +00:00
social::Event::Close => {
self.show.social(false);
if !self.show.bag {
self.show.want_grab = true;
self.force_ungrab = false;
} else {
self.force_ungrab = true
};
2020-08-02 23:53:02 +00:00
},
social::Event::Focus(widget_id) => {
self.to_focus = Some(Some(widget_id));
2020-07-27 03:37:09 +00:00
},
social::Event::Invite(uid) => events.push(Event::InviteMember(uid)),
social::Event::SearchPlayers(search_key) => {
self.show.search_social_players(search_key)
},
2020-07-27 03:37:09 +00:00
}
}
}
}
// Diary
if self.show.diary {
let entity = client.entity();
let skill_sets = ecs.read_storage::<comp::SkillSet>();
if let Some(skill_set) = skill_sets.get(entity) {
for event in Diary::new(
&self.show,
client,
&skill_set,
&self.imgs,
&self.item_imgs,
&self.fonts,
i18n,
&self.rot_imgs,
tooltip_manager,
self.pulse,
)
.set(self.ids.diary, ui_widgets)
{
match event {
diary::Event::Close => {
self.show.diary(false);
self.show.want_grab = true;
self.force_ungrab = false;
},
diary::Event::ChangeSkillTree(tree_sel) => {
self.show.open_skill_tree(tree_sel)
},
diary::Event::UnlockSkill(skill) => events.push(Event::UnlockSkill(skill)),
}
}
}
}
// Map
if self.show.map {
2020-11-20 14:01:04 +00:00
for event in Map::new(
2021-05-01 16:26:13 +00:00
&self.show,
client,
&self.imgs,
&self.rot_imgs,
2021-04-06 05:15:42 +00:00
&self.world_map,
&self.fonts,
self.pulse,
2020-12-12 22:14:24 +00:00
i18n,
&global_state,
2020-11-17 20:45:44 +00:00
tooltip_manager,
2021-05-01 16:26:13 +00:00
self.show.location_marker,
)
.set(self.ids.map, ui_widgets)
2019-06-22 14:30:53 +00:00
{
match event {
map::Event::Close => {
self.show.map(false);
self.show.want_grab = true;
2020-11-17 20:45:44 +00:00
self.force_ungrab = false;
},
map::Event::SettingsChange(settings_change) => {
events.push(Event::SettingsChange(settings_change.into()));
2021-03-06 14:55:42 +00:00
},
Implement /price_list (work in progress), stub for /buy and /sell remove outdated economic simulation code remove old values, document add natural resources to economy Remove NaturalResources from Place (now in Economy) find closest site to each chunk implement natural resources (the distance scale is wrong) cargo fmt working distance calculation this collection of natural resources seem to make sense, too much Wheat though use natural resources and controlled area to replenish goods increase the amount of chunks controlled by one guard to 50 add new professions and goods to the list implement multiple products per worker remove the old code and rename the new code to the previous name correctly determine which goods guards will give you access to correctly estimate the amount of natural resources controlled adapt to new server API instrument tooltips Now I just need to figure out how to store a (reference to) a closure closures for tooltip content generation pass site/cave id to the client Add economic information to the client structure (not yet exchanged with the server) Send SiteId to the client, prepare messages for economy request Make client::sites a HashMap Specialize the Crafter into Brewer,Bladesmith and Blacksmith working server request for economic info from within tooltip fully operational economic tooltips I need to fix the id clash between caves and towns though fix overlapping ids between caves and sites display stock amount correctly handle invalid (cave) ids in the request some initial balancing, turn off most info logging less intrusive way of implementing the dynamic tool tips in map further tooltip cleanup further cleanup, dynamic tooltip not fully working as intended correctly working tooltip visibility logic cleanup, display labor value separate economy info request in a separate translation unit display values as well nicer display format for economy add last_exports and coin to the new economy do not allocate natural resources to Dungeons (making town so much larger) balancing attempt print town size statistics cargo fmt (dead code) resource tweaks, csv debugging output a more interesting town (and then all sites) fix the labor value logic (now we have meaningful prices) load professions from ron (WIP) use assets manager in economy loading professions works use professions from ron file fix Labor debug logic count chunks per type separately (preparing for better resource control) better structured resource data traders, more professions (WIP) fix exception when starting the simulation fix replenish function TODO: - use area_ratio for resource usage (chunks should be added to stock, ratio on usage?) - fix trading documentation clean up fix merge artifact Revise trader mechanic start Coin with a reasonable default remove the outdated economy code preserve documentation from removed old structure output neighboring sites (preparation) pass list of neighbors to economy add trade structures trading stub Description of purpose by zesterer on Discord remember prices (needed for planning) avoid growing the order vector unboundedly into_iter doesn't clear the Vec, so clear it manually use drain to process Vecs, avoid clone fix the test server implement a test stub (I need to get it faster than 30 seconds to be more useful) enable info output in test debug missing and extra goods use the same logging extension as water, activate feature update dependencies determine good prices, good exchange goods a working set of revisions a cozy world which economy tests in 2s first order planning version fun with package version buy according to value/priority, not missing amount introduce min price constant, fix order priority in depth debugging with a correct sign the trading plans start to make sense move the trade planning to a separate function rename new function reorganize code into subroutines (much cleaner) each trading step now has its own function cut down the number of debugging output introduce RoadSecurity and Transportation transport capacity bookkeeping only plan to pay with valuable goods, you can no longer stockpile unused options (which interestingly shows a huge impact, to be investigated) Coin is now listed as a payment (although not used) proper transportation estimation (although 0) remove more left overs uncovered by viewing the code in a merge request use the old default values, handle non-pileable stocks directly before increasing it (as economy is based on last year's products) don't order the missing good multiple times also it uses coin to buy things! fix warnings and use the transportation from stock again cargo fmt prepare evaluation of trade don't count transportation multiple times fix merge artifact operational trade planning trade itself is still misleading make clippy happy clean up correct labor ratio of merchants (no need to multiply with amount produced) incomplete merchant labor_value computation correct last commit make economy of scale more explicit make clippy happy (and code cleaner) more merchant tweaks (more pop=better) beginning of real trading code revert the update of dependencies remove stale comments/unused code trading implementation complete (but untested) something is still strange ... fix sign in trading another sign fix some bugfixes and plenty of debugging code another bug fixed, more to go fix another invariant (rounding will lead to very small negative value) introduce Terrain and Territory fix merge mistakes
2021-03-14 03:18:32 +00:00
map::Event::RequestSiteInfo(id) => {
events.push(Event::RequestSiteInfo(id));
},
2021-05-01 16:26:13 +00:00
map::Event::SetLocationMarker(pos) => {
self.show.location_marker = Some(pos);
},
map::Event::ToggleMarker => {
self.show.map_marker = !self.show.map_marker;
},
}
}
2020-11-20 14:01:04 +00:00
} else {
2020-11-18 15:32:37 +00:00
// Reset the map position when it's not showing
let drag = &global_state.settings.interface.map_drag;
2020-11-18 15:32:37 +00:00
if drag.x != 0.0 || drag.y != 0.0 {
events.push(Event::SettingsChange(
InterfaceChange::MapDrag(Vec2::zero()).into(),
))
2020-11-20 14:01:04 +00:00
}
2020-11-18 15:32:37 +00:00
}
if self.show.esc_menu {
2020-12-13 01:09:57 +00:00
match EscMenu::new(&self.imgs, &self.fonts, i18n).set(self.ids.esc_menu, ui_widgets) {
Some(esc_menu::Event::OpenSettings(tab)) => {
self.show.open_setting_tab(tab);
},
Some(esc_menu::Event::Close) => {
self.show.esc_menu = false;
self.show.want_grab = true;
self.force_ungrab = false;
// Unpause the game if we are on singleplayer
#[cfg(feature = "singleplayer")]
global_state.unpause();
},
2019-06-04 20:41:50 +00:00
Some(esc_menu::Event::Logout) => {
// Unpause the game if we are on singleplayer so that we can logout
#[cfg(feature = "singleplayer")]
global_state.unpause();
2019-06-04 20:41:50 +00:00
events.push(Event::Logout);
},
Some(esc_menu::Event::Quit) => events.push(Event::Quit),
Some(esc_menu::Event::CharacterSelection) => {
// Unpause the game if we are on singleplayer so that we can logout
#[cfg(feature = "singleplayer")]
global_state.unpause();
events.push(Event::CharacterSelection)
},
None => {},
}
}
let mut indicator_offset = 40.0;
2020-03-26 21:22:21 +00:00
// Free look indicator
if let Some(freelook_key) = global_state
.settings
.controls
.get_binding(GameInput::FreeLook)
{
if self.show.free_look {
let msg = i18n
.get("hud.free_look_indicator")
.replace("{key}", freelook_key.display_string(key_layout).as_str());
Text::new(&msg)
.color(TEXT_BG)
.mid_top_with_margin_on(ui_widgets.window, indicator_offset)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.free_look_bg, ui_widgets);
indicator_offset += 30.0;
Text::new(&msg)
.color(KILL_COLOR)
.top_left_with_margins_on(self.ids.free_look_bg, -1.0, -1.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.free_look_txt, ui_widgets);
}
};
2020-03-26 21:22:21 +00:00
// Auto walk indicator
if self.show.auto_walk {
2020-12-12 22:14:24 +00:00
Text::new(i18n.get("hud.auto_walk_indicator"))
.color(TEXT_BG)
.mid_top_with_margin_on(ui_widgets.window, indicator_offset)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.auto_walk_bg, ui_widgets);
indicator_offset += 30.0;
2020-12-12 22:14:24 +00:00
Text::new(i18n.get("hud.auto_walk_indicator"))
.color(KILL_COLOR)
.top_left_with_margins_on(self.ids.auto_walk_bg, -1.0, -1.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.auto_walk_txt, ui_widgets);
}
// Camera clamp indicator
if let Some(cameraclamp_key) = global_state
.settings
.controls
.get_binding(GameInput::CameraClamp)
{
if self.show.camera_clamp {
let msg = i18n
.get("hud.camera_clamp_indicator")
.replace("{key}", cameraclamp_key.display_string(key_layout).as_str());
Text::new(&msg)
.color(TEXT_BG)
.mid_top_with_margin_on(ui_widgets.window, indicator_offset)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.camera_clamp_bg, ui_widgets);
Text::new(&msg)
.color(KILL_COLOR)
.top_left_with_margins_on(self.ids.camera_clamp_bg, -1.0, -1.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.camera_clamp_txt, ui_widgets);
}
}
2020-04-04 07:13:51 +00:00
// Maintain slot manager
'slot_events: for event in self.slot_manager.maintain(ui_widgets) {
use comp::slot::Slot;
use slots::{InventorySlot, SlotKind::*};
let to_slot = |slot_kind| match slot_kind {
Inventory(InventorySlot {
slot, ours: true, ..
}) => Some(Slot::Inventory(slot)),
Inventory(InventorySlot { ours: false, .. }) => None,
2020-04-11 06:33:06 +00:00
Equip(e) => Some(Slot::Equip(e)),
Hotbar(_) => None,
Trade(_) => None,
};
2020-04-04 07:13:51 +00:00
match event {
slot::Event::Dragged(a, b) => {
// Swap between slots
if let (Some(a), Some(b)) = (to_slot(a), to_slot(b)) {
events.push(Event::SwapSlots {
slot_a: a,
slot_b: b,
bypass_dialog: false,
});
} else if let (
Inventory(InventorySlot {
slot, ours: true, ..
}),
Hotbar(h),
) = (a, b)
{
self.hotbar.add_inventory_link(h, slot);
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
events.push(Event::ChangeHotbarState(Box::new(self.hotbar.to_owned())));
2020-04-11 06:33:06 +00:00
} else if let (Hotbar(a), Hotbar(b)) = (a, b) {
self.hotbar.swap(a, b);
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
events.push(Event::ChangeHotbarState(Box::new(self.hotbar.to_owned())));
} else if let (Inventory(i), Trade(t)) = (a, b) {
if i.ours == t.ours {
if let Some(inventory) = inventories.get(t.entity) {
events.push(Event::TradeAction(TradeAction::AddItem {
item: i.slot,
quantity: i.amount(inventory).unwrap_or(1),
ours: i.ours,
}));
}
}
} else if let (Trade(t), Inventory(i)) = (a, b) {
if i.ours == t.ours {
if let Some(inventory) = inventories.get(t.entity) {
if let Some(invslot) = t.invslot {
events.push(Event::TradeAction(TradeAction::RemoveItem {
item: invslot,
quantity: t.amount(inventory).unwrap_or(1),
ours: t.ours,
}));
}
}
}
}
2020-04-04 07:13:51 +00:00
},
slot::Event::Dropped(from) => {
// Drop item
if let Some(from) = to_slot(from) {
events.push(Event::DropSlot(from));
2020-04-11 06:33:06 +00:00
} else if let Hotbar(h) = from {
self.hotbar.clear_slot(h);
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
events.push(Event::ChangeHotbarState(Box::new(self.hotbar.to_owned())));
} else if let Trade(t) = from {
if let Some(inventory) = inventories.get(t.entity) {
if let Some(invslot) = t.invslot {
events.push(Event::TradeAction(TradeAction::RemoveItem {
item: invslot,
quantity: t.amount(inventory).unwrap_or(1),
ours: t.ours,
}));
}
}
}
2020-04-04 07:13:51 +00:00
},
2021-03-02 00:08:46 +00:00
slot::Event::SplitDropped(from) => {
// Drop item
if let Some(from) = to_slot(from) {
events.push(Event::SplitDropSlot(from));
} else if let Hotbar(h) = from {
self.hotbar.clear_slot(h);
events.push(Event::ChangeHotbarState(Box::new(self.hotbar.to_owned())));
}
},
slot::Event::SplitDragged(a, b) => {
// Swap between slots
if let (Some(a), Some(b)) = (to_slot(a), to_slot(b)) {
events.push(Event::SplitSwapSlots {
slot_a: a,
slot_b: b,
bypass_dialog: false,
});
} else if let (Inventory(i), Hotbar(h)) = (a, b) {
self.hotbar.add_inventory_link(h, i.slot);
events.push(Event::ChangeHotbarState(Box::new(self.hotbar.to_owned())));
} else if let (Hotbar(a), Hotbar(b)) = (a, b) {
self.hotbar.swap(a, b);
events.push(Event::ChangeHotbarState(Box::new(self.hotbar.to_owned())));
} else if let (Inventory(i), Trade(t)) = (a, b) {
if i.ours == t.ours {
if let Some(inventory) = inventories.get(t.entity) {
events.push(Event::TradeAction(TradeAction::AddItem {
item: i.slot,
quantity: i.amount(inventory).unwrap_or(1) / 2,
ours: i.ours,
}));
}
}
} else if let (Trade(t), Inventory(i)) = (a, b) {
if i.ours == t.ours {
if let Some(inventory) = inventories.get(t.entity) {
if let Some(invslot) = t.invslot {
events.push(Event::TradeAction(TradeAction::RemoveItem {
item: invslot,
quantity: t.amount(inventory).unwrap_or(1) / 2,
ours: t.ours,
}));
}
}
}
2021-03-02 00:08:46 +00:00
}
},
slot::Event::Used(from) => {
// Item used (selected and then clicked again)
if let Some(from) = to_slot(from) {
events.push(Event::UseSlot {
slot: from,
bypass_dialog: false,
});
2020-04-11 06:33:06 +00:00
} else if let Hotbar(h) = from {
// Used from hotbar
2020-04-11 06:33:06 +00:00
self.hotbar.get(h).map(|s| {
match s {
hotbar::SlotContents::Inventory(i) => {
events.push(Event::UseSlot {
slot: comp::slot::Slot::Inventory(i),
bypass_dialog: false,
});
2020-04-11 06:33:06 +00:00
},
hotbar::SlotContents::Ability3 | hotbar::SlotContents::Ability4 => {
}, /* Event::Ability3(true),
* sticks */
2020-04-11 06:33:06 +00:00
}
});
}
2020-04-04 07:13:51 +00:00
},
slot::Event::Request {
slot,
auto_quantity,
} => {
if let Some((_, trade, prices)) = client.pending_trade() {
let ecs = client.state().ecs();
let inventories = ecs.read_component::<common::comp::Inventory>();
let get_inventory = |uid: Uid| {
if let Some(entity) = ecs.entity_from_uid(uid.0) {
inventories.get(entity)
} else {
None
}
};
let mut r_inventories = [None, None];
for (i, party) in trade.parties.iter().enumerate() {
match get_inventory(*party) {
Some(inventory) => {
r_inventories[i] = Some(ReducedInventory::from(inventory))
},
None => continue 'slot_events,
};
}
let who = match ecs
.uid_from_entity(client.entity())
.and_then(|uid| trade.which_party(uid))
{
Some(who) => who,
None => continue 'slot_events,
};
let do_auto_quantity =
|inventory: &common::comp::Inventory,
slot,
ours,
remove,
quantity: &mut u32| {
if let Some(prices) = prices {
let balance0 =
prices.balance(&trade.offers, &r_inventories, who, true);
let balance1 = prices.balance(
&trade.offers,
&r_inventories,
1 - who,
false,
);
if let Some(item) = inventory.get(slot) {
let (material, factor) =
TradePricing::get_material(item.item_definition_id());
let mut unit_price = prices
.values
.get(&material)
.cloned()
.unwrap_or_default()
* factor;
if ours {
unit_price *= material.trade_margin();
}
let mut float_delta = if ours ^ remove {
(balance1 - balance0) / unit_price
} else {
(balance0 - balance1) / unit_price
};
if ours ^ remove {
float_delta = float_delta.ceil();
} else {
float_delta = float_delta.floor();
}
*quantity = float_delta.max(0.0) as u32;
}
}
};
match slot {
Inventory(i) => {
if let Some(inventory) = inventories.get(i.entity) {
let mut quantity = 1;
if auto_quantity {
do_auto_quantity(
inventory,
i.slot,
i.ours,
false,
&mut quantity,
);
let inv_quantity = i.amount(inventory).unwrap_or(1);
quantity = quantity.min(inv_quantity);
}
events.push(Event::TradeAction(TradeAction::AddItem {
item: i.slot,
quantity,
ours: i.ours,
}));
}
},
Trade(t) => {
if let Some(inventory) = inventories.get(t.entity) {
if let Some(invslot) = t.invslot {
let mut quantity = 1;
if auto_quantity {
do_auto_quantity(
inventory,
invslot,
t.ours,
true,
&mut quantity,
);
let inv_quantity = t.amount(inventory).unwrap_or(1);
quantity = quantity.min(inv_quantity);
}
events.push(Event::TradeAction(TradeAction::RemoveItem {
item: invslot,
quantity,
ours: t.ours,
}));
}
}
},
_ => {},
}
}
},
2020-04-04 07:13:51 +00:00
}
}
2020-04-11 06:33:06 +00:00
self.hotbar.maintain_ability3(client);
self.hotbar.maintain_ability4(client);
2020-04-04 07:13:51 +00:00
events
}
pub fn add_failed_block_pickup(&mut self, pos: Vec3<i32>) {
self.failed_block_pickups.insert(pos, self.pulse);
}
pub fn add_failed_entity_pickup(&mut self, entity: EcsEntity) {
self.failed_entity_pickups.insert(entity, self.pulse);
}
pub fn new_loot_message(&mut self, item: LootMessage) {
self.new_loot_messages.push_back(item);
}
2020-06-02 02:42:26 +00:00
pub fn new_message(&mut self, msg: comp::ChatMsg) { self.new_messages.push_back(msg); }
pub fn new_notification(&mut self, msg: Notification) { self.new_notifications.push_back(msg); }
pub fn set_scaling_mode(&mut self, scale_mode: ScaleMode) {
self.ui.set_scaling_mode(scale_mode);
}
2019-07-26 02:28:53 +00:00
pub fn scale_change(&mut self, scale_change: ScaleChange) -> ScaleMode {
let scale_mode = match scale_change {
ScaleChange::Adjust(scale) => ScaleMode::Absolute(scale),
ScaleChange::ToAbsolute => self.ui.scale().scaling_mode_as_absolute(),
ScaleChange::ToRelative => self.ui.scale().scaling_mode_as_relative(),
};
self.ui.set_scaling_mode(scale_mode);
scale_mode
}
// Checks if a TextEdit widget has the keyboard captured.
fn typing(&self) -> bool {
if let Some(id) = self.ui.widget_capturing_keyboard() {
self.ui
.widget_graph()
.widget(id)
.filter(|c| {
c.type_id == std::any::TypeId::of::<<widget::TextEdit as Widget>::State>()
})
.is_some()
} else {
false
}
}
pub fn handle_event(&mut self, event: WinEvent, global_state: &mut GlobalState) -> bool {
2020-04-11 06:33:06 +00:00
// Helper
fn handle_slot(
slot: hotbar::Slot,
state: bool,
events: &mut Vec<Event>,
slot_manager: &mut slots::SlotManager,
hotbar: &mut hotbar::State,
) {
use slots::InventorySlot;
if let Some(slots::SlotKind::Inventory(InventorySlot {
slot: i,
ours: true,
..
})) = slot_manager.selected()
{
hotbar.add_inventory_link(slot, i);
events.push(Event::ChangeHotbarState(Box::new(hotbar.to_owned())));
2020-04-11 06:33:06 +00:00
slot_manager.idle();
} else {
let just_pressed = hotbar.process_input(slot, state);
hotbar.get(slot).map(|s| match s {
hotbar::SlotContents::Inventory(i) => {
if just_pressed {
events.push(Event::UseSlot {
slot: comp::slot::Slot::Inventory(i),
bypass_dialog: false,
});
2020-04-11 06:33:06 +00:00
}
},
hotbar::SlotContents::Ability3 => events.push(Event::Ability3(state)),
hotbar::SlotContents::Ability4 => events.push(Event::Ability4(state)),
2020-04-11 06:33:06 +00:00
});
}
}
fn handle_map_zoom(
factor: f64,
world_size: Vec2<u32>,
show: &Show,
global_state: &mut GlobalState,
) -> bool {
let max_zoom = world_size.reduce_partial_max() as f64;
if show.map {
let new_zoom_lvl = (global_state.settings.interface.map_zoom * factor)
.clamped(1.25, max_zoom / 64.0);
global_state.settings.interface.map_zoom = new_zoom_lvl;
global_state.settings.save_to_file_warn();
} else if global_state.settings.interface.minimap_show {
let new_zoom_lvl = global_state.settings.interface.minimap_zoom * factor;
global_state.settings.interface.minimap_zoom = new_zoom_lvl;
global_state.settings.save_to_file_warn();
}
show.map && global_state.settings.interface.minimap_show
}
let cursor_grabbed = global_state.window.is_cursor_grabbed();
let handled = match event {
WinEvent::Ui(event) => {
if (self.typing() && event.is_keyboard() && self.show.ui)
|| !(cursor_grabbed && event.is_keyboard_or_mouse())
{
self.ui.handle_event(event);
}
true
},
WinEvent::ScaleFactorChanged(scale_factor) => {
self.ui.scale_factor_changed(scale_factor);
false
},
WinEvent::InputUpdate(GameInput::ToggleInterface, true) if !self.typing() => {
self.show.toggle_ui();
true
},
WinEvent::InputUpdate(GameInput::ToggleCursor, true) if !self.typing() => {
self.force_ungrab = !self.force_ungrab;
true
},
WinEvent::InputUpdate(GameInput::AcceptGroupInvite, true) if !self.typing() => {
if let Some(prompt_dialog) = &mut self.show.prompt_dialog {
prompt_dialog.set_outcome_via_keypress(true);
true
} else {
false
}
},
WinEvent::InputUpdate(GameInput::DeclineGroupInvite, true) if !self.typing() => {
if let Some(prompt_dialog) = &mut self.show.prompt_dialog {
prompt_dialog.set_outcome_via_keypress(false);
true
} else {
false
}
},
// If not showing the ui don't allow keys that change the ui state but do listen for
// hotbar keys
WinEvent::InputUpdate(key, state) if !self.show.ui => {
if let Some(slot) = try_hotbar_slot_from_input(key) {
handle_slot(
slot,
state,
&mut self.events,
&mut self.slot_manager,
&mut self.hotbar,
);
true
} else {
false
}
},
WinEvent::Zoom(_) => !cursor_grabbed && !self.ui.no_widget_capturing_mouse(),
2020-08-12 18:10:18 +00:00
WinEvent::InputUpdate(GameInput::Chat, true) => {
self.ui.focus_widget(if self.typing() {
None
} else {
Some(self.ids.chat)
});
true
},
WinEvent::InputUpdate(GameInput::Escape, true) => {
if self.typing() {
self.ui.focus_widget(None);
2021-03-25 00:42:14 +00:00
} else if self.show.trade {
self.events.push(Event::TradeAction(TradeAction::Decline));
} else {
// Close windows on esc
self.show.toggle_windows(global_state);
}
true
},
// Press key while not typing
WinEvent::InputUpdate(key, state) if !self.typing() => {
let matching_key = match key {
GameInput::Command if state => {
self.force_chat_input = Some("/".to_owned());
self.force_chat_cursor = Some(Index { line: 0, char: 1 });
self.ui.focus_widget(Some(self.ids.chat));
true
},
GameInput::Map if state => {
self.show.toggle_map();
true
},
GameInput::Bag if state => {
self.show.toggle_bag();
true
},
GameInput::Social if state => {
self.show.toggle_social();
true
},
GameInput::Crafting if state => {
self.show.toggle_crafting();
true
},
GameInput::Spellbook if state => {
self.show.toggle_spell();
true
},
GameInput::Settings if state => {
self.show.toggle_settings(global_state);
true
},
GameInput::Help if state => {
self.show.toggle_settings(global_state);
self.show.settings_tab = SettingsTab::Controls;
true
},
GameInput::ToggleDebug if state => {
global_state.settings.interface.toggle_debug =
!global_state.settings.interface.toggle_debug;
self.show.debug = global_state.settings.interface.toggle_debug;
true
},
GameInput::ToggleIngameUi if state => {
self.show.ingame = !self.show.ingame;
true
},
GameInput::MapZoomIn if state => {
handle_map_zoom(2.0, self.world_map.1, &self.show, global_state)
},
GameInput::MapZoomOut if state => {
handle_map_zoom(0.5, self.world_map.1, &self.show, global_state)
},
// Skillbar
input => {
if let Some(slot) = try_hotbar_slot_from_input(input) {
handle_slot(
slot,
state,
&mut self.events,
&mut self.slot_manager,
&mut self.hotbar,
);
true
} else {
false
}
},
};
// When a player closes all menus, resets the cursor
// to the center of the screen
self.show
.toggle_cursor_on_menu_close(global_state, &mut self.ui);
matching_key
},
// Else the player is typing in chat
WinEvent::InputUpdate(_key, _) => self.typing(),
WinEvent::Char(_) => self.typing(),
WinEvent::Focused(state) => {
self.force_ungrab = !state;
true
},
WinEvent::Moved(_) => {
// Prevent the cursor from being grabbed while the window is being moved as this
// causes the window to move erratically
// TODO: this creates an issue where if you move the window then you need to
// close a menu to re-grab the mouse (and if one isn't already
// open you need to open and close a menu)
self.show.want_grab = false;
true
},
_ => false,
};
// Handle cursor grab.
global_state
.window
.grab_cursor(!self.force_ungrab && self.show.want_grab);
handled
}
#[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587
pub fn maintain(
&mut self,
client: &Client,
global_state: &mut GlobalState,
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
debug_info: &Option<DebugInfo>,
camera: &Camera,
dt: Duration,
2020-05-18 22:40:28 +00:00
info: HudInfo,
interactable: Option<Interactable>,
) -> Vec<Event> {
span!(_guard, "maintain", "Hud::maintain");
// conrod eats tabs. Un-eat a tabstop so tab completion can work
if self.ui.ui.global_input().events().any(|event| {
use conrod_core::{event, input};
matches!(
event,
/* event::Event::Raw(event::Input::Press(input::Button::Keyboard(input::Key::
* Tab))) | */
event::Event::Ui(event::Ui::Press(_, event::Press {
button: event::Button::Keyboard(input::Key::Tab),
..
},))
)
}) {
self.ui
.ui
.handle_event(conrod_core::event::Input::Text("\t".to_string()));
}
2021-04-17 22:27:42 +00:00
// Stop selecting a sprite to perform crafting with when out of range
self.show.craft_sprite = self.show.craft_sprite.filter(|(pos, _)| {
self.show.crafting
&& if let Some(player_pos) = client.position() {
pos.map(|e| e as f32 + 0.5).distance(player_pos) < MAX_PICKUP_RANGE
} else {
false
}
});
// Optimization: skip maintaining UI when it's off.
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
if !self.show.ui {
2020-10-15 12:47:29 +00:00
return std::mem::take(&mut self.events);
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
}
if let Some(maybe_id) = self.to_focus.take() {
self.ui.focus_widget(maybe_id);
}
let events = self.update_layout(
client,
global_state,
debug_info,
dt,
info,
camera,
interactable,
);
let camera::Dependents {
view_mat, proj_mat, ..
} = camera.dependents();
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
let focus_off = camera.get_focus_pos().map(f32::trunc);
2019-10-09 19:28:05 +00:00
// Check if item images need to be reloaded
self.item_imgs.reload_if_changed(&mut self.ui);
// TODO: using a thread pool in the obvious way for speeding up map zoom results
// in flickering artifacts, figure out a better way to make use of the
// thread pool
let _pool = client.state().ecs().read_resource::<SlowJobPool>();
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
self.ui.maintain(
&mut global_state.window.renderer_mut(),
None,
//Some(&pool),
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf --- Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge). At a high level this MR incorporates roughly two groups of changes. The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff. The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions (coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably changes (TODO: Fill in this section when it's complete). The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a handful of people, so I recommend that this code be reviewed particularly carefully. --- At a high level (each will be described in more detail below): - The world map has been refactored. - The world size is no longer hardcoded (@zesterer). - The map generation code was made generic to allow using it outside of the `world` crate (@zesterer). - On world creation, we now compute *horizon maps* (@zesterer). - The way we pass the world from the server to the client has been updated (@xMAC94x). - Artifacts related to image rotation were fixed (@imbris). - Multiflow rivers were enabled (@zesterer). - In the process of making changes related to the world map, various incidental fixes and optimizations were required. - The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest). - A new LOD terrain rendering step was added to the pipeline. - The LOD terrain quality was made configurable via a graphics setting. - Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain. - A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out). - A semi-accurate index of refraction was assigned to our materials. - A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF. - We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure. - We attempt to compute *realistic light attenuation* in water using its real material properties. - In the process of making changes related to LOD, various incidental fixes and optimizations were required. - Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo) - Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*. - Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*. - "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing. - In the process of making changes related to shadow maps, various incidental fixes and optimizations were required. The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other changes happening in master. Therefore, a large number of performance improvements were also needed: - The graphics options were made much more flexible and configurable, and shaders were optimize. - New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer). - Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris). - Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo). - In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required. - Voxel model creation was switched to use *greedy meshing.* - A new voxel meshing method, greedy meshing, was added (@imbris). - Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge). - New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer). - Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - Animation and terrain math were switched to use SIMD where possible. - Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris). - The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge). - Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge). - Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge). - Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris). - SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x). - In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required. - The way we cache glyphs was completely refactored, fixed, and optimized. - Our fork of `conrod` was optimized in various ways (@imbris). - Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris). - Our use of the glyph cache was rewritten for correctness (@imbris). - A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris). - Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge). - In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required. - Colors were changed to keep Veloren's look consistent with master. - Some older tree models were brought back (@Pfauenauge). - TODO(@Sharp): All hardcoded colors were extracted and made hotloadable. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style. - TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style. A detailed description of the involved changes follows. --- - The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes. - The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details. - On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`. Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk. Support for horizon maps has been merged into the map functionality in common as well. - The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing. - Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well: ``` Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). ``` - Multiflow rivers were enabled. This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it. We already computed multiple outflows from each chunk for erosion purposes long before this MR. However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers. Now that - In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code. This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`. The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping). - Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer) - Calls to power or trig functions were removed or replaced with multiplications, where possible. - After some deliberation - To properly handle sprite "waving" for nearby sprites, We explicitly designed the greedy meshing system with figures and sprites in mind. In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so they can be packed into some specific subtexture). For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for shrinking the sprite vertex size. For figures, we pack all the textures for each *model* into the same atlas. is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations. This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure that takes the `ColLightsInfo` that it is supposed to write to as context) onto a onto a vector resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the - Matrix multiplications in the shader were reduced for figure data (@zesterer). - Vertex "waves" for fluid data were removed. - Terrain "bending" near edges was removed. - Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data, rather than sharing it, to let it be used with meshing. - Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`. - PositionedGlyph::standalone. --- I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions] where I needed features from elsewhere but I am particularly grateful for the following resources, esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were obtained through legal means). [^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419. [^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina. [^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152. [^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017. [^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>. [^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>. I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR. --- Squashed commit of the following: commit 300505e7305a2fdac722a808ee8538323f215f39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 18:46:25 2020 +0200 Fixing cargo doc and typo in CHANGELOG. commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 15:38:50 2020 +0200 Hopefully final commit for the LOD branch. commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 10:14:26 2020 +0200 Falling back to power as stopgap. commit e44a1cbf46504ee9931a01bdc9033e145500d557 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 09:25:41 2020 +0200 Address imbris feedback. Temporarily disables shiny water, lowers max VD. These restrictions will be lifted soon after merging. commit 561e25778a108ac3712f5ec2ce3a51234c4430d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 08:31:13 2020 +0200 Tweaking shaders a bit. commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:59:43 2020 +0200 Fix view example as well. commit 051cd4934e0fad2c0b15db4380a4189fa318679f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 07:29:06 2020 +0200 Fix meshing benchmark. commit c95e07db3b4dcca285678985e65e31b927cb1c61 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 05:46:22 2020 +0200 Address MR feedback, fix scene clouds. commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:39:36 2020 +0200 Incorporating Pfau's figure color changes. New eyes and new humanoid colors. commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469 Merge: e2f5162e4 62c53963a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:29:41 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 20 04:28:38 2020 +0200 World colors are all hotloadable. They live in assets/world/style/colors.ron. Only a small handful of hardcoed colors remain in World; they are either part of the map, or difficult to disentangle from the rest of the computation. Comments are made where appropriate. commit 62c53963abe1975009d34a8f9515a355bef24f31 Author: Marcel Märtens <marcel.cochem@googlemail.com> Date: Wed Aug 19 15:59:00 2020 +0200 replace pretty_env_logger with tracing commit 5b1625f99d9586fe80e2232f583ec5af9f953099 Merge: d71003acd 4942b5b39 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:15:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit d71003acdabeff970b3928e97c26af6847b5b78e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 19 05:14:34 2020 +0200 Hotloading colors, part 1: colors in common. Currently, this just entails humanoid colors. There are only three colors not handled; the light emitter colors in common/src/comp/inventory/item/tool.rs. These don't seem important enough to me to warrant making hotloadable, at least not right now, but if it's needed later we can always add them to the file. commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d Merge: c32b337a4 6d2c4b9c1 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 13:05:37 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c32b337a46e10d9de473d178a94a3ccd61c39bb3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:52:04 2020 +0200 Fixing LOD grid, for real. commit a166ae0360395387e09fb35a1f84210c2ce5ec24 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 17 05:28:05 2020 +0200 Addressing imbris's initial feedback. Fixes two minor bugs: explosion particles were no longer spawning randomly, and LOD grids were not perfectly even. commit 4cbad004f44060994252dd3d38647a14a589712f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:27:58 2020 +0200 Bumping nightly per request. commit 548680276aac77c25d43d16b5622f847d474dbef Merge: acc098604 8f8b20c91 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 16 19:26:06 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit acc0986040589a3492f88a740bc3c3fc693b26d3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:28:32 2020 +0200 Lower resolution due to lying drivers. commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 22:15:38 2020 +0200 Fix issues msh encountered with Intel 4600. commit 10245e0c1b0cb6fae10d86409435364edc6102ef Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 15 21:15:02 2020 +0200 Merge more models into one mesh than we did previously. commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a Merge: 7204cc8a7 3c199280e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:35:22 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 22:34:43 2020 +0200 Fix not yet done NPC animations. This forces them all to be the idle animation if not specified. This fixes issues where you'd have giant NPCs in water. commit bc83360f2a08918f19d417b5f772e1ff554dba08 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 19:36:37 2020 +0200 Try to fix some bugs: - Z fighting with LOD terrain and water. - Audio SFX not playing. commit 1fd104aa603bf3781b6526a5cada46aeca3049dd Merge: 862df3c99 7c2c392a3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 12:02:31 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 862df3c9976c4da9bd7cfd784f1a85973127968a Merge: 0a4218ed9 75c1d4401 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 13 05:52:56 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 22:27:14 2020 +0200 Fix particle depth. commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875 Merge: c6251a956 5e6dc0471 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:19:04 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit c6251a956ad376400dca5c23420cf8d213dc8fdf Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 20:15:46 2020 +0200 Cache figures more intelligently. Cache figures for longer, and don't cache character states for the player except where they actually affect the rendered model. commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d Merge: c11b9bdf0 eea64f78f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 16:32:24 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Aug 12 11:47:15 2020 +0200 Remove unneeded Clippy annotation. commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Aug 8 00:53:02 2020 +0200 Fix hotloading and Clippy. commit 3dc973e0be5b758da1e9805eb764ad401374cd0c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 23:50:27 2020 +0200 Major speedups with SIMD. commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae Merge: 76429d00e d1e10b178 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:19 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 76429d00eea00d212fbd672a84ee91e75b19b938 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 13:23:10 2020 +0200 Add clippy.toml. commit c79f512f84dbb83cb82b7954db68ff241dfd8e41 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 11:55:20 2020 +0200 Fix all clippy issues, clean up Rust code. commit 6f90e010b3fbefb53b0d632e819931350015b6b8 Merge: 77a8c7c26 5929cfa5c Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:30 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4 Merge: b44e44232 44febaabd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Aug 7 06:47:10 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 5929cfa5c713aa392110bbb62407f76caf53c3df Author: jshipsey <jshipsey18@gmail.com> Date: Thu Aug 6 20:47:27 2020 -0400 fixed in-hand arrow bug commit b44e442325d828f1cd564d66908f89d09e80474b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Aug 6 13:40:35 2020 +0200 Miscellaneous performance improvements. commit be37acf287c1360d8085862526ac3365ffd1d768 Merge: 125d7fc6c c11876547 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 05:49:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Aug 3 04:55:31 2020 +0200 Abstract over simd vs. repr_c vectors. Also some minor improvements to Event size. commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23 Merge: 5f3b7294a aced5f979 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:56:54 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 5f3b7294af1f8533edc2620b58863c248e2b07af Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:43:52 2020 +0200 Fix formatting issues I missed before. commit a428a3ebba70dcab63dd0f8cd983120c90617271 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Aug 2 20:41:51 2020 +0200 Fix clippy warnings, part 1. There aer still a bunch of type too complex and function takes too many arguments warnings that I'll fix later (or ignore, since in the one case I did fix a function takes too many arguments warning I think it made the code *less* readable). commit ba54307540ed8a937ac08209730284fc653af85b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 30 13:22:42 2020 +0200 Fix light animations so they are removed when the light turns off. commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 21:10:20 2020 +0200 Fix crash in edge case for pixel art. commit 56da06f7a351e2b949e9b014a90b974d511a0924 Merge: cf74d55f2 9f53a4a19 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:56:52 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 29 18:29:52 2020 +0200 Fix map image artifacts and remove unneeded allocations. Specifically, we address three concerns (the image stretching during rotation, artifacts around the image due to clamping to the nearest border color when the image is drawn to a larger space than the image itself takes up, and potential artifacts around a rotated image which accidentally ended up in an atlas and didn't have enough extra space to guarantee the rotation would work). The first concern was addressed by fixing the dimensions of the map images drawn from the UI (so that we always use a square source rectangle, rather than a rectangular one according to the dimensions of the map). We also fixed the way rotation was done in the fragment shader for north-facing sources to make it properly handle aspect ratio (this was already done for north-facing targets). Together, these fix rendering issues peculiar to rectangular maps. The second and third concerns were jointly addressed by adding an optional border color to every 2D image drawn by the UI. This turns out not to waste extra space even though we hold a full f32 color (to avoid an extra dependency on gfx's PackedColor), since voxel images already take up more space than Optiion<[f32; 4]> requires. This is then implemented automatically using the "border color" wrapping method in the attached sampler. Since this is implemented in graphics hardware, it only works (at least naively) if the actual image bounds match the texture bounds. Therefore, we altered the way the graphics cache stores images with a border color to guarantee that they are always in their own texture, whose size exactly matches their extent. Since the easiest currently exposed way to set a border color is to do so for an immutable texture, we went a bit further and added a new "immutable" texture storage type used for these cases; currently, it is always and automatically used only when there is a specified border color, but in theory there's no reason we couldn't provide immutable-only images that use the default wrapping mdoe (though clamp to border is admittedly not a great default). To fix the maps case specifically, we set the border color to a translucent version of the ocean border color. This may need tweaking going forward, which shouldn't be hard. As part of this process, we had to modify graphics replacement to make sure immutable images are *removed* when invalidated, rather than just having a validity flag unset (this is normally done by the UI to try to reuse allocations in place if images are updated in benign ways, since the texture atlases used for Ui do not support deallocation; currently this is only used for item images, so there should be no overlap with immutable image replacement, so this was purely precautionary). Since we were already touching the relevant code, we also updated the image dependency to a newer version that provides more ways to avoid allocations, and made a few other changes that should hopefully eliminate redundant most of the intermediate buffer allocations we were performing for what should be zero-cost conversions. This may slightly improve performance in some cases. commit ad18ce939940a8c697270f6e9b94db9942fd8295 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 13:21:09 2020 +0200 Fix continent scale hack. commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 12:11:40 2020 +0200 Enable loading different sized maps without a recompile. We may want to tweak the effects of the continent_scale_hack. commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 28 10:55:48 2020 +0200 Removing WORLD_SIZE, part 1. Erased almost every instance of WORLD_SIZE and replaced it with a local power of two, map_size_lg (which respects certain invariants; see common/src/terrain/map.rs for more details about MapSizeLg). This also means we can avoid a dependency on the world crate from client, as desired. Now that the rest of the code is not expecting a fixed WORLD_SIZE, the next step is to arrange for maps to store their world size, and to use that world size as a basis prior to loading the map (as well, probably, as prior to configuring some of the noise functions). commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78 Merge: 7d56ba31b 1377b369f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:58 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 7d56ba31b445441461b28a07fc495d7d4f047c17 Merge: 2101113b4 598f14b25 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Jul 27 13:16:27 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 1377b369f6db2258e910d467a5740f31789e3ded Author: Monty Marz <m.marzouq@gmx.de> Date: Sun Jul 19 23:25:38 2020 +0200 more saturated pumpkins commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d Author: Monty Marz <m.marzouq@gmx.de> Date: Sat Jul 18 20:29:56 2020 +0200 acacia models commit 2101113b467e691de787392d7f20f1745f5637bd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 18 18:55:25 2020 +0200 Higher detail LOD. commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 16 01:57:39 2020 +0200 Revert some irrelevant stuff. commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 15 13:30:49 2020 +0200 Fixing various things about shadows. * Correcting optimal LISPSM parameter. * Figure shadows are cast when they're not visible. * Chunk shadows stay cast until you look away. * Seamless cubemaps for point lights. * Etc. commit 6c31e6b56217274285b597af297036691ea5d897 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 19:50:26 2020 +0200 Fix shadow creation. commit 6332cbe006115ae205597529cd8bbccd146c2cca Merge: be438657c 930e0028b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:47:00 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit be438657c33d7b5bfb0a9582c3ed3fd366637323 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Jul 12 18:28:08 2020 +0200 Tweaks to shadows. Added shadow map resolution configuration, added seamless cubemaps, documented all existing rendering options, and fixed a few Clippy errors. commit 23b4058906013c7d2a40c286e20e32c5fbd897ed Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 10:11:19 2020 +0200 Fix moon, use nonlinear noise for terrain. Note that the latter has a bit of performance cost. commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:23:02 2020 +0200 Address lies about max texture size. commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9 Merge: 75e3626a7 18a08e8fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:22:08 2020 +0200 Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Jul 8 02:21:52 2020 +0200 OpenGL 3.3 minimum. commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b Author: Monty Marz <m.marzouq@gmx.de> Date: Tue Jul 7 23:57:52 2020 +0200 settings localization commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 21:11:48 2020 +0200 Lower near distance. commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 20:09:01 2020 +0200 All sprites sway in the wind now. commit db1401a6910bf42dcf502462c90038752ff5fbdb Merge: 69e508d8c e8b4b29d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 19:34:17 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 69e508d8c94d8973033817ca86f357e466fc7c4d Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Jul 7 18:41:37 2020 +0200 Make it easy to switch to SIMD for math. commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 21:21:12 2020 +0200 Fix some issues with underwater rendering. commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 19:17:59 2020 +0200 Fix some minor display issues. commit 0ed752e087968cf901301884aaeae698e32ef8a5 Merge: ccc6a06a8 518edcb85 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:14:21 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 18:04:34 2020 +0200 Some minor changes. commit 4e020246702889269efe1a191788992164c508d6 Merge: 50a64d927 e05c9267a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 16:17:40 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Jul 4 13:07:03 2020 +0200 Fix far plane. commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:25:35 2020 +0200 Add shadows.glsl. commit 618a18c998778bf871b905a74657440fcc384c80 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Jul 2 22:10:22 2020 +0200 Adding shadows, greedy meshing, and more. commit eaea83fe6a5cb1cb0ba8beef888183c718258496 Merge: 267018495 2f89b863e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 22:47:07 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 21:20:01 2020 +0200 Make civsim and sites deterministic. For anything in worldgen where you use a HashMap, *please* think carefully about which hasher you are going to use! This is especially true if (for some reason) you are depending on hashmap iteration order remaining stable for some aspect of worldgen. commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343 Merge: 654f7e049 cdee191dd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu May 21 17:53:57 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 654f7e049258d9da27c09608bbe6a46ffa8787e5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed May 20 21:22:30 2020 +0200 Correct backface culling. commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue May 19 17:22:06 2020 +0200 Greedy messhing for shadows. commit a4d87e1875ca543436e6bbbeb20348facc5a52d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun May 17 05:59:00 2020 +0200 Shadow maps work for lantern. commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8 Merge: 04382dc28 71dd520cd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:53:13 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 04382dc28632b6c66e8821f6870c0daaa1c1901a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 15 14:22:17 2020 +0200 WIP: better graphics config, better LOD, shadow maps. commit 22ddbad3eb32bfa70f0932176022208fe67ded81 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 18:54:09 2020 +0200 Minor shader fixes. commit 746a10e8d01ac235f994b0cde78fa48998602a1f Merge: 0f4a0e763 40ab94673 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat May 2 04:02:09 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 0f4a0e763db3afbdc4fb0558611f38326ca87151 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 23:03:24 2020 +0200 Switch back to pop-in terrain. commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri May 1 22:58:55 2020 +0200 LOD shading closer to voxel shading. commit ef67bd58ba0bdaf622b078892d768263b6cba268 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 28 20:49:03 2020 +0200 Experimental underwater lighting. commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9 Merge: 748279835 303967a6f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 22:35:24 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 7482798354eda18c8207950080fc24d443a369de Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 21:59:55 2020 +0200 Replace discard in figure-frag. commit d83b4ae69be4912f69bf7835f509c68a1c7770a4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:45:57 2020 +0200 Fix sprite lighting, HDR from focus_pos. commit 0594238004f116274905fa0ed7c2b6c417ed1d29 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 18:14:10 2020 +0200 Proper HDR from point lights. commit 48c93d2b41ce5743103d18e76cc228f5ac766492 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 14:01:43 2020 +0200 Brighter ambiance, darker LOD shadows. commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 13:13:23 2020 +0200 More proper HDR. commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 27 00:13:10 2020 +0200 Trying LOD noise. commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 23:11:08 2020 +0200 Fix LOD heights in towns. commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sun Apr 26 21:01:23 2020 +0200 More LOD fixes. commit 8116b21c2e51c836e77894e309ac273caf2917b3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:54:43 2020 +0200 I like this coloring. commit bc2560ea90b36f4b46190005344232d993043ac3 Merge: 14effdd5d e690efe71 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 23:48:33 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:24:35 2020 +0200 Re-saturate. commit 48a643955d4435b78179acba0beb4a979905cc31 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 22:23:57 2020 +0200 Various fixes. commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 03:22:49 2020 +0200 Render figures again. commit 44e4aad48deba8266b9f8bdfd3db096b381f5327 Merge: e6f0a5a98 9ec319a18 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 25 02:01:04 2020 +0200 Merge remote-tracking branch 'origin/master' into sharp/small-fixes commit e6f0a5a981a82533ba188fff0a54ce98577bb152 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 24 16:12:20 2020 +0200 Add atmospheric scattering. commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 23 00:01:20 2020 +0200 Fix shadowing for specular reflections. commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Wed Apr 22 22:56:12 2020 +0200 HDR fixes. commit 1015e60deef3c447381996277df7496707a63bd0 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Tue Apr 21 18:25:19 2020 +0200 More lighting changes. commit 80c264abd111fb237e57843efcb5c071d4f84613 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Mon Apr 13 00:29:59 2020 +0200 Lighting experiments. commit 8414987e589dd5102bad89762a3adaccc0bfe957 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 9 02:38:40 2020 +0200 WIP -- lighting changes and soft shadows. commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a Merge: c7ea687eb 8b149ad11 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:29 2020 +0200 Merge branch 'sharp/new-lighting' into sharp/small-fixes commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a Merge: 476441531 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:33:02 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes commit 8b149ad11ad4bb75018fcf9519baec27d1c95951 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Sat Apr 4 02:32:39 2020 +0200 Trying out a new lighting model. commit b0ac9f36f755dd06f7c17c46150568064790864f Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 07:56:11 2020 +0200 Use bicubic interpolation for terrain. commit f6fc9307a121514b614bc50ef8eb055953e7da8a Merge: 33140a295 22f3319b4 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 05:01:41 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 4764415312aae6e9ac2d00e86e84577cb958f1ab Merge: ed2d0111d 13388ee6a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Apr 3 04:54:48 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 13388ee6a42943f3f79a9cb488346cef18e272fe Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 20:30:08 2020 +0200 Various fixes (to coloring and to soft shadows). commit fbd084a94a067082a87cd6d28b82054709bc9265 Merge: 5a089863b 4fdf6896a Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 18:50:38 2020 +0200 Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 06:49:27 2020 +0200 Combining colors and LOD. commit 88342640c6b835114d01c797b89fdede3b0a2108 Merge: 33140a295 5a089863b Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:49:20 2020 +0200 Merge branch 'sharp/map-colors' into sharp/small-fixes commit 33140a2951b8212725f42c758b277aaec4d888f7 Merge: 4c65a5aed f34d4b379 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 04:36:21 2020 +0200 Merge remote-tracking branch 'origin/master' into zesterer/lod commit 5a089863beb01d4794bbe3580ada47b278715ea2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 03:17:49 2020 +0200 Making maps brighter. This is probably not the right way to do it, but oh well! commit 32b2c99109dd486aa922886081068f9c550c83f2 Author: Joshua Yanovski <pythonesque@gmail.com> Date: Thu Apr 2 02:46:36 2020 +0200 Horizon mapping and "layered" map generation. Horizon mapping is a method of shadow mapping specific to height maps. It can handle any angle between 0 and 90 degrees from the ground, as long as know the horizontal direction in advance, by remembering only a single angle (the "horizon angle" of the shadow map). More is explained in common/src/msg/server.rs. We also remember the approximate height of the largest occluder, to try to be able to generate soft shadows and create a vertical position where the shadows can't go higher. Additionally, map generation has been reworked. Instead of computing everything from explicit samples, we pass in sampling functions that return exactly what the map generator needs. This allows us to cleanly separate the way we sample things like altitudes and colors from the map generation process. We exploit this to generate maps *partially* on the server (with colors and rivers, but not shading). We can then send the partially completed map to the client, which can combine it with shadow information to generate the final map. This is useful for two reasons: first, it makes sure the client can apply shadow information by itself, and second, it lets us pass the unshaded map for use with level of detail functionality. For similar reasons, river generation is split out into its own layer, but for now we opt to still generate rivers on the server (since the river wire format is more complicated to compress and may require some extra work to make sure we have enough precision to draw rivers well enough for LoD). Finally, the mostly ad-hoc lighting we were performing has been (mostly) replaced with explicit Phong reflection shading (including specular highlights). Regularizing this seems useful and helps clarify the "meaning" of the various light intensities, and helps us keep a more physically plausible basis. However, its interaction with soft shadows is still imperfect, and it's not yet clear to me what we need to do to turn this into something useful for LoD. commit f8926a5737ddc51f3d585c651a64c43677aae0f4 Merge: a1aee931e 875ae6ced Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Mar 13 13:32:42 2020 +0100 Merge remote-tracking branch 'origin/master' into sharp/map-colors commit 4c65a5aed353b119aea65a2aaeb94549b67beb42 Author: Treeco <5021038-Treeco@users.noreply.gitlab.com> Date: Mon Feb 24 16:48:05 2020 +0000 Made LOD setting slider exponential commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 17:49:53 2020 +0000 Added mist to LoD commit aab059a450b5f635777129ff82cc15b662965c3c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 15:14:06 2020 +0000 Added LoD slider commit 779c36b538121c5ade3633ae5cb67bb14c8c3877 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:54:55 2020 +0000 Reduced cost of vertex pushing commit 9fea150473906b166365b738ebcea07c697daf3d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 12:38:53 2020 +0000 Fixed maths, improved LoD resolution commit 5481df38fea5bf183ff376a3337179cfaa5233dc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Feb 24 11:22:50 2020 +0000 Dynamically relocate LoD vertices to enhance details commit a3e36a50ababd615da7db1b26158c7906a5def01 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 18:13:51 2020 +0000 Simpler terrain spiral rendering commit 255f450ae9ac8763db4bede075fb409161ed57cc Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:53:17 2020 +0000 Better LoD precision commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 16:04:03 2020 +0000 Better falloff commit be775c9484b457b2c0b1a494aec03392d0c70e76 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Feb 23 15:30:45 2020 +0000 Applied good ideas from experimental branch commit 58587b68545a23c5c04ab4574a4b94b3bc982246 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 16:15:13 2020 +0000 Minor fixes to LoD merging commit 7b42aebd709c14df2db766aad61d9280ad24d84d Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 15:04:44 2020 +0000 Capped LoD dragging commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:54:37 2020 +0000 Better blending between LoD and terrain border commit edd3455d5161792d87ddc8eadc0ecbad5532b284 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:40:19 2020 +0000 Fixed LoD z depth, added sea level offset commit b9b06744620114dd5556e73f64fa93c145503a7c Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 14:27:43 2020 +0000 Better LoD smoothing commit a1aee931e790431560cd2d953ad61d9497072afd Author: Joshua Yanovski <pythonesque@gmail.com> Date: Fri Feb 21 14:52:17 2020 +0100 Adding shadows. commit 2400786c13dd891c131ed86d48d05df516a8a778 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Feb 21 13:48:40 2020 +0000 Use world map as LoD source commit dbf650f504a4c25fbbc2096ac3616c736bf52d23 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Mon Jan 20 00:48:14 2020 +0000 Better clouds at distance commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Sun Jan 19 23:59:02 2020 +0000 sync commit 745e7540ddb000cc645f612767b337c2ddc3f7c0 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 12:40:48 2019 +0000 Improved cloud falloff mist, faster noise sampling commit f6a200d0cb866196ba57697466755f9e0c7ea5d8 Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Fri Nov 22 10:09:00 2019 +0000 Improved long-range depth precision, removed unnecessary LoD polygons commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 20:57:46 2019 +0000 Working LoD shader commit f13d98ee3e58f881e8b978861a67663b59ed91ec Author: Joshua Barretto <joshua.s.barretto@gmail.com> Date: Thu Nov 21 11:03:40 2019 +0000 LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
Some(proj_mat * view_mat * Mat4::translation_3d(-focus_off)),
);
events
}
2020-12-05 04:41:03 +00:00
pub fn render<'a>(&'a self, drawer: &mut UiDrawer<'_, 'a>) {
span!(_guard, "render", "Hud::render");
2019-06-29 14:30:46 +00:00
// Don't show anything if the UI is toggled off.
if self.show.ui {
2020-12-05 04:41:03 +00:00
self.ui.render(drawer);
2019-06-29 14:30:46 +00:00
}
}
2020-03-26 21:22:21 +00:00
pub fn free_look(&mut self, free_look: bool) { self.show.free_look = free_look; }
pub fn auto_walk(&mut self, auto_walk: bool) { self.show.auto_walk = auto_walk; }
pub fn camera_clamp(&mut self, camera_clamp: bool) { self.show.camera_clamp = camera_clamp; }
pub fn handle_outcome(&mut self, outcome: &Outcome) {
match outcome {
Outcome::ExpChange { uid, exp, xp_pools } => {
self.floaters.exp_floaters.push(ExpFloater {
owner: *uid,
exp_change: *exp,
timer: 4.0,
rand_offset: rand::thread_rng().gen::<(f32, f32)>(),
xp_pools: xp_pools.clone(),
})
},
Outcome::SkillPointGain {
uid,
skill_tree,
total_points,
..
} => self.floaters.skill_point_displays.push(SkillPointGain {
owner: *uid,
skill_tree: *skill_tree,
total_points: *total_points,
timer: 5.0,
}),
Outcome::ComboChange { uid, combo } => {
self.floaters.combo_floaters.push_front(ComboFloater {
owner: *uid,
combo: *combo,
timer: comp::combo::COMBO_DECAY_START,
})
},
Outcome::Block { uid, parry, .. } if *parry => {
self.floaters.block_floaters.push(BlockFloater {
owner: *uid,
timer: 1.0,
})
},
_ => {},
}
}
}
2020-10-07 02:23:20 +00:00
// Get item qualities of equipped items and assign a tooltip title/frame color
pub fn get_quality_col<I: ItemDesc + ?Sized>(item: &I) -> Color {
2020-10-07 02:23:20 +00:00
match item.quality() {
Quality::Low => QUALITY_LOW,
Quality::Common => QUALITY_COMMON,
Quality::Moderate => QUALITY_MODERATE,
Quality::High => QUALITY_HIGH,
Quality::Epic => QUALITY_EPIC,
Quality::Legendary => QUALITY_LEGENDARY,
Quality::Artifact => QUALITY_ARTIFACT,
Quality::Debug => QUALITY_DEBUG,
}
}
// Get info about applied buffs
fn get_buff_info(buff: &comp::Buff) -> BuffInfo {
BuffInfo {
kind: buff.kind,
data: buff.data,
is_buff: buff.kind.is_buff(),
dur: buff.time,
}
}
fn try_hotbar_slot_from_input(input: GameInput) -> Option<hotbar::Slot> {
Some(match input {
GameInput::Slot1 => hotbar::Slot::One,
GameInput::Slot2 => hotbar::Slot::Two,
GameInput::Slot3 => hotbar::Slot::Three,
GameInput::Slot4 => hotbar::Slot::Four,
GameInput::Slot5 => hotbar::Slot::Five,
GameInput::Slot6 => hotbar::Slot::Six,
GameInput::Slot7 => hotbar::Slot::Seven,
GameInput::Slot8 => hotbar::Slot::Eight,
GameInput::Slot9 => hotbar::Slot::Nine,
GameInput::Slot10 => hotbar::Slot::Ten,
_ => return None,
})
}
pub fn cr_color(combat_rating: f32) -> Color {
let common = 2.0;
let moderate = 3.5;
let high = 6.5;
let epic = 8.5;
let legendary = 10.4;
let artifact = 122.0;
let debug = 200.0;
match combat_rating {
x if (0.0..common).contains(&x) => QUALITY_LOW,
x if (common..moderate).contains(&x) => QUALITY_COMMON,
x if (moderate..high).contains(&x) => QUALITY_MODERATE,
x if (high..epic).contains(&x) => QUALITY_HIGH,
x if (epic..legendary).contains(&x) => QUALITY_EPIC,
x if (legendary..artifact).contains(&x) => QUALITY_LEGENDARY,
x if (artifact..debug).contains(&x) => QUALITY_ARTIFACT,
x if x >= debug => QUALITY_DEBUG,
_ => XP_COLOR,
}
}
pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id {
match buff {
// Buffs
BuffKind::Regeneration { .. } => imgs.buff_plus_0,
BuffKind::Saturation { .. } => imgs.buff_saturation_0,
BuffKind::Potion { .. } => imgs.buff_potion_0,
BuffKind::CampfireHeal { .. } => imgs.buff_campfire_heal_0,
BuffKind::IncreaseMaxEnergy { .. } => imgs.buff_energyplus_0,
BuffKind::IncreaseMaxHealth { .. } => imgs.buff_healthplus_0,
2021-02-28 22:30:57 +00:00
BuffKind::Invulnerability => imgs.buff_invincibility_0,
2021-03-05 19:28:38 +00:00
BuffKind::ProtectingWard => imgs.buff_dmg_red_0,
2021-05-04 12:44:47 +00:00
BuffKind::Frenzied { .. } => imgs.buff_frenzy_0,
// Debuffs
BuffKind::Bleeding { .. } => imgs.debuff_bleed_0,
BuffKind::Cursed { .. } => imgs.debuff_skull_0,
2021-04-15 21:48:20 +00:00
BuffKind::Burning { .. } => imgs.debuff_burning_0,
2021-05-04 12:44:47 +00:00
BuffKind::Crippled { .. } => imgs.debuff_crippled_0,
2021-05-30 15:51:47 +00:00
BuffKind::Frozen { .. } => imgs.debuff_frozen_0,
2021-06-10 22:45:02 +00:00
BuffKind::Wet { .. } => imgs.debuff_wet_0,
2021-06-22 01:50:31 +00:00
BuffKind::Ensnared { .. } => imgs.debuff_ensnared_0,
}
}
pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> &str {
match buff {
// Buffs
BuffKind::Regeneration { .. } => localized_strings.get("buff.title.heal"),
BuffKind::Saturation { .. } => localized_strings.get("buff.title.saturation"),
BuffKind::Potion { .. } => localized_strings.get("buff.title.potion"),
BuffKind::CampfireHeal { .. } => localized_strings.get("buff.title.campfire_heal"),
BuffKind::IncreaseMaxHealth { .. } => localized_strings.get("buff.title.IncreaseMaxHealth"),
BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get("buff.title.staminaup"),
BuffKind::Invulnerability => localized_strings.get("buff.title.invulnerability"),
BuffKind::ProtectingWard => localized_strings.get("buff.title.protectingward"),
BuffKind::Frenzied => localized_strings.get("buff.title.frenzied"),
// Debuffs
BuffKind::Bleeding { .. } => localized_strings.get("buff.title.bleed"),
BuffKind::Cursed { .. } => localized_strings.get("buff.title.cursed"),
2021-04-15 20:32:38 +00:00
BuffKind::Burning { .. } => localized_strings.get("buff.title.burn"),
BuffKind::Crippled { .. } => localized_strings.get("buff.title.crippled"),
2021-05-30 15:51:47 +00:00
BuffKind::Frozen { .. } => localized_strings.get("buff.title.frozen"),
BuffKind::Wet { .. } => localized_strings.get("buff.title.wet"),
BuffKind::Ensnared { .. } => localized_strings.get("buff.title.ensnared"),
}
}
2021-04-25 23:06:47 +00:00
pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localization) -> Cow<str> {
match buff {
// Buffs
2021-04-25 23:06:47 +00:00
BuffKind::Regeneration { .. } => Cow::Borrowed(localized_strings.get("buff.desc.heal")),
BuffKind::Saturation { .. } => Cow::Borrowed(localized_strings.get("buff.desc.saturation")),
BuffKind::Potion { .. } => Cow::Borrowed(localized_strings.get("buff.desc.potion")),
BuffKind::CampfireHeal { .. } => Cow::Owned(
localized_strings
.get("buff.desc.campfire_heal")
.replace("{rate}", &format!("{:.0}", data.strength * 100.0)),
),
BuffKind::IncreaseMaxHealth { .. } => {
Cow::Borrowed(localized_strings.get("buff.desc.IncreaseMaxHealth"))
},
BuffKind::IncreaseMaxEnergy { .. } => {
Cow::Borrowed(localized_strings.get("buff.desc.IncreaseMaxEnergy"))
},
BuffKind::Invulnerability => {
Cow::Borrowed(localized_strings.get("buff.desc.invulnerability"))
},
BuffKind::ProtectingWard => {
Cow::Borrowed(localized_strings.get("buff.desc.protectingward"))
},
BuffKind::Frenzied => Cow::Borrowed(localized_strings.get("buff.desc.frenzied")),
// Debuffs
2021-04-25 23:06:47 +00:00
BuffKind::Bleeding { .. } => Cow::Borrowed(localized_strings.get("buff.desc.bleed")),
BuffKind::Cursed { .. } => Cow::Borrowed(localized_strings.get("buff.desc.cursed")),
BuffKind::Burning { .. } => Cow::Borrowed(localized_strings.get("buff.desc.burn")),
BuffKind::Crippled { .. } => Cow::Borrowed(localized_strings.get("buff.desc.crippled")),
2021-05-30 15:51:47 +00:00
BuffKind::Frozen { .. } => Cow::Borrowed(localized_strings.get("buff.desc.frozen")),
BuffKind::Wet { .. } => Cow::Borrowed(localized_strings.get("buff.desc.wet")),
BuffKind::Ensnared { .. } => Cow::Borrowed(localized_strings.get("buff.desc.ensnared")),
}
}
pub fn get_buff_time(buff: BuffInfo) -> String {
if let Some(dur) = buff.dur {
format!("{:.0}s", dur.as_secs_f32())
} else {
"".to_string()
}
}