New Graphics card and texture errors

Started by
16 comments, last by WebsiteWill 20 years ago
Have you checked your vertex filling code? The Radeon might be making different assumptions when you''re filling up the buffer, so your texture coords might be getting stepped on. I''ve got a Radeon 9800 XT and I''ve not seen a single driver bug in some serious out-of-the-way tests. I''m not saying they don''t exist, but this problem doesn''t seem to scream ''unique test case''...

Chris Pergrossi
My Realm | "Good Morning, Dave"
Chris PergrossiMy Realm | "Good Morning, Dave"
Advertisement
Pretty positive that this isn''t a driver issue. I updated the drivers yesterday and the problem remains. However, after fiddling with the code last night I as able to get some color back into the program for certain icons (the ones that were previously showing in black). However, most icons still are not displaying at all. I have checked and rechecked my vertex filling code and texture coordinate code and see nothing wrong yet. Will keep looking (as if I have a choice).

Thanks,
Webby
Here is the all inclusive "skinny"
I have commented out all window rendering calls except the call to render my mouse cursor. It, of course, does not show up on the screen. Keep in mind that the other render calls are pretty much identical and some parts of the interface renders while other parts do not. This same code was working just before I replaced video cards.

//In DoFrameGetCurrentDisplayDevice()->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );GetCurrentDisplayDevice()->BeginScene();GetCurrentDisplayDevice()->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);RenderGUI();		GetCurrentDisplayDevice()->EndScene();GetCurrentDisplayDevice()->Present(NULL, NULL, NULL, NULL);//The RenderGUI function without all the other calls to render//other windowshr = GetCurrentDisplayDevice()->SetTransform(D3DTS_PROJECTION, &m_Ortho2D);hr = GetCurrentDisplayDevice()->SetTransform(D3DTS_WORLD, &m_Identity);hr = GetCurrentDisplayDevice()->SetTransform(D3DTS_VIEW, &m_Identity);hr = GetCurrentDisplayDevice()->SetRenderState(D3DRS_LIGHTING, FALSE);hr = GetCurrentDisplayDevice()->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);hr = GetCurrentDisplayDevice()->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);hr = GetCurrentDisplayDevice()->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);hr = GetCurrentDisplayDevice()->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);hr = GetCurrentDisplayDevice()->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );hr = GetCurrentDisplayDevice()->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TFACTOR );hr = GetCurrentDisplayDevice()->SetVertexShader(NULL);hr = GetCurrentDisplayDevice()->SetStreamSource(0, m_pUIVB, 0, sizeof(CUSTOMUIVERTEX) );hr = GetCurrentDisplayDevice()->SetIndices(m_pUIIB);hr = GetCurrentDisplayDevice()->SetFVF(D3DFVF_CUSTOMUIVERTEX);RenderCursor(0);//RenderCursorD3DXMatrixTranslation(&m_matCursorPosition,		   m_poMouseCursorPosition.x, m_poMouseCursorPosition.y, 0.0f);if(m_CursorTexture != NULL){	hr = GetCurrentDisplayDevice()->SetTexture(0,              m_CursorTexture->ptrTexture);}hr = GetCurrentDisplayDevice()->SetTransform(D3DTS_WORLD,      &m_matCursorPosition);hr = GetCurrentDisplayDevice()->SetRenderState     (D3DRS_TEXTUREFACTOR, D3DCOLOR_ARGB(255, 255, 255, 255) );hr = GetCurrentDisplayDevice()->DrawIndexedPrimitive     (D3DPT_TRIANGLELIST, 0,     (m_iCursorStartIndex+(iWhichCursor*4)), 4,	       (m_iCursorStartIndex+(iWhichCursor*6)), 2);


m_CursorTexture is not NULL. I have checked and it is indeed using the file path and is associated with the file name "pointer.bmp". Other textures loaded appear correct as well. This code should produce a blue screen and a mouse pointer at the location of the mouse coordinates (defaulted to 0,0 on program startup).

Any ideas?
Thanks,
Webby
No clues or has the post fallen by the wayside?
Need to see some other piece of code?

Need help. Over a week and still can''t figure this one out

Webby
It''s time to reinvent the wheel. Start with a basic skeleton code shell, get things working 1 line/routine at a time until you end up where you were before the card change. Looks like it''s time to give up thinking about the 1 line fix. Good luck!
I would try to do this with DrawPrimitive instead of using indices, at least to verify there''s nothing wrong with the vertex data. Indicies can get confusing. I can''t see enough of your code to know if it looks right or not, but in my case most of the problems I ran into were with indices, until I became very familiar with them. If drawing simple quads doesn''t work right, non-indexed, then it''s a lot easier to track the problem down.

Chris
Chris ByersMicrosoft DirectX MVP - 2005
Well early this am before I headed off to work I did some more investigating and found something interesting. My code is set up to query the main display adapter and for display modes and I found this:

if((uiModeCount = m_pD3D->GetAdapterModeCount(iAdapter,
m_ppFullscreen.BackBufferFormat)) ==0)
{
//This adapter has NO display modes or the call failed

MessageBox(g_cApp.GethWnd(), "GetViableFSAdapterModes",
"Direct3DCreate9", MB_YESNO);
return false;
}

The code above is returning false (the Message box is new) when iAdapter is 0 or 1. It is not finding any display modes for my device. Further digging and I realized that the ATI 9800 pro supports dual monitors -- found this when I saw Device Manager had 2 display adapters installed, wondered about this and guy at work told me about the dual monitor support. So I am now pretty sure that this will be the root of the problem though I haven''t had time to try and solve it yet. If not the problem, it is A problem and at least it''s something else that won''t bite me in the buh-hind later on.

