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
Budinga's Programming Blog
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 :).
Subscribe to:
Posts (Atom)