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?