Psirens converted to XNA 4.0

Psirens is converted to XNA 4.0, and it was about a half day to get it running.

It looks like crap (culling, shading and transparancy problems). This will take some time to fix….

psirens_xna40

Here is a collection of links to help with the XNA 3.1 to 4.0 conversion:

http://blogs.microsoft.co.il/blogs/grozen/archive/2010/10/23/converting-a-3d-xna-3-0-game-to-xna-4-0-an-example.aspx

http://www.hexworld.co.uk/blog/?p=111

http://blogs.msdn.com/b/shawnhar/archive/2010/04/05/spritebatch-and-custom-renderstates-in-xna-game-studio-4-0.aspx

http://blogs.msdn.com/b/shawnhar/archive/2010/04/19/vertex-data-in-xna-game-studio-4-0.aspx

The blog of shawn hargreaves explains a lot so check his entire site for info.

Archived: Uncategorised

Moonrocks threatening the earth…

Placed the procedural asteroids around the earth sphere. Added rotation, direction and speed. I was wondering if the procedural texturing would make the system bog down.

But it didn’t, so it won’t break a sweat on the Xbox 360 either I suppose. What takes a bit longer on the Xbox however is the creation of the rocks.

But that is probably because of the poor floating point performance of the Xbox.

I guess the Moon is finished…..

Archived: Uncategorised

Rocky asteroids part III

Expanded the rock shader with some ambient lighting. This makes the asteroid look less flat and show some more of the structure.

This is medium complex asteroid that still looks a bit dark, but looks detailed from a distance.

This is the highest complex rock. It looks like coal. It is probably a good idea to add some white parts that looks like ICE.

Archived: Uncategorised

Rocky asteroids part II

Developed a procedure to generate Perlin noise in a 3D Texture.

I got the idea to texture the asteroids this way from the Orange Book (OpenGL Shading Language, 2nd Edition (2006)), but I needed to convert the GLSL shader code to HLSL.

I am not a crack at that stuff so that was a bit hard to develop.

The benefit of this procedure instead of Projective texturing is that it always looks crisp and non distorted at any angle or distance.

It does’nt look lowpoly but in fact it is (light enable):

So everything about the rock is procedural now!!!

Now the next step is to smooth the asteroid, so that the lighting is more realistic.

And probably add some more irregularity. Some bump/normal mapping would make the asteroid more realistic.

Archived: Uncategorised

Rocky asteroids part I

Developed a procedure to create rocky asteroids. They should be very lowpoly because there will be a lot of them in Psirens.

Off course the rocks can be of any size and complexity. Like this:

The algorithm is ported from the PovRockGen utility. A lot of work on the geometry had to be done.

The face indices were completely missing and I had to think up a way to find the correct triangle winding order.

I did this by finding a common edge between two triangle and changed the indices in a way that the counter-clockwise order was valid.

A lot of improvement on the speed of this algorithm should be done because the triangles are not sorted beforehand, making the algorithm slow for complex rocks.

After long and hard thinking about texturing I decided to go for the easiest approach. Projecting a texture from a set of fixed points. Projection with only one point this gives the following results:

 

As you can see that the picture does not look good from all angles. Left upper corner looks undistorted, the right upper corner is heavily distorted.

Sometimes the rock has deeper parts and show some distortion too. The asteroid will need a lot more projections and with the correct blending this will lead to a less distorted view.

The texture used:

Archived: Uncategorised