{"id":19788868,"url":"https://github.com/niklaskorz/linon","last_synced_at":"2025-02-28T08:42:36.343Z","repository":{"id":45212573,"uuid":"361401394","full_name":"niklaskorz/linon","owner":"niklaskorz","description":"Non-Linear Ray Casting on the web, and on your desktop too","archived":false,"fork":false,"pushed_at":"2024-08-01T12:35:16.000Z","size":18052,"stargazers_count":25,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-11T03:54:02.860Z","etag":null,"topics":["raycasting","raytracing","streamlines","visualization","webgpu","wgpu","wgpu-rs"],"latest_commit_sha":null,"homepage":"https://niklaskorz.github.io/linon/","language":"TeX","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/niklaskorz.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":"2021-04-25T10:47:50.000Z","updated_at":"2025-01-04T18:11:25.000Z","dependencies_parsed_at":"2024-05-07T20:46:08.551Z","dependency_job_id":"700c515e-8c2f-4c14-a928-e2d0391f3fbf","html_url":"https://github.com/niklaskorz/linon","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Flinon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Flinon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Flinon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklaskorz%2Flinon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklaskorz","download_url":"https://codeload.github.com/niklaskorz/linon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241125154,"owners_count":19913841,"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":["raycasting","raytracing","streamlines","visualization","webgpu","wgpu","wgpu-rs"],"created_at":"2024-11-12T06:29:04.196Z","updated_at":"2025-02-28T08:42:36.310Z","avatar_url":"https://github.com/niklaskorz.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interactive Exploration of Nonlinear Ray Casting\n\nThe _linon_ project is the result of an advanced software practical in the [Visual Computing Group](https://vcg.iwr.uni-heidelberg.de/) at the Institute of Computer Science, Heidelberg University.\nIt is based on the [Rust](https://www.rust-lang.org/) programming language and the upcoming [WebGPU](https://web.dev/gpu/) graphics standard through the [wgpu](https://github.com/gfx-rs/wgpu) library.\nAt its core is the continuous evaluation of ray paths in a nonlinear field through 4th order [Runge-Kutta](https://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) integration.\n\nA presentation in Powerpoint and PDF formats can be found in the `presentation/` directory, as well as a report as LaTeX and PDF in the `report/` directory.\n\nPrebuilt binaries for Windows, macOS and Linux can be found in the [releases](https://github.com/niklaskorz/linon/releases) of the Github repository.\nIf you are using Chrome or Firefox, you can also run [linon on the web](https://niklaskorz.github.io/linon/).\nFor Firefox, you first have to enable the `dom.webgpu.enabled` and `gfx.webgpu.ignore-blocklist` flags in [about:config](about:config).\n\n## Usage\n\nThe application provides a sandbox for defining and exploring field functions that are evaluated inside a compute shader and rendered through ray casting.\n\n![Screenshot](screenshot.png)\n\nOn the right side, the main view gives the possibility to explore the nonlinear scene using arcball camera controls.\nThe left side contains a reference view in which the path of rays is visualized linearly in a rasterized scene.\nBy clicking on a fragment of the main view, the rays around this fragment are visualized in the reference view.\nThe user can select from a list of predefined field functions on the top left of the application, and then edit the function inside the text editor below.\nThrough the \"Overlay\" dropdown, a [Lyapunov exponents](https://en.wikipedia.org/wiki/Lyapunov_exponent) overlay can be enabled to emphasize areas in image space for which rays diverge in behavior.\nThe \"Outline\" button next to it renders a path mesh for the rays on the outline of these divering areas.\nIf the image appears fragmented or inaccurate, the \"Enhance\" button can be used to rerender the current frame once using a smaller step size for Runge-Kutta integration.\n\nThe field functions are written in [WGSL](https://gpuweb.github.io/gpuweb/wgsl/) and executed as a function in the compute shader.\nThe users can write their own field functions using these parameters:\n\n- `p: vec3\u003cf32\u003e` and `p_prev: vec3\u003cf32\u003e`: the current and previous ray position\n- `v: vec3\u003cf32\u003e` and `v0: vec3\u003cf32\u003e`: the current and initial ray direction / velocity\n- `t: 32`: time that has passed since ray creation\n\nThe field function must return a three-dimensional floating point vector of type `vec3\u003cf32\u003e`.\nThe following helper functions can be used inside a field function:\n\n- `rotateX(v: vec3\u003cf32\u003e, phi: f32) -\u003e vec3\u003cf32\u003e`: rotates `v` along x-axis using angle `phi` \n- `rotateY(v: vec3\u003cf32\u003e, phi: f32) -\u003e vec3\u003cf32\u003e`: rotates `v` along y-axis using angle `phi` \n- `rotateZ(v: vec3\u003cf32\u003e, phi: f32) -\u003e vec3\u003cf32\u003e`: rotates `v` along z-axis using angle `phi` \n- `translate(v: vec3\u003cf32\u003e, dx: f32, dy: f32, dz: f32) -\u003e vec3\u003cf32\u003e`: translates `v` according to the three deltas `dx`, `dy`, `dz`\n- `refraction_index(t: f32) -\u003e f32`: calculates the air refraction index for temperature `t` (in degrees Celsius)\n- `refraction(t_in: f32, t_out: f32, v_in: vec3\u003cf32\u003e, n: vec3\u003cf32\u003e) -\u003e vec3\u003cf32\u003e`: calculates the refraction result for incoming vector `v_in` from incoming temperature `t_in` to outgoing temperature `t_out`\n- `point_plane_distance(p: vec3\u003cf32\u003e, n: vec3\u003cf32\u003e, p0: vec3\u003cf32\u003e) -\u003e f32`: calculates the distance between point `p` and a plane defined by normal `n` and point `p0`\n- `sigmoid(x: f32) -\u003e f32`: the [Sigmoid function](https://en.wikipedia.org/wiki/Sigmoid_function)\n\nAdditional helper functions can be defined by adding them to the computer shader in `src/main_view.wgsl`.\n\n## Build instructions\n\nCompilation requires at least [Rust](https://www.rust-lang.org/) version 1.70 to be installed.\nThe preferred way of installing Rust is through [rustup](https://rustup.rs/).\nFurthermore, an up to date graphics driver with support for Vulkan or DirectX 12 is assumed.\nIf you are on macOS, Apple's Metal graphics API will be used automatically by WebGPU.\nThen, use cargo (included in Rust) for execution or compilation in the root of the repository.\nThe dependencies (listed in `Cargo.toml`) will be downloaded and built automatically by cargo.\n\n```sh\n# Build and run release build\ncargo run --release\n# Build and run debug build\ncargo run\n# Build release build (see target/ directory)\ncargo build --release\n# Build debug build (see target/ directory)\ncargo build\n```\n\nTo build the web version of linon, execute the following commands:\n\n```sh\nrustup target add wasm32-unknown-unknown\ncargo install -f wasm-bindgen-cli --version 0.2.87\nRUSTFLAGS=--cfg=web_sys_unstable_apis cargo build --target wasm32-unknown-unknown --release\nwasm-bindgen --out-dir public --web target/wasm32-unknown-unknown/release/linon.wasm\n```\n\nThe resulting web application in the `public/` directory can then be served by an HTTP server of your choice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklaskorz%2Flinon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklaskorz%2Flinon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklaskorz%2Flinon/lists"}