Hi all,
First off Happy new year all.
yes I am still around and working on my planet but today were gonna go a bit off topic. I have entered the lynx space competition and I need to get as many votes as possible so can you all please vote for me just click the below link and enter your email.
https://www.lynxapollo.com/en_GB/141992/stavros-demetriou?image=0
My blog on the various projects that i am working on at the moment with different stages in dsesign, and how i acheve them.
Searc
Sunday, 27 January 2013
Friday, 6 April 2012
A Few Updates
Well ive been working on a few updates, had a crappy few months due the death of my grandfather. But well im back now. I have updated the camera class to use Quaternion, and i have also fixed some hdr lighting issues and made the atmopshere look more realistic. I am currently working on a ocean shader, but thats a bit a fail upwards senario. Anyways heres some images of what i have been working on lately. Its a littlebit over exposed in some places but it looks nice :).
Sunday, 12 February 2012
More of an update
Well again i thought that this deserves an update, still havent fixed that normal problem , but here it is. I managed to implement a almost identical set of function like libnoise, using libnoise.net as a ref you can find it over at http://libnoisedotnet.codeplex.com/. It works great beacuse i can use it to generate a planet heightmap which warps perfectly around my planet sphere, and look's a hell of a lot better then a few ocatves of fbm. Here are some screenshots of my current progress and also a work in progress shot of me failing to implement slope based terrain texturing (cant win the all in 1 day :) ).
Slope based terrain texturing
Slope based terrain texturing
And here they are my latest procedural heightmap functions at work, using a bunch of random seed's.
Saturday, 11 February 2012
Oh My Days ive finally got it!!
Well this is more of a progress update then a post, i have finally managed to get the cracks fixed perfectly, still need to fix the normal generation but im getting there. Also i have improved the fps alot i get an avarage of 80fps and even 120fps at some points. I realised that i was not generating the patch indexes properly, which was causing them to point to a completely wrong vertex. Ill give ya a few screenshots but nothing major to see just you wont notice any cracks any more. If anybodys got a any good ideas on hiding the lod transition, with the normal calculation let me know at the moment im looking on generating normal maps on a per patch basis.
Tuesday, 31 January 2012
Just a little eye canddy
I decided to post a screeny i am working on some new noise functions, so far i generate a heightmap texture using a mixture of fbm, and simplex noise. I will soon be working on noise features, craters volcanoes, etc, just thought it looked cool sorry guyz no technical stuff today. I set the R texture channel to blue beacuse it think it looks cool, with my fake water :).
Monday, 23 January 2012
Creating Normal Maps on the cpu
I have come across this nice bit of code on gamedev.net forums. Which i think will come in handy for a loads of people as i cant seem to find alot of examples of generating normal maps from heightmaps.
At the moment Indevilage Engine (yes my engine is called Indevilage) uses normals generated on a per patch basis but eventually i want to use high res normal maps generated on the gpu. Heres the function and an example of what it does.
I know this is a bit of a side step from my normal posts but i haven really posted anything usefull i thin its time i started.
1: public static Texture2D NormalMapFromHeightMap(GraphicsDevice Device,Texture2D heightmap)
2: {
3: int size = heightmap.Width;
4: Color[] colorArray = new Color[size * size];
5: heightmap.GetData<Color>(colorArray);
6: Color[] normalArray = new Color[size * size];
7: Vector3 xyzdist = new Vector3(0.01f, 0.01f, 0.01f);//new Vector3(1.0f, 1.0f, 1.0f);
8: for (int i = 0; i < size - 1; i++)
9: {
10: for (int j = 0; j < size - 1; j++)
11: {
12: float sample1 = (colorArray[i + (j + 1) * size].R + colorArray[i + (j + 1) * size].G + colorArray[i + (j + 1) * size].B);
13: float sample2 = (colorArray[i + j * size].R + colorArray[i + j * size].G + colorArray[i + j * size].B);
14: float sample3 = (colorArray[(i + 1) + j * size].R + colorArray[(i + 1) + j * size].G + colorArray[(i + 1) + j * size].B);
15: Vector3 surfacesample0 = new Vector3(i * xyzdist.X, j * xyzdist.Y, sample1 * xyzdist.Z);
16: Vector3 surfacesample1 = new Vector3(i * xyzdist.X, (j + 1) * xyzdist.Y, sample2 * xyzdist.Z);
17: Vector3 surfacesample2 = new Vector3((i + 1) * xyzdist.X, j * xyzdist.Y, sample3 * xyzdist.Z);
18: Vector3 surfacevec0 = surfacesample1 - surfacesample0;
19: Vector3 surfacevec1 = surfacesample2 - surfacesample0;
20: surfacevec0.Normalize();
21: surfacevec1.Normalize();
22: Vector3 surfacenormal = new Vector3();
23: Vector3.Cross(ref surfacevec0, ref surfacevec1, out surfacenormal);
24: surfacenormal.Normalize();
25: surfacenormal.Z = -surfacenormal.Z;
26: surfacenormal.X = (surfacenormal.X + 1.0f) / 2.0f;
27: surfacenormal.Y = (surfacenormal.Y + 1.0f) / 2.0f;
28: surfacenormal.Z = (surfacenormal.Z + 1.0f) / 2.0f;
29: normalArray[i + j * size] = new Color(surfacenormal);
30: }
31: }
32: Texture2D texture = new Texture2D(Device, size, size);
33: texture.SetData(normalArray);
34: return texture;
35: }
Heightmap
I havent actually had time to test this in my engine, but it seems to generate the right values, i hope this is of help to anybody.
Sunday, 22 January 2012
Using a logarithmic z buffer
Well i have decided to enable the crack fixing still not perfect but it works, the only problem is with such a large object you get shimering due to zbuffer fighting, the way this is solved by most people is to use a logarithmic z buffer, the way to do this is to calculate the depth in the shader. It was actually very simple to do, just add a few lines of code and there we have it.
I show how this works in the following screenshots.
without the logarithmic z buffer
with logarithmic z buffer
It has now brought to my attention a few other things i can see but for now this will do :).
1: const float Cc = 1.0;
2: const float Far = 1000000000.0;
3: output.Position.z = log(Cc*output.Position.z + 1) / log(Cc*Far + 1) * output.Position.w;
I show how this works in the following screenshots.
without the logarithmic z buffer
with logarithmic z buffer
It has now brought to my attention a few other things i can see but for now this will do :).
Monday, 2 January 2012
BoundingBox's A pain in the but
I have spent a long time trying to ificiantly calculate bounding boxes for my terrain patches, i have resorted to bruteforce once the patch is created, the code is just a modifyed version of the standard xna method for calculting mesh bounding boxes. Here is a little update pic and the code used. I dont think this really needs an explanation, it just checks all vertices and then calculates the max and min bounds.
public BoundingBox CalculateBoundingBox() { Vector3 Max = new Vector3(float.MinValue, float.MinValue, float.MinValue); Vector3 Min = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); for (int i = 0; i < VertexData.Length; i ++) { Vector3 vectCurrentVertex = VertexData[i].Position; if (VertexData[i].Position.X < Min.X) Min.X = VertexData[i].Position.X; if (VertexData[i].Position.X > Max.X) Max.X = VertexData[i].Position.X; if (VertexData[i].Position.Y < Min.Y) Min.Y = VertexData[i].Position.Y;if (VertexData[i].Position.Y > Max.Y) Max.Y = VertexData[i].Position.Y; if (VertexData[i].Position.Z < Min.Z) Min.Z = VertexData[i].Position.Z; if (VertexData[i].Position.Z > Max.Z) Max.Z = VertexData[i].Position.Z; } return new BoundingBox(Min, Max); }
Tuesday, 27 December 2011
Merry Christmas Evereybody
Well its been a while ive been working hard on porting my engine to XNA4.0 and c#, also have rewritten the planet engine and finally got the atsmopheric scattering working properly , its looking ok, well got a few things i got to work out still. Terrain crack fixing and culling is not working properly yet and also maybe a little water will be nice. But what the heck its christmas, and i just wanted to offer my followers a little eye canddy. Here we go. My new engine now goes down to the ground level, on a planet the size of earth. Water at the moment is just the colour blue, really need to fix this. Well here is it enjoy.
A little edit i thought was necesary. and i have just realised i cant spell, can you see it in these pictures lol.
Saturday, 6 August 2011
Little more progress
i have been working hard on this for a while now and i think i am getting someware i am although getting a bit stcuk with normal generation for dif lod levels, but im sure i will figure it out soon enough.
for now a few more screenys.
for now a few more screenys.
Saturday, 9 July 2011
Just some updated screenshots
Just wanted to post some new screenshots, starting look like a real planet.
I added some clouds,water and a nice lense effect. Gotta work on the terrain now to lower the draw calls and up the fps, but not a bad job i think so far, i am quite happy with the results.
Anybody want some info on the techniques used just mail me and ill get back to you as soon as possible.
I added some clouds,water and a nice lense effect. Gotta work on the terrain now to lower the draw calls and up the fps, but not a bad job i think so far, i am quite happy with the results.Friday, 8 July 2011
Finally worked the basics out
Well i been grafting hard on the planet and settled someware in the middle, its a gemipmap implementation, which is going to evolve in to a chunked lod, but that is later on got the atmospheric scattering working properly. I will post some implementation info soon, just need the time to do so but for now got some eye candy.
Its a lovely sunrise from the mountains, normals are not yet generated so shadows are not great but its getting there.
Saturday, 25 June 2011
Got the atmospheric scattering working
Well finally managed to get the atmospheric scattering shader, geometry and the shader working properly and its looking pretty nice if i do say so myself. Now i gotta start to add some nicer effect. This may ateka while as this is not on my initial TODO list, as i have to fix the planet LOD first.
Saturday, 18 June 2011
Update on what i have been working on
Ok well i have now decided i am going to stick with 6 square clipmaps and morph them in to a sphere, as spherical clipmaps is way beyind my math skills, and also alot more work maybe i will come back to it later on, so far i have managed to get the cube somewhat working and some multitexturing, but still alot of work needed. Its actually quite simple to get the planet its just making it look realistic is the hard part. I have also improved the atmospheric scattering shader a bit, but i cant seem to get the sphere to cull properly im currently working on that , and syncing the clipmap centers too. I have also vastly improved the framerate , by adding some adition optimization to the mesh code.
Sunday, 27 March 2011
Been working Hard
I have been working hard on a new implementation using the paper writen by Malte Clasen and Hand-Christian Hege. Its going well so far, but loadz to go to be ohnest i just got the basic geometry working for now and i am working on the camera stuff then, i will be working on the heightmapping which i am currently dreding as its more dificult then actually creating the mesh lol. Anyways heres some screenshots of my current build.
This implmentation used clipmaps, as in hopes implementation, but using spherical rings instead of rectangles. The textureing system is similar to clipmaps, but needs to be converted over to spherical coords. I am aiming to do almost everything entirely on the GPU, as i think this is the way to go, and as you can see from the framerate so far its the best way to go.
Subscribe to:
Posts (Atom)
















































