I Got My DX9!!!

Daily 08/28/03

Spent the morning talking with Alex and running him through the stuff I did yesterday. With nice alpha maps, we get ships that look real cool.

 

Then tried to convince Cari to switch to DX9. After a discussion about Minimum requirements with Brad and actually running an examples on Cari’s laptop, it was decided. Let’s do it!

 

This is where the fun started. I got the effect to load up fine straight from EffectEdit to my program in a few lines. It was beautiful!

 

Load:

   HRESULT hr;

   hr = D3DXCreateEffectFromFile(pDevice, "Gfx\\map_data\\colonyship.fx",

                                 NULL, NULL, 0, NULL, &m_pEffect, NULL)

  

   m_hTechnique = m_pEffect->GetTechniqueByName("TShader");

 

Render:

   hr = m_pEffect->ValidateTechnique(m_hTechnique);

   hr = m_pEffect->SetMatrix("WorldView", &matWorldView);

   hr = m_pEffect->SetMatrix("Projection", g_pCamera->GetProjMatP());

   hr = m_pEffect->SetTechnique(m_hTechnique);

   hr = m_pEffect->Begin(&uNumPasses, 0);

   hr = m_pEffect->Pass(0);

   hr = pDevice->SetMaterial(m_pMaterial);

   hr = pDevice->SetTexture(0, m_pTexture);

   hr = m_pMesh->DrawSubset(0);

   hr = m_pEffect->End();

 

Only problem was that I wasn’t getting anything on the screen. After mucking around for quite a bit of time, I learned that it had something to do with the shader. If I wrote a simple shader that didn’t do any special processing, I was drawing like a champ. Looks like I’ll have to understand shaders more before we use this in production. But hey, learning is half the fun.

 

Anyways, I’ve got my DX9. I’ll probably have to do the conversion myself, but it’ll be cool.

 

Texture discussions with Alex and Cari.

Does this make sense?

Our goal is to create sector textures large enough so that when the user zooms in to the max, we don’t get really bad texture filtering or pixilation.

 

1) If a user runs at 1024x768, then a 512x512 texture should be able to cover most of the screen with a 1:1 pixel/texel mapping. Of course accounting for UI widgets and stuff that’ll eat most of the 256 pixels left over (768-512).

 

2) If a user runs at 1280x1024, then we can increase the texture resolution to 768x768.

 

3) If a user runs at 1600x1200, then we can increase the texture resolution to 1024x1024.

 

Now, this begs the question about video card capacity. An older video card may not support 1024x1024 textures. Well, this is where we really nail it. If a user can run at 1600x1200, then their video card will most likely be a newer card, or at least one with lots of video memory and so can use the larger textures. The lower the resolution, the lower the texture requirement and thus, the lower the video memory requirements.

 

The argument sort of breaks down at the higher resolutions because the UI widgets take up proportionally less space at the high res modes. Therefore, the 3d view space is much larger and you may find a users zooming in such that the 1024 texture shows signs of pixilation. Well, I guess we could tweak the UI or texture size a bit if we have to. Going to 1280 will definitely help.

 

Pretty cool huh? If it makes sense? What do you think?

 

11,072 views 3 replies
Reply #1 Top
Great work Joe, I love the fact that your documenting everything it really gives an idea on what the hell is going on.

I really can't way to see what dynamic lighting will do to the over all look of the models, I am wondering though would that mean we will also have to include a Specular map aswell? If so that's fine since I make one anyway but bake it right into the texture.

AlexG
Art Director - StarDock
Reply #2 Top
Joe I am going to give you a better alpha channel straight from max.. Since I am making all the textures in max and not drawing them in Photoshop I have the ability to mask out the color areas better, so we won't get any bleeding. One think we should really discuss is how to make the ships really stand out when viewed from far away. I also have the ability to make a luminosity map which I am thinking can be used for a glow map as well, that way the ship will really stand out.
Reply #3 Top
Well, I've been thinking about how to make the ships stand out. The nice thing about moving to DX9 for this project is that I can code all the different techniques into one file (I think). This means really rapid development. Even you could modify the effect file and test stuff.

Anyways, back to the question at hand. I think that it'll be pretty easy for us to do the staged approach we talked about.

1) Colored decals
2) Active circle in the player color.
3) Whole ship tinting
4) TRON style glow maps

Lower end hardware would start at stage 1 and go until they can't support a stage. Higher end hardware would support all stages and they'd get the best graphics. We can also add options to omit or add a stage at the users own risk. It all depends on the time we have and the direction we want to go in.

Don't worry, it'll be cool.