Archived

This topic is now archived and is closed to further replies.

OB1st

Video card for "real time tricks book" examples

Recommended Posts

Hello I just purchased real Time rendering tricks and techniques with DX8.1. (I did not recive it yet) Does anyone knows weather I need special video card to run the shader examples. This will help me before I get stuck with the wrong card as I am planning to buy a pc this week with the school starting offers. Many thanks for the advice.

Share this post


Link to post
Share on other sites
No you don''t, vertex/pixel shaders can run in software, though slower.

-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: http://students.washington.edu/andrey

Share this post


Link to post
Share on other sites
Well, pixel shaders are only emulated in the reference device, which isn''t very useful at all. Vertex shaders will run on every card, but they''ll only be hardware-accelerated on GeForce3+, Radeon 8500+ and Matrox Parhelia, but it''s not much slower if you run them in software mode.


- JQ
Full Speed Games. Coming soon.

Share this post


Link to post
Share on other sites
The book was actually written on a laptop with a GF2Go and all examples perform well with the exception of the pixel shaders (for obvious reasons). The greater majority of the pixel shader examples should work well on a GF3 or better. Some of the samples highlight ps1.4 features, which would make them Radeon specific. However, equivalent techniques are probably doable in upcoming shader versions. The ps1.4 examples should be conceptually useful even if you don't have a radeon.

While we're on the subject, A couple of things to watch out for...

Assuming you have a decent card, you might want to completely disable the code that checks the available shader version upon initialization (you'll see what I mean when you see the book). There are a couple of problems with the checks. Basically, the code only checks a specific shader version, which means that better cards "fail" the same as older cards.

The fix is very easy. Just replace this:
D3DCAPS8 Caps;
m_pD3D->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &Caps);
if (Caps.VertexShaderVersion == D3DVS_VERSION(1,1))
{
if (FAILED(EasyCreateWindowed(m_hWnd, D3DDEVTYPE_HAL,
D3DCREATE_HARDWARE_VERTEXPROCESSING)))
return FALSE;
}
else
{
if (FAILED(EasyCreateWindowed(m_hWnd, D3DDEVTYPE_HAL,
D3DCREATE_SOFTWARE_VERTEXPROCESSING)))
return FALSE;
}


With this (assuming you know your card is capable):

if (FAILED(EasyCreateWindowed(m_hWnd, D3DDEVTYPE_HAL,
D3DCREATE_HARDWARE_VERTEXPROCESSING)))
return FALSE;


[edited by - CrazedGenius on August 30, 2002 12:43:51 PM]

Share this post


Link to post
Share on other sites