It is currently Sat Aug 22, 2020 4:15 am


All times are UTC




Post new topic Reply to topic  [ 14 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Two problems!
PostPosted: Sat Feb 19, 2011 8:05 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
Think I may have found something related to that edge bug, in your terrain editing demo you linked me in the introduction thread, when trying to add volumes at the end of the world (below it, at maximum height, at the sides, etc) it will turn areas black even if you are using an actual material (grass/rock, etc), why would that be? could it be related?

Btw, what is the size of that world? How is it smoothed? Just trying to gather tips for my own initial version of the editor. Also, I see you are having 3 textures but they are not blended. Are you using an atlas and choosing the proper texture by the index (material data)? Or are you just sampling 3 textures and choosing which one to display according to the index?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Two problems!
PostPosted: Sat Feb 19, 2011 11:06 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Shanee wrote:
...when trying to add volumes at the end of the world (below it, at maximum height, at the sides, etc) it will turn areas black even if you are using an actual material (grass/rock, etc), why would that be? could it be related?


I don't think they are going black, I think they are just not being drawn (and the background is black). This is because the algorithm does not know what is outside the volume. It's an old demo, and Volumes now have the concept of a border voxel (like clamp to border in DirectX) which solves this.

Shanee wrote:
Btw, what is the size of that world? How is it smoothed? Just trying to gather tips for my own initial version of the editor. Also, I see you are having 3 textures but they are not blended. Are you using an atlas and choosing the proper texture by the index (material data)? Or are you just sampling 3 textures and choosing which one to display according to the index?


I think it's 512x512x256. The easiest way to generate smooth terrain is to generate the volume in two passes. In the first pass you can set each voxel's density to either 0 or to the maximum value. In the second pass you can make each voxel's density the average of itself and it neighbours. This essentially blurs the density values.

Keeping smooth density values while editing is going to be a lot more tricky. You have to implement the equivelent of a soft-edge brush from a paint program, rather than a hard edged brush (does that make sense?). I have not done this so you will need to do some research and experimentation to find the best way.

In the demo I'm actually cheating, because it predates support for density values in PolyVox. It was a binary value (as though the density was always 0 or max) but then I used conventional mesh smoothing techniques to smooth the surface. However, if I was writing this demo now I would not do that - I would use the real density values as described previously.

For the texturing I don't remember - I think I just passed each texture in as a seperate texture unit. But texture atlases/arrays are a better option for a large number of textures. The material code is part of the terrain editor download, you can find it in 'share\thermite\apps\TechDemo\materials'


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Two problems!
PostPosted: Mon Feb 21, 2011 6:27 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
Didn't want to spam the introduction topic or start a new one for this so decided to add it here :)

Finished my Biology II exam today! went great yay :) Now I finally have some free time.

Will write a triplanar texturing with texture atlas and normal mapping and lighting. Would you like to add it to the wiki?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Two problems!
PostPosted: Mon Feb 21, 2011 9:10 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Congratulations!

And yes, if you do come up with such a shader a Wiki contribution would be welcome :-)

Appologies in advance for any slow replies this week, I'm not going to get much internet time...


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

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