All these can be run with
cargo run --example name_of_an_example
Shows the basics of the state machine in amethyst
.
This example just prints:
Begin!
Hello from Amethyst!
End!
Open a window, and create a render context. Also shows basic raw input handling.
Render a basic 3D scene, with a camera, lights and a 3D object, a sphere in this scenario. This example use a single vertex buffer with all attributes interleaved.
Render a basic 3D scene, with a camera, lights and a 3D object, a sphere in this scenario. This example use vertex buffers per attribute.
Render a basic 3D scene, with a camera, lights and a 3D object, a sphere in this scenario. This example use vertex buffers per attribute. Only difference here is that multisampling is enabled in the options.
Load graphics objects from disc using the asset loader. Also contains a custom system that move the camera and the scene.
Create a custom asset format, and use the asset loader to load assets using the format.
Render a sphere using a physically based material.
Animate a sphere using a custom built animation sampler sequence. Keybindings:
Space
- start/pause/unpause the currentanimation(default is translational animation)D
- demonstrate deferred start, translate will run first, then rotate when translate ends, and last scale animation will start after rotation has run for 0.66s.T
- set translate to current animationR
- set rotate to current animationS
- set scale to current animationH
- run animation at half speedF
- run animation at full speedV
- run animation at no speed, use stepping keys for controlling the animationRight
- step to the next animation keyframeLeft
- step to the previous animation keyframe
Load a GLTF asset, attach it to an entity, and animate the asset. Press Space
to start/pause the animation.
Render a basic UI.
Amethyst
based Pong clone. In addition to using most of the features used by the other examples it also demonstrates:
- Input handling using
InputHandler
- Background music and sound effects
- A more interesting UI example
- A bigger project with more than a single source file.
From the book, it is a minor update to the Pong example that uses Config
files instead of hardcoded constants.
Demonstrates how to use custom GameData
, with three different states: Loading
, Main
, Paused
.
This example shows how to use the Fly Camera.
This example shows how to use the Arc Ball Camera.
Demonstrates how to use SpriteSheet
s.
Draws sprites ordered by Z coordinate. Entities with larger Z coordinates will have their sprites drawn in front of entities with smaller Z coordinates.
This example also demonstrates the use of the Transparent
component, the depth buffer, and
camera depth values.
Keybindings:
T
- Toggle whether theTransparent
component is attached to entities.R
- Reverse the Z coordinates of the entities.Up
- Increase the Z coordinate of the camera.Down
- Decrease the Z coordinate of the camera.Right
- Increase the depth (Z distance) that the camera can see.Left
- Decrease the depth (Z distance) that the camera can see.
Shows how to load data using the Prefab
system.