Jump to content
  • Advertisement
Sign in to follow this  
thehan

patches in DirectX?

This topic is 4762 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I'm just wondering if anyone could post some source on how to draw a simple bspline(or anything) patch surface in DX. Also is there any way to draw just a simple patch object without loading a mesh? Maybe one can create a patch mesh by specifying data in the program? Anyway, that is what I would like to do. /thehan

Share this post


Link to post
Share on other sites
Advertisement
Please help anyone. All I want to know is how to use this overload of the patchmesh constructor:

public PatchMesh(
Device device,
PatchInformation information,
int numberPatches,
int numberVertices,
VertexElement[] declaration
);

I have never used patches or patchmeshes before, so if anyone just had a little experience on the subject maybe they could help me get started.

Share this post


Link to post
Share on other sites
Are you wanting to use Direct3D's built in higher order surface (HOS) functions? (That code snippet looks like MDX, but I can't tell for certain[smile])

The problem is 2 of the main vendors (ATI/Nvidia) took differing views on the HOS implementations - and various driver revisions have seen functionality added/removed. Or, at least ATI removed it for a bit...

HOS tend to mess up some other algorithms (e.g. sillouette extrusion) such that it hasn't been heavily used by some of the big names/titles, despite it being quite a cool feature [smile]

I recommend you have a look through the developer sites for ATI and Nvidia for some of their samples - although you'll probably find they're all in native DX.
EDIT: Ignore that idea, I just checked their sites - nothing that isn't ridiculously old

hth
Jack

Share this post


Link to post
Share on other sites
JollyJeffers, didn't you make a tutorial about cubic patches a while ago (for DirectX8 IIRC). Though most of the math was above my head, it was a great tutorial. It is for VB and DX8, but I am sure it wouldn't be too hard to port over...

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Are you wanting to use Direct3D's built in higher order surface (HOS) functions? (That code snippet looks like MDX, but I can't tell for certain[smile])

The problem is 2 of the main vendors (ATI/Nvidia) took differing views on the HOS implementations - and various driver revisions have seen functionality added/removed. Or, at least ATI removed it for a bit...

HOS tend to mess up some other algorithms (e.g. sillouette extrusion) such that it hasn't been heavily used by some of the big names/titles, despite it being quite a cool feature [smile]

hth
Jack


Yes, I would like to use surfaces like bspline patches or bezier patches. I know there's also something called N-patches, but as I understand there's no graphics hardware that supports it, at least not from ATI which I'm running.

Quote:
Original post by Sr_Guapo
JollyJeffers, didn't you make a tutorial about cubic patches a while ago (for DirectX8 IIRC). Though most of the math was above my head, it was a great tutorial. It is for VB and DX8, but I am sure it wouldn't be too hard to port over...


I'd like to check this tutorial out. Where can I find it?

Besides, thank you both for your replies.
/thehan

Share this post


Link to post
Share on other sites
Quote:
Original post by Sr_Guapo
JollyJeffers, didn't you make a tutorial about cubic patches a while ago (for DirectX8 IIRC). Though most of the math was above my head, it was a great tutorial. It is for VB and DX8, but I am sure it wouldn't be too hard to port over...

Yup, I did indeed write a tutorial/article on it for VB6/D3D8. I've also been doing some cubic-surface work lately and posting it in my journal (here and here).

Although, the reason I didn't make references to those things was that they're fairly "manual" ways of creating rather trivial quadratic->quintic patches - the reference to a PatchMesh didn't seem to fit this [smile]

However, if you're interested in Higher Order Surfaces then the above things might well be of interest.

Related to the stuff in my journal, I found this article from GDNet: Bezier Curves and Surfaces

Quote:
Yes, I would like to use surfaces like bspline patches or bezier patches. I know there's also something called N-patches, but as I understand there's no graphics hardware that supports it, at least not from ATI which I'm running.

As part of the Direct3D Specification there are a few features for so called "N-Patches" and "RT-Patches", but given the way they work (adding extra triangles to those sent to be rendered) they pretty much need hardware support. You might be able to use them via software vertex processing, but I'm not sure.

The real problem was, as mentioned in my first post, that HOS sounded *really* cool on paper, but in practice just didn't quite work out and had a few odd issues/problems. As such, people didn't use them and hardware/driver support seems to have been put on hold... [headshake]

So, in summary....

You can use some of the resources I've mentioned to "roll your own" - depending on what you're trying to do, this may or may not be an option. Alternatively, you can try to get D3D to do it for you by using software VP, or hardware where available.

hth
Jack

Share this post


Link to post
Share on other sites
Thank you so much, jollyjeffers, I'll check this out.

Actually I didn't really wan't to use patchmeshes (if I'm not able to create them by code patch for patch) cause I want to generate some objects, not load pre-modeled ones.

Just a little question about hardware/software. Are you saying that I cannot work with patches in HLSL? EDIT: Ok, I think I'll be reading those articles before I ask this question...

EDIT: The links "here and here" seems not to work?

/thehan

Share this post


Link to post
Share on other sites
Thehan,
I was helping someone with PatchMesh today in Managed DirectX and C# and thought it might interest you to look at the code.
It's just a basic overview of patches and how to render a simple mesh created with the PatchMesh object.

[The PatchMesh example Source]

Share this post


Link to post
Share on other sites
Quote:
Original post by Armadon
Thehan,
I was helping someone with PatchMesh today in Managed DirectX and C# and thought it might interest you to look at the code.
It's just a basic overview of patches and how to render a simple mesh created with the PatchMesh object.

[The PatchMesh example Source]


Thanks, though as I said, I want to generate my mesh, not load it from a file.

Share this post


Link to post
Share on other sites
Quote:
Original post by thehan
EDIT: The links "here and here" seems not to work?

Odd, the end bit of the links seem to have been chopped off [oh]

the links were to entries in my journal, and should have been:
http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=316777�
and
http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=316777�


EDIT: Okay, so the forum software is eating those links - copy and paste these if you still want to have a look:

http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=316777 & # 2176859
http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=316777 & # 2172953

You'll have to remove the spaces between the '&' and '#' symbols.

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!