It is currently Sat Aug 22, 2020 3:52 pm


All times are UTC




Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Sun Feb 22, 2009 2:22 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Have you still got the line:

Code:
computeNormalsForVertices(&g_volData, *ispCurrent, SOBEL);


Do you still see the same image if you change between SIMPLE, CENTRAL_DIFFERENCE, and SOBEL? For me it did make a difference, but I am testing within the Thermite 3D engine not the PolyVox OpenGL example.

As you may remember, I don't have any lighting in my OpenGL example. I think it would be best if you send me your modified version of the example which does include lighting (I guess it's still one .cpp file?). Then I'll see if I can fix it.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Sun Feb 22, 2009 2:38 pm 

Joined: Sun Feb 01, 2009 3:18 pm
Posts: 34
Quote:
computeNormalsForVertices(&g_volData, *ispCurrent, SOBEL);


Yes I had this code.

Quote:
Do you still see the same image if you change between SIMPLE, CENTRAL_DIFFERENCE, and SOBEL?

I could not see any difference.

Quote:
I think it would be best if you send me your modified version of the example


I have sent you the files.. from my gmail.. please check in case if it turns to be spam.
In the code I also had the code for modifying the voxels , after running it , just press 'd'... you will see the changes.

Thanking you for paying attention to the problem..

/Gajananan


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Sun Feb 22, 2009 5:40 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, I got your code. Actually there was some stuff missing (CVector3 and GLUI) but I just commented that out for the time being. I also went back to using createSphereInVolume() rather than LoadVerticesFromRawFile(), and removed some of the lights to make it easier to see what was going on.

I've emailed you the result, and when I run it I get the following image:Image

As you can see, things are much smoother (though not perfect...).

Try my new code. If you do not see the same image as me, then we have to try and debug. In this case, set a breakpoint or some kind of print statement to make sure that Line 32 of GradientEstimators.cpp is being executed.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Sun Feb 22, 2009 6:31 pm 

Joined: Sun Feb 01, 2009 3:18 pm
Posts: 34
Thanks for your prompt reply.

Quote:
Actually there was some stuff missing (CVector3 and GLUI) but I just commented that out for the time being.

Sorry , I forgot to remove that code.


When I run it I get the following image:
Attachment:
spehre-feb23.JPG
spehre-feb23.JPG [ 41.51 KiB | Viewed 3057 times ]


Quote:
As you can see, things are much smoother (though not perfect...).

Yes I can see it in the image rendered in your version.

Quote:
Try my new code. If you do not see the same image as me, then we have to try and debug. In this case, set a breakpoint or some kind of print statement to make sure that Line 32 of GradientEstimators.cpp is being executed.

Yes . I try to put a break point at "computeNormalsForVertices" but I was never able to step into ... it always step over..

Then I put a print statement to make sure that Line 32 of GradientEstimators.cpp.. but print statement did not print...quite strange!

Note that I just use the same code you sent me in the mail after removing my old main.cpp code.


I will further look into it! not sure what went wrong in my case.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Sun Feb 22, 2009 7:06 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Try putting the following line before the call to 'computeNormalsForVertices()'

Code:
ispCurrent->m_v3dRegionPosition = regLowerCorner;


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Mon Feb 23, 2009 12:47 am 

Joined: Sun Feb 01, 2009 3:18 pm
Posts: 34
Oh Great... Finally got the image as like yours.. thanking you very much for your great support.. I will work on real time modification of data as well.
Before trying to integrate polyvox into my code... just want to make sure what I should do.

- include header in PolyVoxCore
- include header in PolyVoxUtil
- refer PolyVoxCore.lib
- refer PolyVoxUtil.lib
- put PolyVoxCore.dll in dubug or release folder of my application
- put PolyVoxUtil.dll in dubug or release folder of my application

Is that enough?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Mon Feb 23, 2009 2:32 pm 

