Davidster / ikari

Game engine project written in pure rust for learning about rust and game tech
MIT License
33 stars 3 forks source link

Ikari

License: MIT

Ikari is a game engine project written in pure rust for learning about rust and game tech. It is developed to have decent visuals and good performance, ideally supporting frame rates of 144 or higher.

Most of the rendering features were implemented by following the awesome tutorials on learnopengl and learnwgpu.

Hopefully one day it will be used in a real game 😃

Features:

Try it out

# native
cargo run --bin example_game
# web
rustup target add wasm32-unknown-unknown
cargo build_web --release --bin example_game

See console logs for list of available controls

clikari

The ikari CLI has the following capabilities:

For example:

cargo run --bin clikari -- --command process_skybox --background_path ikari/src/textures/milkyway/background.jpg --environment_hdr_path ikari/src/textures/milkyway/radiance.hdr --out_folder ikari/src/skyboxes/milkyway

Screenshots / Videos:

PBR glTF assets

screenshot_1

Point-lights + shadows

screenshot_2

Mesh skinning + animations

https://user-images.githubusercontent.com/2389735/176325053-18c47d31-71b3-4aa4-a1d9-ec3a6356d2c7.mp4

Rapier physics

https://user-images.githubusercontent.com/2389735/178186964-c42f44c7-8e3e-475c-8104-48a98be7709f.mp4

Auto-generated character collision meshes

https://user-images.githubusercontent.com/2389735/180101651-86ba2084-4196-494b-9a36-3b6847161af1.mp4

Iced UI + wgpu-profiler

screenshot_3

Profiling

You can profile ikari with tracy via profiling crate. To do that you have to:

If something does not work it is possible that the crate profiling has been updated and is no longer aligned with the tracy version and a more recent one must be used.

Tracy linux install:

Based on instructions from here: https://github.com/wolfpld/tracy/issues/484

git clone git@github.com:libcapstone/libcapstone.git
cd libcapstone
PATH=/usr/local/bin:/usr/bin:/bin CC=clang CXX=clang++ make -j12
sudo make install
git clone git@github.com:wolfpld/tracy.git
cd tracy/profiler/build/unix
git checkout v0.10
# LEGACY=1 is needed for it to work on x11
LEGACY=1 make -j12
./Tracy_release

Tracy macos install:

brew install freetype2 glfw
# version 4.0.2, haven't tested with v5, maybe it works.
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/442f9cc511ce6dfe75b96b2c83749d90dde914d2/Formula/c/capstone.rb
brew install ./capstone.rb
brew pin capstone
rm capstone.rb
./Tracy-release

Running clippy for wasm target

# this will run clippy on the example game as well as ikari by dependency
# we need to pass --no-default-features now that tracy is enabled by default
RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --package example_game --target wasm32-unknown-unknown --no-default-features --features="audio"