Skip to content

Latest commit

 

History

131 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A non‑polygon‑based graphics engine written in Rust using SDL2 and WGPU.

After setting up your rust environment , just pull the code and run with:
cargo run --release

Command line arguments to be used:

  • gpu: runs in GPU mode (enabled by default)
  • cpu: runs in CPU mode
  • fullscreen: runs in fullscreen mode
  • framerate: shows framerate in the command line
  • w=[width]: sets the width
  • h=[height]: sets the height

You can use any or a combination of these arguments with space between them like this: cargo run --release -- [argument1] [argument2]


The main feature is that this engine does not render based on polygon calculations, but rather it uses a 2D pixel concept that has 3D properties. It's like using "2D voxels" but more akin with splatting. No rasterization is done, pixels just overlap. Also ray tracing is added as a layer on top. This project is built using the Rust language, WGPU library and SDL2. All GPU calculations are done in shaders.

The next step will be to detect the surface angle based on the 3D position of the pixels around a pixel and then use it to detect and then use the reflection factor based on the angle of the camera and the light source to the surface.

Another next step will be implementing dynamic level of details by not rendering the pixels that are fully overlaped given depth and angle.

Screenshot

Note: On any platform if you just run the code you get the realtime demo. Here are the controls that are used in the realtime demo video:

  • Mouse left drag: object rotation
  • Mouse right drag: moves light
  • Mouse wheel: light intensity
  • Mouse middle + Left Ctrl drag: light rotation

Realtime Demo: https://youtu.be/VMSdGRFzYos?si=qGbDUhvOCmdBPphA
Also check out this isometric showcase: https://youtu.be/MyKXAUFCHoA?si=vPBwPF8KVLOi6twR
Also with fake reflections: https://youtu.be/VMSdGRFzYos?si=jsUWTZPnysYkRlTs

The documentations is not ready yet but the code base is pretty much short and self-documented. So I hope you enjoy the code.

For better communication, here's the invite link to perfectengine's Discord server. I'm available for questions and discussions there. https://discord.gg/fuWVf3Bdmc

I'm looking forward to seeing and sharing your demos, as well as having your contributions in this project. Many thanks.

About

A non‑polygon‑based graphics engine written in Rust using SDL2 and WGPU.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages