{"id":17703576,"url":"https://github.com/wumpf/terrain_and_stuff","last_synced_at":"2025-03-31T04:15:55.288Z","repository":{"id":258758536,"uuid":"868210909","full_name":"Wumpf/terrain_and_stuff","owner":"Wumpf","description":"A graphics demo where I play around with - you guessed - it terrain and stuff!","archived":false,"fork":false,"pushed_at":"2025-03-16T20:25:58.000Z","size":534,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T21:26:26.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wumpf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-05T19:01:36.000Z","updated_at":"2025-03-16T20:26:01.000Z","dependencies_parsed_at":"2025-02-06T08:43:57.433Z","dependency_job_id":"c1f662ea-2431-4cb3-8309-6d83558b1a5b","html_url":"https://github.com/Wumpf/terrain_and_stuff","commit_stats":null,"previous_names":["wumpf/terrain_and_stuff"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wumpf%2Fterrain_and_stuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wumpf%2Fterrain_and_stuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wumpf%2Fterrain_and_stuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wumpf%2Fterrain_and_stuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wumpf","download_url":"https://codeload.github.com/Wumpf/terrain_and_stuff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413237,"owners_count":20773053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-24T20:42:16.620Z","updated_at":"2025-03-31T04:15:55.276Z","avatar_url":"https://github.com/Wumpf.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Terrain \u0026 Stuff\n========================================================\nA graphics demo where I play around with - you guessed - it terrain and stuff!\n\n* Spiritual successor to https://github.com/Wumpf/terrainwatersim\n* Framework based on https://github.com/Wumpf/minifb_wgpu_web_and_desktop\n\nTODO: more readme :)\n\n\nTech Stack\n-----------------\n\n* [wgpu](https://github.com/gfx-rs/wgpu) for rendering\n* [naga_oil](https://github.com/bevyengine/naga_oil) for shader (pre-)processing\n* [minifb](https://github.com/emoon/minifb) for windowing and event handling\n* [egui](https://github.com/emilk/egui) for UI\n  * using a custom, minimalistic binding to minifb instead of [eframe](https://github.com/emilk/egui/tree/master/crates/eframe)\n\n\nSky rendering\n-----------------\n\nBased on [Sébastien Hillaire's \"A Scalable and Production Ready\nSky and Atmosphere Rendering Technique\"](https://sebh.github.io/publications/egsr2020.pdf) (Eurographics Symposium on Rendering 2020).\nSee also Sébastien's [talk](https://www.youtube.com/watch?v=SW30QX1wxTY) about the topic at SIGGRAPH's 2020 Physically Based Shading Course.\n\nVarious implementations exists:\n* [official demo implementation](https://github.com/sebh/UnrealEngineSkyAtmosphere) by Sébastien himself.\n* [Andrew Helmer's ShaderToy](https://www.shadertoy.com/view/slSXRW).\n* [Lukas Herzbeger's rigorous WebGPU implementation](https://github.com/JolifantoBambla/webgpu-sky-atmosphere) with many different configuration options and compute shader variants\n\nDisplay transform\n-----------------\n\nAll calculations are done in Bt.709 linear luminance values (i.e. using photometric units if not specified otherwise).\n\nAs explained in https://seblagarde.wordpress.com/wp-content/uploads/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nit has some advantages to keep all units radiometric for non-spectral rendering and a fixed conversion factor can be assumed.\n\nThe HDR Bt.709 stimulus is then mapped to LDR using [Tony McMapface](https://github.com/h3r2tic/tony-mc-mapface)\nand converted to sRGB \"gamma\" space by applying the sRGB OETF.\n\nTODO: Would be interesting to explore supporting Display P3 output as well!\nUnfortunately, that would mean we need a different display transform then since there's no HDR output for Tony.\n\n\nLighting\n-----------------\nTODO: Direct lighting\nTODO: Shadows\n\nIndirect sky light\n==================\nTODO: Not done any of this yet, this is just the plan!\n\nCompute a 3 band (order 2) spherical harmonic of the sky's luminance, ignoring the sun.\nSun is obviously _a lot_ brighter than everything else,\nso not only would it ruin the SH coefficients for everything else but we can also do more interesting\nBRDFs by treating it as a simple directional light.\n\nThen, for the actual indirect lighting, compute illuminance by integrating cosine lobe\nTODO: Why stop at lambert/illuminance here? Might as well sample luminance in a direction to approximate some specularity as well!\n\nThis is done by a compute shader sampling the sky's luminance at a fixed height using same method we use per screen pixel when raymarching the atmosphere.\nSteps:\n* each invocation computes one sample on the sphere and keeps this sample in register\n* for SH coefficient:\n  * compute the sample's coefficient value\n  * write it to shared memory\n  * perform a reduction over the shared memory to get the average coefficient value\n  * write final coefficient value to the output buffer\nTODO: can we do enough samples in a single pass like this or should we repeat this process?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwumpf%2Fterrain_and_stuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwumpf%2Fterrain_and_stuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwumpf%2Fterrain_and_stuff/lists"}