DX10: Adjacency Primitives

Started by
2 comments, last by StephenTC 16 years, 8 months ago
Hey everyone, I'm taking time to read through the DX10 SDK. I'm curious about the adjacency primitives for geometry shaders. How does the DX10 system determine what primitives (triangles or lines) are adjacent to the current primitive that is being analyzed in the geometry shader? Is an index buffer required to make this work? Does DX10 compare all of the referenced indices to determine if primitives are touching by using the same vertices. In this case, triangles considered to be adjacent MUST use the same indexed vertexes, right? - Or... - Does DX10 compare each of the vertex positions in space to determine if they are touching. If this is the case... that sounds slow since this is something that happens every time you bind it since there is no direct relationship between the input-layout structure and the buffer data itself. Also if this is the case, is there any way to tell it to generate the adjacencies once or does DX10 automatically generate all adjacencies when the data is loaded onto the card even if one was to never use that primitive type. Or are the adjacencies not created until the very first time they are needed and then saved until the vertex/geometry data changes???? (this sounds a little smarter) - Or... - Are adjacencies just literally what is adjacent in memory. If this is the case then triangles could be sprawled out all over the mesh but be right next to each other in memory. I highly doubt the case. I'm sure someone out there can tell me what's going down :D. Thanks a bunch! Stephen Timothy Cooney
Advertisement
Hi,

As far as i know, the adjacency data must be created yourself. There is probably a function in DXUT to do this. But I do know DX10 wont work out adjacency information itself.

The adjacency info does not refer to adjacent in memory, but adjacent on the mesh surface.

I have only done a small amount of adjacency work using my own custom mesh structure but there is definitely some cool effects you can do with it such as GPU based mesh simplification.

Hope these ramblings help :P
Quote:Original post by RocketTree
As far as i know, the adjacency data must be created yourself. There is probably a function in DXUT to do this. But I do know DX10 wont work out adjacency information itself.
From ShadowVolume10 sample docs:
Quote:In order for the geometry shader to find silhouette edges it must know which faces are adjacent to each other. Fortunately, the geometry shader has support for a new type of input primitive, triangleadj. Triangleadj assumes that every other vertex is an adjacent vertex. The index buffer of the geometry must be modified to reflect the adjacency information of the mesh. The CDXUTMesh10::ConvertToAdjacencyIndices handles this by creating an index buffer in which every other value is the index of the adjacent vertex of the triangle that shares an edge with the current triangle. The index buffer will double in size due to the extra information being stored.
There's also ID3DX10Mesh::GenerateGSAdjacency() if you're not using the DXUT framework...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Ahhhh, so you actually have to create the adjacencies as you would any other vertex based primitive.

...

Wow, that seems silly, why did they call it an adjacency primitive? I mean you can send ANYTHING you want as the 'adjacent' triangles. Why not call it like... quadrangles since for every 'triangle' you pass in you pass 3 vertexes, making 3 triangles. Also you could use those 'adjacent' vertexes to create a COMPLETELY different triangle couldn't you?

This seems silly to me. It really hasn't got anything to do with adjacencies, unless you MAKE it work like that, either yourself or using their functions.

It would be nice if you could pass in any number of triangles you want since (from my readings) you can create and output any number of any kind of primitive... Oh well, DX11 I suppose. haha.

I'm just whining because I have to do work :)

This topic is closed to new replies.

Advertisement