Dreamcast: VQ Texture Examples

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Dreamcast: VQ Texture Examples

Postby Light-Dark on Wed Jun 25, 2014 6:21 pm

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.


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

to this:

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.


As of right now I've added an example that uses the texconv tool made by Tvspelsfreak instead of vqenc.
<tpw_rules> LightDark: java is a consequence of inverse moore's law: every 18 months, the average program will be twice as slow. therefore, computers always run at the same percevied speed. java's invention was a monumental step

User avatar
Dreamcast Developer
Dreamcast Developer
Posts: 307
Joined: Sun Mar 13, 2011 8:57 pm
Location: Canada

Return to Programming Discussion

Who is online

Users browsing this forum: No registered users and 1 guest