Joined: Sun Feb 01, 2009 3:18 pm
Posts: 34
I was able to refer polyvox in my application as I wrote before.. though extractReferenceSurface does not create 'vecVertices'.. means that this function is called ..seems not executed.. Do you think anything special setup with PolyVox to be used in other application?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Mon Feb 23, 2009 11:54 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Gajananan wrote:
Oh Great... Finally got the image as like yours.. thanking you very much for your great support.. I will work on real time modification of data as well.


Well that's strange, because the second fix was nearly the the same as the first one. Compare the first fix:

Code:
singleMaterialPatch->m_v3dRegionPosition = region.getLowerCorner();


To the second:

Code:
ispCurrent->m_v3dRegionPosition = regLowerCorner;


They are logically the same The first fix was placed right at the end of the extractReferenceSurface() function, and the second was placed immediatly after it. The only real difference is that the first fix went into the PolyVox library, whereas the second one went into your application code. Maybe you did not rebuild PolyVox properly, or copy the .dlls, after you applied the first fix?

And yes, as far as I can recall you just include the headers, link against the .lib, and then place the .dlls in the output directory (if that is not done automatically). If that doesn't work, try inserting some print statements or breakpoints?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Tue Feb 24, 2009 3:52 am 

Joined: Sun Feb 01, 2009 3:18 pm
Posts: 34
Quote:
Maybe you did not rebuild PolyVox properly, or copy the .dlls, after you applied the first fix?

I did compile the code and tested it with out the following code I don't get the result as yours
ispCurrent->m_v3dRegionPosition = regLowerCorner;

Quote:
And yes, as far as I can recall you just include the headers, link against the .lib, and then place the .dlls in the output directory (if that is not done automatically). If that doesn't work, try inserting some print statements or breakpoints?

Thank you for your advice. I just fixed the problem, rendering works fine.

Though I have an issue in data size. For 128 ^ 3 data size, I could not get the full object model. What I do now, i have 668-668-469 size data, then cropped it to be 128 ^ 3, this lead to whole in the surface. I am trying to load 256 ^ 3, it leads to memory problem. I have to tackle this problem as Polyvox limit the size to be power of 2.

Once I solved it I could think about how I can modify the voxel so that surface can be changed.
I still want to improve the smoothness. Because I am not sure how it would behave once I modify the data in real time.
Do you think it is possible to use geometric shaders on top of polyvox?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: 3D surface reconstruction for volumetric voxel data
PostPosted: Tue Feb 24, 2009 1:12 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Gajananan wrote:
Though I have an issue in data size. For 128 ^ 3 data size, I could not get the full object model. What I do now, i have 668-668-469 size data, then cropped it to be 128 ^ 3, this lead to whole in the surface. I am trying to load 256 ^ 3, it leads to memory problem. I have to tackle this problem as Polyvox limit the size to be power of 2.


It's true that PolyVox is pretty memory hungry but you should be able to do 256^3 without a problem. That is the size of the castle volume used in the Thermite demo. I assume that at this point the original 668x668x469 volume is no longer in memory? You only have the PolyVox volume and the resulting mesh in memory?

To be honest, the memory management aspect currently needs a lot of work. Fortuantly I intend to look at it soon (next few weeks) because I need to be able to load large dynamic terrains for the game I'm working on. There are two main areas for improvment:

1) The volume needs to be compressed in memory. It contains large continous regions which should compress down quite well.

2) The size of the meshes needs to be reduced. I think that each vertex is currently about 30 bytes which is too big when there are millions of them.

I will look at both of these as I get time...

Gajananan wrote:
I still want to improve the smoothness. Because I am not sure how it would behave once I modify the data in real time.
Do you think it is possible to use geometric shaders on top of polyvox?


Yes, I believe you can use gemetry shaders. All PolyVox does is give you the mesh data, how you render it is up to you. I have no experience here though, so your on your own! Hopefully there are some tutorials around on using geometry shaders with OpenGL.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net