Direct3D Not working outside project?

Started by
12 comments, last by Jason Z 11 years, 1 month ago

Can you show a screen shot of the PIX mesh window for 'Pre-' and 'Post-' vertex shader? It looks like one of the two triangles is being culled, and it would be helpful to see what w-values those triangles have before heading into the rasterizer (the xyz would be interesting too).

One other thing to try is to use the reference device and generate a PIX frame grab from that with a debug build and a release build to see if anything is different between the two, as well as to find out if it properly renders the scene. If you aren't getting any errors, and you get totally different results between debug and release builds, then it could potentially be something with your driver (have you updated recently?).


Jason, do you mean this?
https://dl.dropbox.com/u/15579799/dxscreens/pix2.jpg

It says post vertex shading disabled. I'm going to try a working version in PIX now

Advertisement

I ran the working build in PIX and grabbed two screenshots.

https://dl.dropbox.com/u/15579799/dxscreens/working_pix1.jpg

https://dl.dropbox.com/u/15579799/dxscreens/working_pix2.jpg

I'm not familiar with PIX but I can't really spot any differences between the builds. *edit* err, actually- on the working build, what on earth is that 4th position value (-4310602xxxx)? I grabbed my graphics card's latest drivers yesterday. it didn't work on my friends PC (ATI gfx card) but the error does not occur on my other friend's PC (nvidia).

There is a possibility that im rendering the triangle list in the wrong order. I render a rectangle in this order:

// 0 - bottom left
// 1 - top left
// 2 - top right

// 3 - bottom left
// 4 - top right
// 5 - bottom right

I did have backface culling disabled
// Disable backfaces
d3ddev->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);

I switched to
// Disable backfaces
d3ddev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);

But noticed no difference. Thanks Jason for your help

OH WOW. It was the rhw value. It's never set for any vertices. I set every vertex rhw value to 1.0 and now it's working in every build.

Thank you so much Jason, if you didn't suggest PIX and comparing the two I never would have spotted this. I'm not sure how the reputation thing works but I tried to add some rep for you. Thanks again, I think it's fully solved now

Great - I'm glad that its all cleared up now. I have seen it a few times before where if the w value isn't correct then you can get flaky partially culled geometry, so it is a good place to start looking when you see those symptoms. I still think it is strange that there was a difference between debug and release, but if its fixed, then its fixed! Thanks for the reputation bump too :)

This topic is closed to new replies.

Advertisement