Skip to content

v0.11.0

Latest
Compare
Choose a tag to compare
@da1nerd da1nerd released this 24 May 17:11
· 12 commits to master since this release

This release was mostly just a ton of internal changes. However, there were some visual updates for which I made a short and poorly edited video https://youtu.be/0j0v04a9BwU.

Shaders

The shader Program received some breaking changes and is now much more flexible. Here are the highlights:

The uniform macro can now accept an array or static array of a type. e.g. uniform lights, StaticArray(PointLight, 4)

Before, you could turn a class into a serializable uniform structure that could be added to your shader using the uniform macro already mentioned. To do this you would include Shader::Serializable. This has been renamed to Shader::UniformStruct to make it's function a bit clearer.

The uniform macro was always a little buggy with what types it would allow you to specify. The hacky type validation was removed from the macro since types are already validated in the shader Program.

Lights

Lights were completely re-written. I've gone back and forth whether or not lights should be in what I consider the "core" section of the library, or the sdtlib section. I ended up making it a component and sticking it in stdlb.

For now lights have regressed to just a point light implementation, but I'll add some other light types in the future.

A huge breaking change is that lights no longer have their own special shader. Before, a light would run the entire scene through it's shader. Add 100 lights and we have a performance issue. Now, lights must be manually implemented in shaders as a limited quantity, so you'll need to sort out which lights to render at a particular point.

Clock

I've started building some components that use the concept of time. However, I wanted to be able to represent time that was scaled down from the regular 24 hour day. For example, I may want to represent a day/night cycle every 30 minutes in the game. The Clock provides such functionality and will be (I hope) the base for a lot of cool components in the stdlib.

Skybox

A skybox gives the visual effect of a sky around the player. This effect is most often accomplished with a cube map texture. The Skybox here is a special component that allows you to attach as many cube map textures as you like to any time of day utilizing the Clock mentioned above.

For example, you start off with setting the length of a day. Say 30 minutes. Then add a day texture that activates at 5am, and a night texture that activates at 5pm. Finally, we can give these a transition duration of 45 minutes. All of these time values are scaled down to the virtual 30 minute day. The textures added in this way are automatically sorted and activated at the appropriate time.

Textures

Textures now have a proper abstraction, so it will be easy to add new textures types in the future. Right there are 2d textures, and cube map textures.

Example code was removed

I didn't want to keep adding bloat to the repository so I moved all of the example code into a dedicated repository https://github.com/neutrinog/tutorial-game.
This isn't an official "prism demonstration" per se. I'm currently working through some Youtube tutorials on building a java game engine and this is my scratch pad that based off of the Prism master branch.