v0.9.0
Here's an overview of the big changes. It's getting to the point where I can't attach a good gif file without hitting the upload limit (10mb) so I'm going to uploading a release video to youtube. https://youtu.be/22hVTIDaIrM
New Systems
A new InputSystem makes it really easy to subscribe to input events. In order to use it, all you have to do is add the InputSubscriber component to your entity, and include the InputReceiver module in one of your entity's other components.
This is used in a new PlayerMovement component in order to give keyboard controls to the attached entity. e.g.
# snippet from player movement...
class PlayerMovement < Crash::Component
include Prism::InputReceiver
def input!(tick : RenderLoop::Tick, input : RenderLoop::Input, entity : Crash::Entity)
# perform some logic including updating the entity
end
end
# in your main code...
myentity.add InputSubscriber.new
myentity.add PlayerMovement.newAs a result of the new systems, all of the hard-coded camera and movement controls have been decoupled from entities.
Better Camera support
It's now a LOT easier to set up and use the camera. There is still of course the original GhostCamera which will give you a flying camera entity. However, you can now add the Camera component directly to an entity and it will just work. This method will give you a first person view. If you want a third person view of the attached entity you can add the ThirdPersonCameraControls (needs a better name) component to the entity as well. With this you can control your camera zoom, pitch, and angle around the entity!
Model Batching
As a performance improvement, models are now batched and rendered together so we can save time setting and re-setting all the uniform variables. Now if you have a number of entities that all use the same TexturedModel you'll see some performance gains.
Fog
There's now some fog in the example program. There may be more improvements down the road such as adjusting the color, distance, and density of the fog from the crystal code.
Other stuff
- Seeded the example world with more life
- Multi-texturing was added to the terrain. This uses a new
TexturePackthat automagically attaches textures to your shader program (abstracted and improved from the Material class).