Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1] 2
  Print  
Author Topic: Progressive meshes (TOOL RELEASE)  (Read 5898 times)
AGT
Customers
Community Member
*****
Posts: 474


WWW
« on: November 14, 2007, 01:09:43 PM »

Hello everyone,
I was wondering if TV3D is ever going to have DirectX's 9 Progressive Meshes support, not only for Landscapes, but for TVMs too. I think  this is quite important since anyone who wishes to make "heavy" scenes, like umm, everyone needs to have some LOD in it.

As far as DirectX is concerned, the methods are there, they work and there's a sample with source. The only problem is that I'd like to have that in TVM.

Since DirectX has already support for this kind of thing, and the implementation of it shouldn't be too hard, then why not support it in TV3D6.5?

Is it a license issue?


Edit
Download the tool and Hypnotron's DLL here:

http://www.wikifortio.com/422412/jviper-ProgressiveLOD_Tool.zip.zip

A comparison :

Original mesh


Reduced polygons by 90%

Source code for both of them is included.
« Last Edit: December 05, 2007, 09:05:30 AM by AGT » Logged

Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #1 on: November 14, 2007, 02:09:57 PM »

i think its a performance issue... dynamic progressive detail for meshes and actors suck, but its good for terrain because tv's terrain plods are precomputed.

you're better off using conventional LOD switching bettween higher/lower resolution models for actors and meshes.

Logged
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #2 on: November 14, 2007, 02:25:33 PM »

You're making a good point here.
However progressive meshes could also be used for generating LODs during loading time. Then TV could store those levels and render them according to a switch distance value.
In other words this could reduce significantly the workflow needed for the art part of a game since artists don't have to make 2-3 versions of meshes, plus it could be an integrated in TV LOD system. In my opinion there's none who doesn't need such a thing.
Logged

Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #3 on: November 15, 2007, 10:32:16 AM »

i think jviper has created a tool that does just that using calls to Managed DX.  You might want to ask him.

I also heard that old versions of the DX SDK X file viewer (pre 2005?) could do this and export the results but I've been unable to find an old enough version of that program (before they switched to that new version that uses the DXUtil GUI stuff)
Logged
Lenn
Customers
Community Member
*****
Posts: 876

+/-


« Reply #4 on: November 15, 2007, 11:06:13 AM »

I was looking into peripherals of model (TVM) LOD and also found indications that it may be possible using managed DX. It doesn't look impossible at all, but it's on my list of looking into in the next 2 months. And yes, i agree, it would be useful to have this feature built into TV3D because making a few different models with lower LOD than the highest detailed one can be time consuming.
Logged

TV3D 6.5 Community Docs - Read, use and please contribute!
Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #5 on: November 15, 2007, 02:19:53 PM »

Yes, it'd be nice if in Model View you could set these up and save the various LODs within the TVA or TVM as indices into a shared vertex buffer.  That would make using precomputed LOD's faster and lighter than using seperate meshes and actors.

Logged
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #6 on: November 15, 2007, 03:40:23 PM »

Yes that would be most useful. I wish we had this kind of functionality.
Logged

jviper
Community Member
*
Posts: 2126

Discipline in training


« Reply #7 on: November 15, 2007, 06:39:14 PM »

I'll need somebody to host the code again because everywhere that I have posted has went down (TVProjects was one of the good ones). I had implemented LOD within FigureEditor, but all the links to it are dead. I also think I posted some LOD source as a seperate project on TVProjects (I know, still doesn't help because TVProjects is gone).

Now, I belive the key to implementing LOD is if your able to create the progressive mesh through native DX, then somehow passing it through TV3D so TV3D can handle the rendering and everything else TV3D does with Meshes. I have a hunch that it should be possible, but I say that only because you can access the native DX from TV3D. The question is, weither it works the other way around.

EDIT: I've just attached the ProgressiveMesh code. 2 KB. So that file made it. Now as for FigureEditor, that my be too big to attach here.
« Last Edit: November 15, 2007, 07:09:54 PM by jviper » Logged

JAbstract.....Don't just imagine, make it happen!
Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #8 on: November 15, 2007, 07:44:19 PM »

Thanks for sharing jviper.  To continue the spirit of giving, I've translated your code to c# and made it a self contained DLL.  Src included naturally.

Usage is pretty simple:

Code:
MeshTool tool = new MeshTool(mytvScene, mytvMaterialFactory, mytvTextureFactory);
TVMesh lodResult = tool.CreateLOD(@"c:\artwork\dominus_art_public_domain\actors\scale_Renzok_static.x", true, true, .20f, "testlod");
lodResult.SaveTVM("c:\temp\lod.tvm");

