https://github.com/mlucifer27/photon-trace
A Java-based inverse rasterizer engine demo, crafted with Swing for a sleek visual showcase.
https://github.com/mlucifer27/photon-trace
engine featured java rasterizer rendering swing
Last synced: 3 months ago
JSON representation
A Java-based inverse rasterizer engine demo, crafted with Swing for a sleek visual showcase.
- Host: GitHub
- URL: https://github.com/mlucifer27/photon-trace
- Owner: mlucifer27
- License: mit
- Created: 2025-06-30T02:35:03.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-06-30T10:57:21.000Z (3 months ago)
- Last Synced: 2025-06-30T11:49:07.574Z (3 months ago)
- Topics: engine, featured, java, rasterizer, rendering, swing
- Language: Java
- Homepage:
- Size: 5.09 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# PhotonTrace
An inverse rasterizer engine demo, written in java using swing. The performance isn't great, due to the slowness of the java graphics library, and the fact that most of the calculations are done in the cpu, not the gpu. Still, it's a good sample implementation of the rasterization process.
This project is a heavily modified version of @cdehais's, @smondet's and @gmorin's rasterizer, featuring additional features such as camera movement, further optimization, and better user interface.
## Installation
This project uses gradle, so you can simply run the `gradlew build` command to build the project.
Use the `gradlew run` command to run the project.
## Usage
When starting the app, you will be prompted to select a file to load. By default, the file selector will be set to the `scenery/` directory, which contains a few sample files. You can also select a custom file from the file system, just bear in mind that any syntax errors might cause the program to crash, as very few robustness checks were made during the development (lack of time).
Once loaded, a wireframe version of your scene will be displayed. The key bindings are as follows:
- arrows - move the camera around
- l - toggle lighting
- return - loop between available shaders
- f1 - set rendering mode to wireframe
- f2 - set rendering mode to solid
- f3 - set rendering mode to wireframe (multithreaded)
- f4 - set rendering mode to solid (multithreaded)The multi-threaded rendering modes are purely experimental, and have turned out to be slower than the single-threaded ones.
## Screenshots
Blender monkey "Suzanne" rendered in wireframe mode, with lighting enabled.
Blender monkey "Suzanne" rendered in solid mode, with lighting enabled.
A380 plane model rendered in solid mode, with lighting disabled.
A380 plane model rendered in solid mode, with lighting enabled.
## Importing custom models
The `*.off` files available in the `app/src/main/resources/scenery` directory are modified versions of the generic [OFF file format](). Conversion from the standard format to the modified one is done by the `off_converter.py` script, which can be found in the `app/scripts/` directory.
Usage:
```bash
python3 app/scripts/off_converter.py
```## Disclaimer
This project was carried out as part of the Computer rendering course at [ENSEEIHT](https://www.enseeiht.fr/). I do not have complete ownership of the code, so please be careful when reusing it.