GPWiki.org
GPWiki.org
It is currently Thu Jun 20, 2013 6:04 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Feb 14, 2012 7:21 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
Well as a few of you know i have been workingon a plante renderer, i finally got the cracks fixed and also moanaged to get it up to 60fps on a decent gfx card and 120fps on a highend card. Still havent fixed the normals but i got an idea on texturing my terrain to look more realistic but i need some input on wether or not this would work. Well i have 2 ideas.

1. I create my planet height map, which is a single heightmap i wrap around the planet and then interpolate as i create quadtree patches. I was thinking of using a lookup table to create some sort of terrain mask, (basically a heightmap but coloured) then do the same but instead of interpolating height i interpolate colours. So r = sand g = grass b = rock a = snow. I then i add a colour to the vertex declaration , i calculate the terrain weights from the vertex colour, then i use the vertex normal to calculate slope which will then allow me to use a texture atlas. 16 textures, in one texture.

2. basically do the same thing but create a mask for each patch on the gpu but use texture lookup to lookup the values.

any input on this subject will be much apreciated.


Top
 Profile  
 
PostPosted: Tue Feb 14, 2012 7:47 pm 
Funky Monkey

Joined: Thu Sep 09, 2004 1:17 pm
Posts: 1567
Location: burrowed
Yes that sounds like a good idea.

It probably doens't matter if you use a texture or vertex colors, although depending on the size of your planet and the size of your lookup texture you could have trouble with precision when creating little spots of certain terrain.

So with a texture look up you can dynamically change and adjust biomes or terrain areas, where as color attributes per vertex are *baked in* and not easily changeable, except you use a dynamic or streamed VBO to replace.

Calculating slopes from vertex normals can be useful to create authentic placement of gras, sand and snow, so do use that :D

Someone pasted this on irc a few days ago. You might find it interesting
http://www.infinity-universe.com/Infini ... &Itemid=47

_________________
Long pork is people!

wzl's burrow


Top
 Profile  
 
PostPosted: Tue Feb 14, 2012 8:16 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
wow thanx for a quick reply i have actually looked in to this but i cant for the life of me figure out how to create the lookup table so i thought i will try and do it my own way, i did actually get something of the sorts working but it didnt look great so i stopped using it. if you look at my blog budinga.blogspot.com, first picture if my feeble attempt to use slope lol. I wanted to try and keep memory usage to a min, i dont really wanna create a texture per patch, as my planet goes down to the 1m level and i think this wont be a good idea or maybe it will :). I just amnahed to create a simpel lookup colormap with earth colous, but the idea is i have seen some amazing stuff done with masks, but usually with static terrain, my planets are entirely procedural. well i hope they are :). Oh my days i just come home from work and now my head hurts lol.

sofar i got this i know this is more of a colourmap then a mask but i got the right idea its created using the generated heightmap and a 1d colour ramp.

Image

and now with the mask colour ramp something simililar im thinking about

Image

am i on the right track . i mean at the moment i only use the red channel as the height values are basically the same, r,b,g. i have noise implemented in the shader so i can easily use some fbm or simplex noise to blend the different heights.


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 9:21 am 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
ok he right one i have been thinking about this the idea is sound but i think the idea from infinity engine is right , i just realised if i create a mask it will look ok but then i will still need to compute the slope , therefore if i leave it the way it already is i already have a vertex declaration that includes the height of the vertex and i already know how to claculate the slope so if i just figure out how to create the lookup table i can use the idea proposed by Yann.

Any ideas on how to do the lookup table would be great.


Top
 Profile  
 
PostPosted: Sat Feb 18, 2012 5:00 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
Any ideas on what is the bigest object xna can display , beacuse i need to make my planet bigger and if i use radius 5000000 it works fine but when i try to set it to 50000000, i just get nothing, its like xna cant handle the size of my object, any size up to 5000000 works fine. any ideas, would be great.


Top
 Profile  
 
PostPosted: Mon Feb 20, 2012 8:54 pm 
Harmlessness does no harm
User avatar

Joined: Tue Sep 14, 2004 8:37 pm
Posts: 3858
Location: Ferriday, LA, US
budinga wrote:
Any ideas on what is the bigest object xna can display , beacuse i need to make my planet bigger and if i use radius 5000000 it works fine but when i try to set it to 50000000, i just get nothing, its like xna cant handle the size of my object, any size up to 5000000 works fine. any ideas, would be great.

At first glance, I don't see anything in particular to make it not work (i.e. 50 million is a value that is able to fit within a 32-bit integer variable and all). So, it may be some setting you may have neglected to adjust -- for example, when you set up the view space. Your "far" parameter may be set to a value insufficient to render the entire planet (parts would be rendered, but only with the camera in a certain position relative to the planet). Or, it could be something as simple as forgetting to set the camera position to a coordinate appropriate for viewing the new size of the planet.

Barring those issues, it gets a bit fuzzier. It could be a limitation inherent with XNA itself (due either to a bug, or a deliberate design limitation). In that case, it would probably be easiest to do a bit of Googling to find out for certain... I would start out by searching for details about XNA's limitations on the "far" plane when setting up the view space.

_________________
What most people don't understand about "enlightenment" is that it is not an end-goal; but where you find yourself just before taking a new "first step."


Top
 Profile  
 
PostPosted: Tue Feb 21, 2012 7:30 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
I am so confused well the view far distance is bigger then 50000000 so i probably will ave to look in to it, i also get wired issues with my camera when i go that high the rotation jumps, instead of rotating smoothly , i was thinking of using a quaternion camera instead of matrix maybe this mite fix it, thanxi will look in to that.


Top
 Profile  
 
PostPosted: Sun Oct 21, 2012 9:54 am 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
budinga wrote:
I am so confused well the view far distance is bigger then 50000000 so i probably will ave to look in to it, i also get wired issues with my camera when i go that high the rotation jumps, instead of rotating smoothly , i was thinking of using a quaternion camera instead of matrix maybe this mite fix it, thanxi will look in to that.


I actually solved this using a quartonion camera instead of a matrix one. Just though i would let ya know just in case anybody else had the same problem


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group