Accelerating Ray Tracing with OpenMP for WebAssembly
Abstract
It is imperative that parallelism remains present in video games and professional digital tools that run in web browsers. To enable a graphical and interactive ray tracing program written in C to run on the Web, it was compiled to WebAssembly using Emscripten. Additionally, using open-source code from Tencent, a parallelized version with OpenMP was developed, which also compiles for the Web. An experiment showed that, although OpenMP works on the Web and some acceleration was observed, the performance was far from the ideal threshold. Program and methodology adjustments are needed to achieve more significant results.
Keywords:
High-Performance Mobile Computing Languages, Compilers, and Tools for High Performance
References
CRATES.IO. 2025. rayon: Simple work-stealing parallelism for Rust [seção sobre dependentes]. [online]. Disponível em: [link]. Acesso em: 30 jan. 2025.
THE CLANG TEAM. 2025. OpenMP Support. [online]. Disponível em: [link]. Acesso em: 23 jan. 2025.
EMSCRIPTEN CONTRIBUTORS. 2015a. About Emscripten. [online]. Disponível em: [link]. Acesso em: 17 jan. 2025.
______. 2015b. Pthreads support. [online]. Disponível em: [link]. Acesso em: 17 jan. 2025.
FLUTTER. 2024. Web FAQ. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
GUIDE, The `wasm-bindgen`. 202-. Parallel Raytracing. [online]. Disponível em: [link]. Acesso em: 30 jan. 2025.
LINIETSKY, Juan; MANZUR, Ariel; GODOT COMMUNITY. 202-b. Exporting for the Web. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
______. 202-b. Using multiple threads. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
LIBGDX. 2025. HTML5 Backend and GWT Specifics. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
LLVM OPENMP. 2025. LLVM OpenMP* Runtime Library Interface. [online]. Disponível em: [link]. Acesso em: 24 jan. 2025.
NIHUI. Comentário na issue 13892 de FLATMAX (Flax, Matt) no projeto Emscripten. Enabling openmp. 8 mai. 2021. Github: @nihui. Disponível em: [link]. Acesso em: 17 jan. 2025.
RREVERSER (Ingvar Stepanyan). 2025. wasm-bindgen-rayon. [online]. Disponível em: [link]. Acesso em: 30 jan. 2025.
SDL. 2025. About SDL. [online]. Disponível em: [link]. Acesso em: 18 jan. 2025.
SHIRLEY, Peter; BLACK, Trevor David; HOLLASCH, Steve. Ray Tracing in One Weekend. Versão 4.0.1. [s.l.]: [s.e.], 2024. [online]. Disponível em: [link]. Acesso em: 18 jan. 2025.
UNITY TECHNOLOGIES. 2025. Technical limitations. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
THE CLANG TEAM. 2025. OpenMP Support. [online]. Disponível em: [link]. Acesso em: 23 jan. 2025.
EMSCRIPTEN CONTRIBUTORS. 2015a. About Emscripten. [online]. Disponível em: [link]. Acesso em: 17 jan. 2025.
______. 2015b. Pthreads support. [online]. Disponível em: [link]. Acesso em: 17 jan. 2025.
FLUTTER. 2024. Web FAQ. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
GUIDE, The `wasm-bindgen`. 202-. Parallel Raytracing. [online]. Disponível em: [link]. Acesso em: 30 jan. 2025.
LINIETSKY, Juan; MANZUR, Ariel; GODOT COMMUNITY. 202-b. Exporting for the Web. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
______. 202-b. Using multiple threads. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
LIBGDX. 2025. HTML5 Backend and GWT Specifics. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
LLVM OPENMP. 2025. LLVM OpenMP* Runtime Library Interface. [online]. Disponível em: [link]. Acesso em: 24 jan. 2025.
NIHUI. Comentário na issue 13892 de FLATMAX (Flax, Matt) no projeto Emscripten. Enabling openmp. 8 mai. 2021. Github: @nihui. Disponível em: [link]. Acesso em: 17 jan. 2025.
RREVERSER (Ingvar Stepanyan). 2025. wasm-bindgen-rayon. [online]. Disponível em: [link]. Acesso em: 30 jan. 2025.
SDL. 2025. About SDL. [online]. Disponível em: [link]. Acesso em: 18 jan. 2025.
SHIRLEY, Peter; BLACK, Trevor David; HOLLASCH, Steve. Ray Tracing in One Weekend. Versão 4.0.1. [s.l.]: [s.e.], 2024. [online]. Disponível em: [link]. Acesso em: 18 jan. 2025.
UNITY TECHNOLOGIES. 2025. Technical limitations. [online]. Disponível em: [link]. Acesso em: 29 jan. 2025.
Published
2025-04-23
How to Cite
SCHIRMER, Bento Borges; SILVA, Maria Clara Bohn; DIAS, Luis Henrique Siqueri; MONTEIRO, Thierry Weissheimer; CHARAO, Andrea Schwertner.
Accelerating Ray Tracing with OpenMP for WebAssembly. In: REGIONAL SCHOOL OF HIGH PERFORMANCE COMPUTING FROM SOUTHERN BRAZIL (ERAD-RS), 25. , 2025, Foz do Iguaçu/PR.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2025
.
p. 1-4.
ISSN 2595-4164.
DOI: https://doi.org/10.5753/eradrs.2025.6557.