Will post final results when I can confirm them, I''m sure this is something others are likely to run into with these cards. The dual monitor support isn''t exactly touted in bold print and the card itself doesn''t have to monitor plugs, it uses a dongle for the extra hookup (not sur ewhy they didn''t just put two regular monitor connections on it...

Anyway, I''m beat. Goodnight all,
Webby
Can anyone see what''s wrong with this? It''s the code I use to set up my vertex and index buffers and initialize a mouse cursor quad and a root window quad. I start with 0 vertices or indices. The mouse cursor would be the first 4 verts and 6 indices and the root quad would be verts 4-7 and indices 6-11.
These numbers are correct while in debug mode. However, when I initialize both quads neither show up. If I comment out the initialization and rendering on either one, the other shows up.
Note, it is not the rendering code because commenting that out doesn''t help. Besides, they render fine when they are alone. I''m getting annoyed with this. All of this code was working before the new video card.
hr = GetCurrentDisplayDevice()->CreateVertexBuffer	( NUM_VERTS_IN_UI * sizeof(CUSTOMUIVERTEX),           D3DUSAGE_DYNAMIC, D3DFVF_CUSTOMUIVERTEX,           D3DPOOL_DEFAULT, &m_pUIVB, NULL );VOID* pVertices;hr = m_pUIVB->Lock( 0, sizeof(CUSTOMUIVERTEX) * NUM_VERTS_IN_UI,                  (void**)&pVertices, 0);memcpy( pVertices, m_VB, sizeof(m_VB));m_pUIVB->Unlock();hr = GetCurrentDisplayDevice()->CreateIndexBuffer	( NUM_INDICES_IN_UI * sizeof(short), D3DUSAGE_WRITEONLY,	  D3DFMT_INDEX16, D3DPOOL_DEFAULT, &m_pUIIB, NULL);VOID* pIndices;hr = m_pUIIB->Lock(0, sizeof(DWORD) * NUM_INDICES_IN_UI,	          (void**)&pIndices, 0);memcpy( pIndices, m_IB, sizeof(m_IB));m_pUIIB->Unlock();//INITIALIZATION CODEint iXOrigin = (g_cGraphicsManager.GetGameWidth()/2) * -1;int iYOrigin = (g_cGraphicsManager.GetGameHeight()/2) * -1;InitCursor(m_VB, m_IB, m_NumVertsUsed, m_NumIndicesUsed,	   20, 20, //size of the cursor	   true,            "..\\..\\Artwork\\pointer.bmp", "pointer");m_NumVertsUsed += 4;m_NumIndicesUsed += 6;UpdateCursor(iXOrigin, iYOrigin);//Initialize root window to size of total screenm_pRoot = new cGUIBaseWindow;m_pRoot->Init(m_VB, m_IB,m_NumVertsUsed, m_NumIndicesUsed,	      GetGameWidth(), GetGameHeight(),	      0,0, //Root should always be 0,0	      NULL, true,	      "..\\..\\Interface Artwork\\env.bmp", "env");//m_rootm_NumVertsUsed += 4;m_NumIndicesUsed += 6;//THE INIT FUNCTION	m_pParent = NULL;	m_iNumWindows = 0;	m_iStartIndex = StartIndex;	m_pParent = pParent;	SetGUIAbsolutePos(AbsoluteX, AbsoluteY);	SetGUIWindowSize(Width, Height);		SetGUIWindowTexture(sTextureFilePath, sTextureName, INTERFACE_TEXTURE);	m_ucAlpha = 255;ptrVertexBuffer[StartVertex + 0].x = 0;ptrVertexBuffer[StartVertex + 0].y = 0;ptrVertexBuffer[StartVertex + 0].z = 0.0f;ptrVertexBuffer[StartVertex + 0].color = D3DCOLOR_ARGB(255, 255, 255, 255);ptrVertexBuffer[StartVertex + 0].u = 0.0;ptrVertexBuffer[StartVertex + 0].v = 0.0;ptrVertexBuffer[StartVertex + 1].x = Width;ptrVertexBuffer[StartVertex + 1].y = 0;ptrVertexBuffer[StartVertex + 1].z = 0.0f;ptrVertexBuffer[StartVertex + 1].color = D3DCOLOR_ARGB(255, 255, 255, 255);ptrVertexBuffer[StartVertex + 1].u = 1.0;ptrVertexBuffer[StartVertex + 1].v = 0.0;ptrVertexBuffer[StartVertex + 2].x = 0;ptrVertexBuffer[StartVertex + 2].y = Height;ptrVertexBuffer[StartVertex + 2].z = 0.0f;ptrVertexBuffer[StartVertex + 2].color = D3DCOLOR_ARGB(255, 255, 255, 255);ptrVertexBuffer[StartVertex + 2].u = 0.0;ptrVertexBuffer[StartVertex + 2].v = 1.0;ptrVertexBuffer[StartVertex + 3].x = Width;ptrVertexBuffer[StartVertex + 3].y = Height;ptrVertexBuffer[StartVertex + 3].z = 0.0f;ptrVertexBuffer[StartVertex + 3].color = D3DCOLOR_ARGB(255, 255, 255, 255);ptrVertexBuffer[StartVertex + 3].u = 1.0;ptrVertexBuffer[StartVertex + 3].v = 1.0;ptrIndexBuffer[StartIndex + 0] = StartVertex + 0;ptrIndexBuffer[StartIndex + 1] = StartVertex + 1;ptrIndexBuffer[StartIndex + 2] = StartVertex + 2;ptrIndexBuffer[StartIndex + 3] = StartVertex + 2;ptrIndexBuffer[StartIndex + 4] = StartVertex + 1;ptrIndexBuffer[StartIndex + 5] = StartVertex + 3;m_bIsShown = bShown;m_bDragging = false;


Thanks for any help,
Webby

This topic is closed to new replies.

Advertisement