GameLib is a collection of libraries for creating applications in Cakelisp.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
3.3 KiB

3 years ago
GameLib is my library for making games. It is the successor to [[][base2.0]].
GameLib is written in [[][Cakelisp]].
3 years ago
* Setup
Clone the repository and its dependencies:
3 years ago
git clone
git submodule update --init --recursive
hg clone Dependencies/SDL
3 years ago
Build dependencies:
* Asset pipeline
This is a work in progress.
** Blender setup
- Install [[][Blender]]. I can confirm Blender 2.91 works.
- Copy ~blender2ogre~ to Blender plugins:
cp -r Dependencies/blender2ogre/io_ogre/ ~/.config/blender/2.91/
- Open Blender, then open Preferences (Edit->Preferences), and click Add-ons
- Search for "Ogre" and check the box to enable the OGRE Exporter
- Build Ogre, if you haven't already (run
- Set ~OGRETOOLS_XML_CONVERTER~ to where you built OgreMeshTool. You'll need to browse to ~gamelib/Dependencies/ogre-next/build/Debug/bin/OgreMeshTool_d~
You are now ready to export. Open your model or create one, then do ~File -> Export -> Ogre3D~. See the following section for settings. /Note:/ I will be making command-line driven auto-exporting to reduce these manual steps.
** OGRE Export Settings
- Don't *export materials*. These are v1 materials as far as I know, which don't work with Ogre 2
- Don't *export scene*. I don't use these files
- Ensure *mesh export version* is set to ~v2~
** Materials and Textures
The ~blender2ogre~ plugin doesn't do much to help with Ogre v2 materials.
For a textured mesh:
- UV unwrap mesh
- Create new image for texturing
- Add a new material and set the diffuse input to your new image. Name the material what you'd like it to be called in the game as well
- Paint the texture as desired
- In the Image Editor window, do ~Image -> Save As~ and save the image to a lossless format (I used PNG)
- Run the following to convert the image to (which will be a larger file, but will load /drastically/ faster):
convert assets/MyTexture.png data/Materials/Textures/
- Export the mesh. Because export materials doesn't do us any good yet, we only export the mesh to get the updated UV coordinates and material (name only)
- Create a ~.material~ text file like below:
hlms MyMaterial pbs
roughness 0.4
fresnel 1.33
// normal_map Rocks_Normal.tga
// roughness_map Rocks_Spec.tga
// specular_map Rocks_Diffuse.tga
- Finally, add the material to the ~Ogre::Item~:
This is only necessary if the mesh didn't already have the Material name set.
** Converting ~.mesh.xml~ to ~.mesh~
You shouldn't need to do this step if you set ~OGRETOOLS_XML_CONVERTER~, but in case blender2ogre didn't recognize it, here's how I worked around it:
cd Dependencies/ogre-next/build/Debug/bin
./OgreMeshTool_d -e -O puqs ../../../../../test/data/Models/Suzanne.mesh.xml
Run this after you've made an attempted export from the Blender OGRE plugin.