A real-time ray tracer in Java, accelerated on heterogeneous hardware using TornadoVM

Overview

Java Ray Tracer for TornadoVM

Demo

Description

This project aims to build a real-time ray tracer in Java, accelerated on heterogeneous hardware using TornadoVM.

The project uses JavaFX to obtain a canvas for a graphical context to draw on and to build an interactive graphical user interface, while the entire rendering process consists of manual calculation of the colors of the pixels through tracing rays, applying the Blinn-Phong shading model and sampling soft shadows.

The embarrassingly parallel property of ray tracing allows for concurrent computation of each individual pixel color, achieving up to 930x performance increase on an Nvidia RTX2060 GPU against the default sequential Java execution on an Intel i7-8550u CPU.

Installation

  1. Clone the project:
git clone https://github.com/Vinhixus/TornadoVM-Ray-Tracer.git
  1. Install dependencies:
  • Install TornadoVM. The following example builds TornadoVM with OpenJDK 11 and OpenCL:
git clone https://github.com/beehive-lab/TornadoVM.git 
cd TornadoVM
./scripts/tornadoVMInstaller.sh --jdk11 --opencl
source source.sh
cd ..

If you cannot build TornadoVM with the installer, try the manual installation .

  • Download the JavaFX SDK for your system from: JavaFX downloads. You will need the path of the JavaFX SDK for Step 3.

Note that TornadoVM-Ray-Tracer has been tested with JavaFX version 18.

  1. Set up the environment and store the variables in a file (e.g. sources.env):
cd TornadoVM-Ray-Tracer
vim sources.env
export TORNADO_RAY_TRACER_ROOT="${PWD}"
export PATH="${PATH}:${TORNADO_RAY_TRACER_ROOT=}/bin"
export JAVAFX_SDK=<path to JavaFX>/javafx-sdk-18/
export TORNADO_ROOT=<path to TornadoVM>
export PATH="${PATH}:${TORNADO_ROOT}/bin/bin/"
export TORNADO_SDK=${TORNADO_ROOT}/bin/sdk
export JAVA_HOME=${TORNADO_ROOT}/TornadoVM-OpenJDK11/jdk-11.0.13+8

Load the environment:

source sources.env
  1. Build TornadoVM-Ray-Tracer:
mvn clean install
  1. Run TornadoVM-Ray-Tracer:

With GUI:

tornadovm-ray-tracer

Without GUI in benchmarking mode:

tornadovm-ray-tracer benchmark

Author

Vinh Pham Van

LinkedIn: vinh-pham-van
Email: [email protected]

With special thanks to:

Christos Kotselidis: Supervisor & TornadoVM Project Leader
Juan Fumero: TornadoVM Lead Architect
Thanos Stratikopoulos: TornadoVM Senior Solutions Architect
Maria Xekalaki: TornadoVM Principal Software Engineer
Florin Blanaru: TornadoVM Senior Software Engineer

Licenses

License

You might also like...

Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects.

Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects.

Just-In-Time Access Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects. Syno

Jan 3, 2023

This is the java/Maven application we are building to solve one real world problem.

timly This is the java/Maven application we are building to solve one real world problem. As in MLH we are working with fellows across the globe and e

Feb 16, 2022

ScriptEngine that running java code; Real JavaScript

Java JavaScriptEngine ScriptEngine that running java codes Real JavaScript Example import javax.script.Bindings; import javax.script.ScriptEngine; imp

Apr 29, 2022

Mentoring: Abstracting real-world situations with Object Orientation

Mentoring: Abstracting real-world situations with Object Orientation

Mentoria: Abstraindo situações do mundo real com Orientação a Objetos O objetivo principal é colocar em prática umas das principais ferramentas da OO:

Feb 11, 2022

The real phobos recode. Brought to you by oHareDaBoss himself.

3arthh4ck The real phobos recode. Brought to you by oHareDaBoss himself. released because grin is a big b word. very uncool of what he did. not swag.

Dec 29, 2022

course-project-real-estate-finder-004 created by GitHub Classroom

Real Estate Finder Running the Project: Clone the repository and open with IntelliJ IntelliJ may not correctly open the project on the first run, but

Dec 16, 2021

Reverse engineer and rewrite real mode dos programs!

Reverse engineer and rewrite real mode dos programs!

Spice86 - A PC emulator for real mode reverse engineering Spice86 is a tool to execute, reverse engineer and rewrite real mode dos programs for which

