Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


[SOLVED]Strange problem with HAL device


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 01 January 2014 - 07:44 PM

I am having issues with rendering correctly using the HAL device. Rendering works perfectly with a REF device.

 

The issue is that most of the geometry is clipped except the part near to the camera, but not too close.

 

Here are two screenshots illustrating the issue:

REF device (correct rendering):

54hh.png

 

HAL device (incorrect rendering):

t4wc.png

 

I suspect it is a driver issue, but other games run fine. Maybe I am trying to use an unsupported feature? What would cause such an issue as seen above?

 

EDIT: I have an Intel G33/G31 Express Chipset


Edited by BMW, 06 January 2014 - 02:14 AM.


Sponsor:

#2 kauna   Crossbones+   -  Reputation: 2894

Like
1Likes
Like

Posted 02 January 2014 - 02:59 AM

Have you tried disabling your fog effect?

 

[edit]

 

can you show also your znear and zfar values?

Is your viewport set correctly?

 

Cheers!


Edited by kauna, 02 January 2014 - 03:03 AM.


#3 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 02 January 2014 - 03:38 AM

I have tried disabling fog, the problem still existed.

 

zNear = 0.2f

zFar = 300.0f



#4 kauna   Crossbones+   -  Reputation: 2894

Like
0Likes
Like

Posted 02 January 2014 - 04:46 AM

Are you using shaders or fixed function pipeline?

 

Cheers!



#5 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 02 January 2014 - 04:57 AM

Fixed function pipeline.

 

Thanks for replies.



#6 kauna   Crossbones+   -  Reputation: 2894

Like
0Likes
Like

Posted 02 January 2014 - 05:30 AM

Are the distant primitives clipped entirely or by some plane?

 

Cheers!



#7 Mona2000   Members   -  Reputation: 804

Like
1Likes
Like

Posted 02 January 2014 - 06:00 AM

Try switching vertex processing to software (D3DCREATE_SOFTWARE_VERTEXPROCESSING in your CreateDevice call). Some Intel cards still require that.



#8 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 02 January 2014 - 03:41 PM

Distant primitives are not rendered, only primitives as close as shown in the second screenshot are drawn.

 

I am using software vertex processing - CreateDevice() fails with D3DCREATE_HARDWARE_VERTEXPROCESSING.



#9 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 03 January 2014 - 05:46 PM

What??? Apparently my graphics card doesn't support drawing indexed primitives!??! I changed it so that it doesn't use an index buffer (DrawPrimitive rather than DrawIndexedPrimitive) and it fixed the problem.....

 

So, does my graphics card not support indexing, or am I doing something wrong?



#10 Bacterius   Crossbones+   -  Reputation: 10961

Like
1Likes
Like

Posted 03 January 2014 - 07:38 PM

What??? Apparently my graphics card doesn't support drawing indexed primitives!??! I changed it so that it doesn't use an index buffer (DrawPrimitive rather than DrawIndexedPrimitive) and it fixed the problem.....

 

So, does my graphics card not support indexing, or am I doing something wrong?

 

It's more likely you're using it in a way that's wrong or that your graphics card doesn't support. But we're all fresh out of crystal balls, so perhaps you would like to post how you are creating the index buffer, how you are binding it to the pipeline, and how you're issuing the draw call?


“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


#11 BMW   Members   -  Reputation: 160

Like
0Likes
Like

Posted 03 January 2014 - 08:11 PM


But we're all fresh out of crystal balls, so perhaps you would like to post how you are creating the index buffer, how you are binding it to the pipeline, and how you're issuing the draw call?

Creating:

g_pD3DDevice->CreateIndexBuffer(size, D3DUSAGE_WRITEONLY | D3DUSAGE_SOFTWAREPROCESSING, D3DFMT_INDEX32, D3DPOOL_DEFAULT, &g_pIB, NULL)

Binding:

g_pD3DDevice->SetIndices(g_pIB);

Drawing:

g_pD3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, primitives * 2, 0, primitives);

And if it helps, this is how I create the device (the software vertex processing device is used as my hardware doesn't support hardware vertex processing):

D3DPRESENT_PARAMETERS D3Dpp;

ZeroMemory(&D3Dpp, sizeof(D3DPRESENT_PARAMETERS));

D3Dpp.AutoDepthStencilFormat = D3DFMT_D16;
D3Dpp.BackBufferCount = 1;
D3Dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
D3Dpp.BackBufferHeight = pGame->screenHeight;
D3Dpp.BackBufferWidth = pGame->screenWidth;
D3Dpp.EnableAutoDepthStencil = TRUE;
D3Dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
D3Dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
D3Dpp.Windowed = !pGame->fullscreen;
D3Dpp.hDeviceWindow = hWnd;

if(!(SUCCEEDED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
    D3DCREATE_MIXED_VERTEXPROCESSING, &D3Dpp, &g_pD3DDevice))))
{
    if(!(SUCCEEDED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
        D3DCREATE_SOFTWARE_VERTEXPROCESSING, &D3Dpp, &g_pD3DDevice))))
    {
        return false;
    }
}

Edited by BMW, 03 January 2014 - 08:15 PM.


#12 unbird   Crossbones+   -  Reputation: 7163

Like
1Likes
Like

Posted 05 January 2014 - 08:48 AM

I'd have a look at the device capabilities using IDirect3D9::GetDeviceCaps or the caps viewer tool from the SDK and check if you're not hitting a limit somewhere. In particular, since you're using 32-bit indices, check if MaxVertexIndex is greater than 0xFFFF.

#13 BMW   Members   -  Reputation: 160

Like
1Likes
Like

Posted 05 January 2014 - 11:47 PM

I'd have a look at the device capabilities using IDirect3D9::GetDeviceCaps or the caps viewer tool from the SDK and check if you're not hitting a limit somewhere. In particular, since you're using 32-bit indices, check if MaxVertexIndex is greater than 0xFFFF.

Thank you.

 

MaxVertexIndex was 0xFFFE.

 

Problem Solved.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS