Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Questions regarding CubicSurfaceExtractor
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=75
Page 1 of 1

Author:  beyzend [ Thu Sep 23, 2010 2:38 am ]
Post subject:  Questions regarding CubicSurfaceExtractor

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.

Author:  beyzend [ Thu Sep 23, 2010 3:37 am ]
Post subject:  Re: Questions regarding CubicSurfaceExtractor

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.

Author:  David Williams [ Thu Sep 23, 2010 7:06 am ]
Post subject:  Re: Questions regarding CubicSurfaceExtractor

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.

Author:  beyzend [ Thu Sep 23, 2010 7:20 am ]
Post subject:  Re: Questions regarding CubicSurfaceExtractor

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.

Author:  beyzend [ Fri Sep 24, 2010 4:14 am ]
Post subject:  Re: Questions regarding CubicSurfaceExtractor

Cubic surface is working for me now. Thanks.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/