Adventures in texture land.

Daily 08/27/03

After checking in the new camera and grid code for the project, I spent the the afternoon trying to figure out how to get the different colors onto our ships including a cool glow effect.

 

Here’s what I came up with.

 

Through a much frustration and a little magic from the “Advanced 3D Game Programming” book, I finally got the texture ops to work.

 

Scott helped me convert Alex’s battleship map into a .tga with an alpha channel.

 

 

The white parts have no alpha. This may come back to bite me (as you’ll see later), but I’m plowing through with this.

 

First I just tried this:

SetTextureColorStage(g_pDevice, 0, D3DTA_TEXTURE, D3DTOP_SELECTARG1, 0);

 

Notice how you can see space and other parts of the ship behind it? That’s where I think having the alpha channel hurt me. Now I had to worry about the alpha channel.

 

Adding a line to support the alpha didn’t work too great. I got the parts of the ship filled in, but they weren’t colored. Check this out:

 

SetTextureAlphaStage(g_pDevice, 0, D3DTA_DIFFUSE, D3DTOP_SELECTARG1, 0);

 

Finally, after mucking with the flags for many minutes, I came up with the combination that works:

 

SetTextureColorStage(g_pDevice, 0, D3DTA_TEXTURE, D3DTOP_BLENDTEXTUREALPHA,

                     D3DTA_DIFFUSE);

SetTextureAlphaStage(g_pDevice, 0, D3DTA_DIFFUSE, D3DTOP_SELECTARG1, 0);

 

Boy, that was enough for today. I’m not finished yet though…

 

I’m working on getting a cool glow effect on the ships now. Scott’s helping me out with the glow maps and Ian sent me a link to some cool technology that’ll help. Think TRON2.0

 

    http://developer.nvidia.com/docs/io/4000/D3DTutorial_EffectsNV.pdf

 

 

Joe

15,142 views 5 replies
Reply #1 Top
Thats some crazy shizt, you're pumping out there, Joe! I'd still love to see the glow extend past the mesh, but one step at a time ;)
Reply #2 Top
I'll work on that. I'm not sure if it's done with emissive light, or if it's an after effect with the framebuffer. More research needed. Maybe Ian or Cari could lend some research.
Reply #3 Top
Hey, nice work, guys! Teamwork is a beautiful thing.
Reply #4 Top
Pretty cool. One suggestion - better headlines. ;)
Reply #5 Top
What's wrong with Daily? This is a development journal. I guess I could switch the headlines and subheadlines.