rjShadow

As seen in these two screenshots,

Glitch 1
Glitch 2

In reality, I don't know what's even happening to my vertices. This doesn't happen from the beginning of the program execution, it happens randomly during the execution about a few minutes into running it. Once it happens, it will happen more frequently and sooner during the program execution when I re-compile and run.I just don't have a name for this. It happens to a handful of random vertices. I would like to think my vertex buffer is being corrupted, but when I use the D3D Debug tools, the problem doesn't happen at all.For more information, the first picture contains geometry that is rendered directly to the screen. In the second, I'm rendering geometry first to a render target, and then post processing - as you can see, the ID3DXFonts (rendered VERY last) are even getting skewed.


Re: Game Technologies: General Strange DX9 vertex glitch

Inaki Ayucar

Wow !

really awsome. Sure ití»s not as simple as a projection matrix problem, watching those Dx Fonts skewed.

Can you tell something about your hardware and software (Graphics card, driver version, windows version, etc)






Re: Game Technologies: General Strange DX9 vertex glitch

rjShadow

I'm running SP2. This is happening on every machine I run it on, but FYI i'm running a nvidia 6800 GT, obviously DX9.

I'm using ps_2_0 if that makes any difference.

I'll also say that sometimes it happens JUST to one of the textures, then most of my pre-defined vertex data (cubes, planes), then to my models (.x). Any assortment of those three. I love the second pic I posted because I'm doing some heat distortion post processing and it looks like everything is totally out of whack.




Re: Game Technologies: General Strange DX9 vertex glitch

Inaki Ayucar

Ok, thatí»s clarifying. If ití»s happening on different machines, ití»s obviously up to your software.

Discarding a hardware problem, and watching to those distorted DX letters, Ií»d bet my right hand ití»s related to your post-processing system.






Re: Game Technologies: General Strange DX9 vertex glitch

rjShadow

I guess I wasn't very clear. The first image has no post-processing whatsoever.



Re: Game Technologies: General Strange DX9 vertex glitch

Inaki Ayucar

Ok, didní»t get that. Maybe ití»s not just a single problem what ití»s causing this error:

If ití»s not somethind "machine-related", ití»s in your software. It can be two kind of things:

1.- Thereí»s a very basic problem: related to video drivers, DX version or incompatibilities in every machine you tested, what I find very unprobable, or,

2.- Thereí»s somethind wrong in your software.

This kind of distortions can be due to:

1.- If using fixed function pipeline: the projection matrix

2.- If using programmable shaders: the vertex shader or the projection matrix.

3.- If using post processing: obviously your post-processing system.

Try deactivating features, to isolate the problem (switch to fixed function pipeline and deactivate post-processing, for example). If it still happens, monitor your projection matrix to see if it changes at any moment.






Re: Game Technologies: General Strange DX9 vertex glitch

Inaki Ayucar

Thereí»s another possibility that I didní»t mention:

Are you changing at any time the Vertex Format of the rendered objects Ií»ve seen before those distortions when using a wrong vertex format.

1.- Ensure that every object in your scene has the same vertex format (I do that cloning all the meshes to my own format at load time)

2.- Before every rendering call in your engine, meshes, polygons, text, whatever, ensure to set the proper vertex format in the device

Hope this helps.






Re: Game Technologies: General Strange DX9 vertex glitch

rjShadow

Ohh, that's probably it. Do you have a link showing how to do this Even though my knowledge with programming is solid, my knowledge of DirectX is a bit rusty.



Re: Game Technologies: General Strange DX9 vertex glitch

rjShadow

Ok, I got it to clone the mesh. Now I have a much more interesting issue.

When i change the declaration, DirectInput doesn't acquire the keyboard. When I put the declaration back, no problems at all.




Re: Game Technologies: General Strange DX9 vertex glitch

Inaki Ayucar

Hi there !

In glad I could help you. I also had to deal with vertes formats some time ago...

About the DirectInput problem, im sure ití»s not VertexFormat related. It should be something else...

Can you tell me more about how you initialize it Buffered, inmediate, some piece of code would be great too..






Re: Game Technologies: General Strange DX9 vertex glitch

rjShadow

No, that didn't work at all. When I use my declaration, it crashes on DrawSubset.


D3DVERTEXELEMENT9 Declaration[MAX_FVF_DECL_SIZE];
if( FAILED(pMeshData->pMesh->GetDeclaration(Declaration) ) ) return E_FAIL;
pMeshData->pMesh->CloneMesh(D3DXMESH_MANAGED, Declaration, pd3dDevice,
&newMeshContainer->MeshData.pMesh);


That code came from one of the DX9 samples, and it's worked up to now.

My declaration is called "SDec", looks like
D3DVERTEXELEMENT9 SDec[] =
{
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
{0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
{0, 20, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0},
{0, 32, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0},
D3DDECL_END()
};

This matches the vertex dec, no difference at all. I must be using clonemesh incorrectly.

Remember, my issue is that the glitch happens about 2-5 minutes into the programs execution. Everything looks great up to then! Then, slowly, everything goes to hell.





Re: Game Technologies: General Strange DX9 vertex glitch

Inaki Ayucar

Ok, if it fails with your declaration, then thereí»s something wrong with it.

Doní»t get confused with the fact it crashes after 2 minutes, thereí»s nothing magic in your computer. Obviously something happens then that makes it fail. Something changes in your software. You must monitorize it well and find out whatí»s the change.

Try to take big parts of your software off until it works, and then apply them again, one by one. When you find the big one that makes the mistake, do the same with smaller parts, etc.

Anyway, In my opinion it has to be one of these three:

* Vertex Format

* VertexShaders problem: (are you correctly passing the ProjMat to the VShaders with SetValue Are you always doing the projection operation correctly )

* Post Processing Engine.