Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Quake3 BSP Lightmaps

This topic is 5751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m having trouble loading the lightmap textures from a quake3 BSP file with D3DX. I''m following the tutorial from GameTutorials and it uses gluBuild2DMipmaps to load them, but thats OpenGL. Is there a D3DX equivalent?

Share this post

Link to post
Share on other sites
back when we all used dx7, it was


but that may have changed...

(and yes, i need to upgrade and get into dx8 development)

Share this post

Link to post
Share on other sites
Here's my code to load Q3A lightmaps:


for(int i=0;i < numlightmaps;i++)


for(int j=0;j < 128*128;j++)
//swap the bytes to the way D3D likes it

((unsigned char*)lr.pBits)[j*4+0] = lightmapdata[128*128*3*i+j*3+2];
((unsigned char*)lr.pBits)[j*4+1] = lightmapdata[128*128*3*i+j*3+1];
((unsigned char*)lr.pBits)[j*4+2] = lightmapdata[128*128*3*i+j*3+0];
((unsigned char*)lr.pBits)[j*4+3] = 255;


I gave you the whole source cause there are some subtleties.

If you ever release your source, let me know. I'm collecting links to Q3A BSP renders.

[edited by - RollingRock on December 23, 2002 11:54:28 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!