It is currently Sat Aug 22, 2020 12:25 pm


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Questions regarding CubicSurfaceExtractor
PostPosted: Thu Sep 23, 2010 2:38 am 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
Hi,

I'm having some problems with the CubicSurfaceExtractor. I filled a volume similar to what OpenGLExample did, except where I altered the radius of the spheres and also my volume is 256**3. Right now, SurfaceExtractor works fine, it extracts the surface as expected. The CubicSurfaceExtractor is not extracting a surface as expected, instead of the spheres and cubes as in the example, I get a single cube instead.

Here are some pics:

Cubic:

[IMG width="640" height="480"]http://imgur.com/nz8KM.png[/IMG]

marching cube:

[IMG width="640" height="480"]http://imgur.com/eVsHH.jpg[/IMG]


Other questions:

(Sorry I deleted something from the previous edit. I was assuming that you decimate some of the surfaces but looking at the surfaces in wireframe mode that is not true. There must be something wrong with my shader.)

Any suggestions on how to texture map using texture atlas? I'm trying to do something similar to Minecraft. But I'm also look to improve upon Minecraft. Right now I'm using the MaterialID as the key into the texture atlas.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Questions regarding CubicSurfaceExtractor
PostPosted: Thu Sep 23, 2010 3:37 am 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
I think I can't do what I was thinking of doing with the texture atlas thing. I don't know enough about the triangles generate. I was assuming they would be given to me as a bunch of quads.

I have to think about this some more.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Questions regarding CubicSurfaceExtractor
PostPosted: Thu Sep 23, 2010 7:06 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Hi, the CubicSurfaceExtractor is very new and actually I had some uncommitted changes. I have committed them now so maybe that helps. If you have the OpenGLExample working then you should be able to literally replace 'SurfaceExtractor' with 'CubicSurfaceExtractor' and it should work. Let me know if you still have problems and I'll look at it some more.

You should be able to use texture atlases with the generated mesh. Interpolate your world space positions so that you can access them in the fragment shader, and then you can compute your texture coordinates from this worldspace position. PolyVox also stores the material ID in each vertex so you can use this to access the texture atlas.

I think the trickier aspect is to decide which texture you want applied to which face. PolyVox does not mark faces as top, side, etc. You should be able to use the surface normal and triplanar texturing to achieve what you want. I can send some sample shader code later if you need it.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Questions regarding CubicSurfaceExtractor
PostPosted: Thu Sep 23, 2010 7:20 am 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
Yes thanks for the quick reply. I will check out your changes.

As for the texturing problem I was having earlier, I made some mistakes in my texture coordinate code, very silly and always happens lol. Yeah I was going to try Triplanar texturing because I just realized it would work for texture atlas also. And for the faces yes I was thinking about accessing the texture atlas based on normal of the faces. This is something I will have to try. The more I play around with PolyVox the more I want to use the surface extractor instead of the cubic one. I like smooth surfaces :). If I can make it work with the game play then that's the route I plan to take.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Questions regarding CubicSurfaceExtractor
PostPosted: Fri Sep 24, 2010 4:14 am 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
Cubic surface is working for me now. Thanks.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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