Nov 9, 2022

Applied Spring Data JPA technologies including mapping, connecting real DB, Hibernate, Queries, Paging & Sorting, various Relationships, Transactions

Applied Spring Data JPA technologies including mapping, connecting real DB, Hibernate, Queries, Paging & Sorting, various Relationships, Transactions

University Management In this project, I practiced & applied Spring Data JPA technologies including mapping, connecting real DB, Hibernate, Queries, P

Sep 5, 2022

Search API with spelling correction using ngram-index algorithm: implementation using Java Spring-boot and MySQL ngram full text search index

Search API with spelling correction using ngram-index algorithm: implementation using Java Spring-boot and MySQL ngram full text search index

Search API to handle Spelling-Corrections Based on N-gram index algorithm: using MySQL Ngram Full-Text Parser Sample Screen-Recording Screen.Recording

Dec 4, 2021
Comments
  • Updates with the latest TornadoVM version and Multi-thread version provided for the benchmarks

    Updates with the latest TornadoVM version and Multi-thread version provided for the benchmarks

    This PR includes two updates:

    1. It updates the Task-Schedule graphs using the latest TornadoVM API. The upcoming TornadoVM API improves memory utilization, but we need to include a new call to keep data on the device and achieve higher FPS rates.
    2. We provide a Java Parallel Stream implementation with TornadoVM on the CPU using the Benchmark mode. The parallel stream API is also available for the GUI.
    opened by jjfumero 0
Owner
null
A visual implementation of OSHI, to view information about the system and hardware.

MooInfo A visual implementation of OSHI, to view information about the system and hardware. Such as OS, processes, memory, CPU, disks, devices, sensor

周波 104 Jan 6, 2023
This repository should serve as a guide to everybody who wants to study software and hardware for embedded systems but doesn't know where to start.

Roadmap to Embedded Engineering This repository should serve as a guide to anyone who wants to study software and hardware for embedded systems but do

Mateus Antonio da Silva 108 Jan 4, 2023
UniFi Proxy makes it possible to integrate third-party hardware into UniFi Protect

UniFi Proxy UniFi Proxy makes it possible to integrate third-party hardware into UniFi Protect. For testing purposes only, it is recommended to purcha

Jan Heil 8 Dec 27, 2022
A near real time Data Warehouse using the MeshJoin Algorithm

MeshJoin-Data-Warehouse A near real time Data Warehouse using the MeshJoin Algorithm Steps to run the project: Step 1: Run the createDW.sql file -This

M. Adil Fayyaz 2 Dec 1, 2022
Person Apri development in real time

Digital Innovation: Expert class - Desenvolvendo um sistema de gerenciamento de pessoas em API REST com Spring Boot Nesta live coding vamos desenvolve

Vitor Nunes 1 Nov 11, 2021
This app corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

Notichair 실시간 자세분석 및 교정 스마트체어 ?? 상명대학교 PRIME 경진대회 수상 ?? 요구사항 31-cell sensor (mdxs-16-5610) 목차 1. 소개 프로젝트 내용 소개 2. 개발 환경 사전 설정 및 환경 구축 3. 기능 Sensors Ap

Minuk_LEE 3 Jan 15, 2022
corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

Notichair 실시간 자세분석 및 교정 스마트체어 ?? 상명대학교 PRIME 경진대회 수상 ?? 요구사항 31-cell sensor (mdxs-16-5610) 목차 1. 소개 프로젝트 내용 소개 2. 개발 환경 사전 설정 및 환경 구축 3. 기능 Sensors Ap

Minuk_LEE 3 Jan 15, 2022
A near-real-time Mesh Join Algorithm Implementation provided with a Complete Data warehouse for METRO

Mesh Join Algorithm and Data Warehouse A complete Mesh-Join Algorithm Implementation as provided in the paper R-MESHJOIN . This is demonstrated by the

null 3 Aug 11, 2022
Source code of course - Building Real-Time REST APIs with Spring Boot

springboot-blog-rest-api Learn how to build real-time REST APIs with Spring Boot by building a complete Blog App. Source code of Popular Building Real

Ramesh Fadatare 123 Jan 6, 2023
Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in.

JoinMessages Minecraft configurable plugin , which sends messages the first time a player logs into the server or the next time they log in or leave.

ᴠᴀʟᴇɴᴛɪɴ ᴢʜᴇʟᴇᴠ 6 Aug 30, 2022