blender_io_export_psx_mesh/README.md

2.9 KiB

Pic or it didn't happen

Blender PSX Level export

Blender <= 2.79b plugin to export gouraud shaded, UV textured PSX meshes in a scene to a C file.

3d scene pre-rendered BGs Push things Sprite Vertex animation

Features

Be warned this is WIP !

Plugin

  • Export UV textured models
  • Export vertex painted models
  • Export camera positions for in game use
  • Export vertex animations
  • Export up to 3 light sources
  • Export pre-rendered backgrounds for in-game use (8bpp and 4bpp)

comparison
Real-time 3D / 8bpp background / 4bpp background

"Engine"

  • Very basic physics / collision detection
  • Constrained camera trajectory
  • Orbital camera mode
  • Basic Spatial partitioning
  • Portal based camera angle switch
  • 3D sprite
  • VRam auto layout for TIMs

Planned

  • Fix and improve all the things !
  • Wall collisions

Install the plugin

This plugin is not compatible with Blender > 2.79.

  1. Download and install Blender 2.79b.

http://download.blender.org/release/Blender2.79/

  1. Clone this repository in the addons folder of blender 2.79 :
git clone https://github.com/ABelliqueux/blender_io_export_psx_mesh.git

You'll need to have pngquant and img2tim utilities installed and in your path for PNG to TIM conversion.

Windows executables are provided for convenience in this repo.

For users with Imagemagick installed, there is an option when exporting to use that instead of pngquant.

On Linux : ~/.config/blender/2.79/scripts/addons On macOS : ./Blender.app/Contents/Resources/2.79/addons On Windows : %USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\2.93\

Compiling

TODO: Update these instructions

The provided Makefile uses the Nugget+PsyQ setup.

  1. Clone this repo in (...)/pcsx-redux/src/mips/
  2. Enter the blender_io_export_psx_mesh folder
  3. Install the plugin in blender, then open level.blend
  4. Export as 'level.c'
  5. Type Make

You can use img2tim to convert your blender texture in a tim file.

Credits

Based on the code provided by TheDukeOfZill, 04-2014, on http://www.psxdev.net/forum/viewtopic.php?f=64&t=537#p4088
PSX code based on example by Lameguy64
pngquant : https://github.com/kornelski/pngquant
img2tim : https://github.com/Lameguy64/img2tim
Freeimage : https://freeimage.sourceforge.io/