Skip to content

2024's small template to start your raylib game. Featuring 3D, C 2017, Raylib 5.0, OpenGL 3 and a modular architecture.

License

Notifications You must be signed in to change notification settings

DamienFremont/c99-raylib5-gl3-3dgame-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D Game Starter - C 2017, RayLib 5.0, OpenGL 3

License: MIT Twitter Follow "Buy Me A Coffee"

⚠️ WORK IN PROGRESS !!!

2024's small template to start your raylib game. Featuring 3D, C 2017, Raylib 5.0, OpenGL 3 and a modular architecture.

alt text

Content


Dependencies

Screenshots

alt text

alt text

alt text

alt text

alt text

Features

  • Targets:
    • Win64 (Windows)
    • Linux
    • SteamDeck (Linux)
    • HTML5 (WebAssembly)
    • Discord (WebAssembly)
  • Graphics
    • Render: PostProcessing Bloom, AA MSAA, Texture Filtering
    • Camera: ThirdPerson, Follow
    • Lighting: World Lighting, Player Lighting, Player Shadows
    • Meshes: Meshes, Textures, Shaders, Materials, [ ] Texture tiling
    • Sky: Color, Cubemap, Fog
  • World
    • Physics [ ] hitbox [ ] gravity
    • Simulation: Tick Systems
  • Scripting
    • Console
  • Animation
    • Character
  • Input
    • UI: lauch screen, settings menu
    • Input: Keyboard, Arrows, Gamepad
    • Control: [x] Tank control, [ ] Third Person
  • Other
    • launching screen

Repository layout:

├── assets
│   └── images
│   └── ...
├── docs
├── infra
├── lib
│   ├── raylib-5.0_win64_msvc16
│   ├── winmm-10-win64
├── platform
│   ├── engine
│   └── game
├── standalone
│   ├── desktop_win64
└── tools
    └── blender
    └── ci

Install

Windows

CMake:

  • Download the v3.28.3 release of CMake at http://www.cmake.org/download/.
  • Pick Windows (Windows x64 Installer).
  • Run the installer
  • When asked for, select Add CMake to the system PATH for all users.
  • Run software installation...

Visual Studio:

  • Download the Community version of Visual Studio 2022 release of Visual Studio at https://visualstudio.microsoft.com/downloads/
  • Run the installer...
  • Run software Visual Studio Installer
  • When asked for, click on modify under Visual Studio 2002
  • Select Desktop development with C++ (contains MVC package)
  • Click on modify

PowerShell:

cmake -S "." -B "build" -G "Visual Studio 17 2022"

Usage

CLI (pure CMake)

  • Pros: basic, no Editor, CI friendly.
  • Cons: manual actions intensive.
.\tools\ci\install.bat

.\tools\ci\dev.bat
# OR
.\tools\ci\release.bat

VisualStudio 2022 (IDE)

  • Pros: better integration, 1 step compile+debug.
  • Cons: very laggy UI, bad search tools.
.\tools\ci\install.bat

alt text

alt text

VSCode

  • Pros: better code editor, lightweight.
  • Cons: 2 steps compile+debug
.\tools\ci\install.bat

.\tools\ci\watch.bat

Run (press Ctrl+F5, or Menu > "Run" > "Run without Debugging")

Debug (press F5, or Menu > "Run" > "Start Debugging")

alt text

Assets

Pipeline

Installation:

  1. Download io_scene_m3d.py
  2. Start Blender
  3. Go to menu, "Edit" > "Preferences..." > "Add-ons" tab > "Install..." button
  4. Browse and double click on the downloaded file
  5. On the "Add-ons" tab, search for "m3d"
  6. Click on "Enable Add-on."
  7. Now in the menu, "File" > "Export" > "Model 3D (.m3d)" (and eventually "File" > "Import" > "Model 3D (.m3d)") should appear

Get 3D Models:

  1. Start WebBrowser...
  2. https://www.mixamo.com
  3. Click Characters
  4. search "X bot"
  5. Click Download
  6. Check Format: fbx, pose: t-pose
  7. Click Download
  8. Start Blender...
  9. Go to menu, File > New > General ...Delete Cube
  10. Go to menu, File > Import > FBX > "X bot.fbx"
  11. Click on the "Texture Paint" tab > click "new" > type "X_bot_diffuse"
  12. On right side panel > click "material" > "base color" > "image texture" > select "X_bot_diffuse"
  13. Go to menu, File > Export > M3D > scale: 2.0 > "X_bot.m3d" > Export

Get 3D Animations:

  1. Start WebBrowser...
  2. https://www.mixamo.com
  3. Click Animations
  4. search "Slow Run"
  5. check "In Place" box
  6. Click Download
  7. Check Format: fbx, Skin: with skin
  8. Click Download
  9. Start Blender...
  10. Go to menu, File > New > General ...Delete Cube
  11. Go to menu, File > Import > FBX > "Slow Run.fbx"
  12. Click on the "Animation" tab > click "editor type icon" > "non linear animation" (new channel editor)
  13. click "push down action" (new channel)
  14. Go to menu, File > Export > M3D > scale: 2.0 > "Slow Run.m3d" > Export

FAQ

Why Models are sometime unlit ?

Cause: Blender export changes materials indexes (start with 0 or 1) and lighting shader needs to be applied to real material.

  • *.obj, *.iqm formats: use material[0]
  • *.m3d, *.glb formats: use material[1]

alt text

What about performance ?

Condition: GPU: RTX-2060, CPU: i5-9600K, RAM: 32 GB

  • Raylib (GL3) "High": ~2500 FPS (AA 4x, Postpro Bloom)
  • Raylib (GL3) "Low": ~3000 FPS
  • Unreal (DX12) "Low": ~150 FPS (Settings=Low)

alt text

alt text

Resources

References

There are several games made with raylib to highlight:

There are also many small games (and tools) made with raylib on itchio: https://itch.io/c/380928/made-with-raylib

About

2024's small template to start your raylib game. Featuring 3D, C 2017, Raylib 5.0, OpenGL 3 and a modular architecture.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published