It is currently Sat Aug 22, 2020 2:04 pm


All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: How many materials can a voxel have?
PostPosted: Thu Sep 22, 2011 10:24 pm 

Joined: Tue Mar 08, 2011 3:57 am
Posts: 46
Ah right and this is why I wanted to go so far with this topic before taking the dive and learning shaders - how can my shader reference an arbitrary number of textures? I understand texture atlases well enough, but what's a texture array? This all sounds very hacky. I would have thought we were beyond these kinds of limitations these days.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How many materials can a voxel have?
PostPosted: Thu Sep 22, 2011 10:44 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, so it sounds like you have managed to convert the position and normals into a mesh that LeadWorks can understand. How does it appears? I assume it is just plain white or something? The point is that attaching a shader before drawing allows you to control how that mesh actually appears.

You should probably skip multiple materials for now and focus on being able to apply a single texture to the object. Because PolyVox does not provide UV coordinates you will probably just want to project the texture along a single axis (down, if you are working on terrain). Then you can move on to using a single texture but with triplanar texturing. Aftert that you can move on to multiple materials.

Maybe you can also start off learning shaders/materials without PolyVox as LeadWerks probably provides builds in meshes or basic shapes? You can apply triplanar textuing to any object - just ignore the provided UV coordinates and use triplanar texturing instead.

But yeah, when you start working with shaders there is a lot to learn. The Cg Tutorial (free online) has some good material.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How many materials can a voxel have?
PostPosted: Thu Sep 22, 2011 11:17 pm 

Joined: Tue Mar 08, 2011 3:57 am
Posts: 46
Leadwerks comes with quite a few shaders already, and I'm fairly sure I could cut several together to suit my needs. I know it already has the ability to do triplanar terrain blending as its a feature. It is however going to need to be modified to work with PolyVox I think.
I suppose my immediate concern is that I don't want to walk this path if it doesn't meet my requirements. If it doesn't, maybe I should look at dropping in prefab models for walls/floors/etc instead of generating a big mesh?
That's the question I really feel like I need to answer first because as I continue to find out, learning shaders is a bit of a rabbit hole.

So I'd love to hear from you guys about what you think is achievable, and which way I should go.

P.S. Thanks a lot for being patient with me. :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How many materials can a voxel have?
PostPosted: Fri Sep 23, 2011 7:07 am 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
prefab models can't be modified on the fly ;)

If you have 10 textures of size 1024x1024, you can create a texture array where you're able to choose your texture simply by having a 3rd index variable. It'll only work in opengl and dx11 though :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How many materials can a voxel have?
PostPosted: Fri Sep 23, 2011 8:55 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
DJDD wrote:
I suppose my immediate concern is that I don't want to walk this path if it doesn't meet my requirements.


I must say, having looked at images of Dungeon Keeper I wasn't quite sure why you wanted to use PolyVox. These are the situations in which I see PolyVox being useful:

1) If you want advanced terrain with caves/overhangs and full destruction. You said you were using the normal surface extractor (not the cubic one) which implies this is what you are aiming for... but I doesn't really see any terrain in the Dungeon Keeper screenshots.

2) You want want a world built out of blocks, something like Minecraft. Looking at this image I can imagine you could do something similar with PolyVox:

Image

However, you could also model that more easily in a program such as 3DS Max or Blender. If those walls were built of cubes then PolyVox could give you the flexibility to have them modified during the game but is that something you need? You would also find it hard to do the slightly curved edges with PolyVox.

3) PolyVox could be useful if you had a world like the screenshot above and wanted to generate it procedurally. But equally you could build a set of tiles in 3DS Max and join them together in differnt patterns in code.

Being Open Source software I don't have to sell you anything, so I can be honest and say that you shouldn't used PolyVox unless you need it. But with more information about what you are trying to achieve in graphics/gameplay we can give more help.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How many materials can a voxel have?
PostPosted: Fri Sep 23, 2011 11:13 pm 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
my 2cents on this is if one of your goals is to do something *new* I think polyvox could work for you. For me if I were doing an isometric game with PolyVox I would make the cubes much smaller relative to the scales seen in Minecraft (1m per cube unit) so I can pack much more details on screen at once (also paging in 3D like dungeon siege). The thing that polyvox can do for you is make your entire world dynamic, so I would base one of the major tenant of my design around modification and mutability. That's why if you don't really care about everything being dynamic perhaps it would be easier to work with something entirely, like prefab meshes (or something).

As for curves I think you could do it with PolyVox but then you have to write a custom extractor that does this. Or you could do it with geometry shaders. In fact, notched toyed with this awhile back in Minecraft, where he randomly offset vertices to create a warped look. You also could do something with tessellation, even.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How many materials can a voxel have?
PostPosted: Sat Sep 24, 2011 10:34 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
beyzend wrote:
In fact, notched toyed with this awhile back in Minecraft, where he randomly offset vertices to create a warped look. You also could do something with tessellation, even.

Interesting... I saw something like this in a MineCraft-style racing game (skip about 1 minute in):

http://www.youtube.com/watch?v=h6MR5O2VblE

You can see the cubes aren't perfectly cubic, and this is easily done with some displacement in the vertex shader. I hadn't thought about tesselation but it could look cool. You could have a smooth per-pixel displacement based on Perlin noise or something to give your world a smooth curvy kind of look.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 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