then you can load it in modelview or just start rendering the returned lod in your app.

http://www.makosoft.com/stuff/jviperlodcsharp.rar
now if only there was code to do this for actors?
Logged
Lenn
Customers
Community Member
*****
Posts: 876

+/-


« Reply #9 on: November 16, 2007, 09:28:36 AM »

I'll need somebody to host the code again because everywhere that I have posted has went down (TVProjects was one of the good ones). I had implemented LOD within FigureEditor, but all the links to it are dead. I also think I posted some LOD source as a seperate project on TVProjects (I know, still doesn't help because TVProjects is gone).

Now, I belive the key to implementing LOD is if your able to create the progressive mesh through native DX, then somehow passing it through TV3D so TV3D can handle the rendering and everything else TV3D does with Meshes. I have a hunch that it should be possible, but I say that only because you can access the native DX from TV3D. The question is, weither it works the other way around.

EDIT: I've just attached the ProgressiveMesh code. 2 KB. So that file made it. Now as for FigureEditor, that my be too big to attach here.

Pure awesomeness! Smiley This community seems to solve so many problems for me, right on time. Really great. Now let's test and implement this...
Logged

TV3D 6.5 Community Docs - Read, use and please contribute!
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #10 on: November 16, 2007, 10:23:24 AM »

This is great! Smiley
Thank you for sharing.
Now maybe we could create a community tool for LOD. I'm making a basic Interface for it right now, and I'll release it with the source when it's finished.
Here's a screenshot:


I get an error though, so if you can help.
I get an "IndexOutOfRangeExeption was unhandled" error in this line:
Ind((TmpN * 3) + 1) = VrtReMap(CInt(IndAry.GetValue((i * 3) + 1)))

I get this error either when using jviper's class or Hypnotron's port.
Logged

Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #11 on: November 16, 2007, 02:55:48 PM »

yep, i got that error too on some models.  i'll try and debug it on sunday/monday since i have to work tonite and tomorrow nite.
Logged
Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #12 on: December 04, 2007, 05:08:26 AM »

check your email AGT.  I sent you the fixes to those errors.  Incidentally, some models refuse to be simplified such as the sphere model you included with your tool.  I'm not sure why this is except maybe the mesh format is not an indexed triangle list.

feel free to post the changes i sent you.

p.s. I think maybe you should expand your tool to allow people to see LOD switching in action as well as perhaps to load many many instances of the meshes to compare frame rate differences with LOD and without when using lots of meshes and allow them to find the right balance between performance and visual quality.  Currently with just a single mesh loaded you dont notice any change in frame rate.
Logged
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #13 on: December 05, 2007, 03:30:35 AM »

Great, thanks a ton Hypnotron Smiley

I uploaded both the tool and you dll with source.

Download :
http://www.wikifortio.com/422412/jviper-ProgressiveLOD_Tool.zip.zip

I've also included a link in my first post.

Cheers:)

Edit

I almost forgot. Press C key to make instances of the mesh.

Btw, I couldn't attach them in the thread Sad
« Last Edit: December 05, 2007, 04:50:06 AM by AGT » Logged

Hypnotron
Customers
Community Member
*****
Posts: 1043


« Reply #14 on: December 05, 2007, 05:05:46 AM »

cool.  creating multiple instances and lowering the lod now shows a clear performance advantage.
Logged
Lenn
Customers
Community Member
*****
Posts: 876

+/-


« Reply #15 on: December 05, 2007, 05:14:17 PM »

Thanks guys, it works great!  Cool
Logged

TV3D 6.5 Community Docs - Read, use and please contribute!
Shargot
Customers
Community Member
*****
Posts: 166


WWW
« Reply #16 on: February 01, 2008, 11:14:35 AM »

links dead... please reupload(
Logged

" width="130" height="45" border="0
RuntimeError101
Customers
Community Member
*****
Posts: 252


« Reply #17 on: February 01, 2008, 03:53:38 PM »

The attachment post is not dead, download it from there (if that is the file you wanted).  I do not have the csharp version, however.
Logged
AGT
Customers
Community Member
*****
Posts: 474


WWW
« Reply #18 on: February 02, 2008, 03:22:23 AM »

Here you go.
Link to the tool download :
http://agt.110mb.com/Files/jviper-ProgressiveLOD_Tool.zip

Link to Hypnotron 's C# port :
http://agt.110mb.com/Files/MeshUtils.zip
Logged

Shargot
Customers
Community Member
*****
Posts: 166


WWW
« Reply #19 on: February 02, 2008, 06:01:40 AM »

Thanx AGT )))
Logged

" width="130" height="45" border="0
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks