Page 1 of 1

Dreamcast: VQ Texture Examples

Posted: Wed Jun 25, 2014 5:21 pm
by Light-Dark
So lately I've been working on compressing textures for the Dreamcast build of my engine and I noticed while hunting for examples that there is really only 1 example of VQ texture compression provided with KOS that is made for KGL (the OpenGL PVR wrapper). So I decided to make a couple KGL free examples that just use PVR for rendering and are free to use/modify for people who don't want to slap together their own KGL-less solution. There are currently two examples: one for the textured triangle strip and one for the textured sprite.

https://github.com/Light-Dark/dcvqtex

These examples use the following libraries/tools that should be included with your standard KOS install:

-KMG library
-oggvorbisplay library
-vqenc tool (in utils folder)

I have the Makefiles output scrabmled bin's so if you're using a coder's cable or BBA you may have to modify a couple of lines in the Makefiles to get just an ELF. I've also included the Make_ISO tool so if you're like me and use the Dreamcast SD Card Reader and Dreamshell to test your programs you should also be good to go :D

To compress the texture simply type "make vq"

If you're not using a texture with an alpha channel remove the -a flag passed to vqenc in the makefile and in the Load_VQTexture function change this
text->fmt = PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_VQ_ENABLE | PVR_TXRFMT_TWIDDLED;
to this:
text->fmt = PVR_TXRFMT_RGB565 | PVR_TXRFMT_VQ_ENABLE | PVR_TXRFMT_TWIDDLED;
If you don't want twiddling, simply remove the -t flag and remove the pvr twiddling flag.

Lastly before anyone asks yes that song choice was totally intentional. Enjoy.


EDIT:

As of right now I've added an example that uses the texconv tool made by Tvspelsfreak instead of vqenc.