Samples updated

New ones

  • Blur sample (shows how to do a cool post effect, blur)
  • Masking sample (shows how to mask a part of the picture, example, from a quad to make a circle)
  • Normal Mapping sample (shows how to do normal mapping)
And some screens

http://img295.imageshack.us/img295/2596/blurrv8.png

Free Image Hosting at www.ImageShack.us

Free Image Hosting at www.ImageShack.us

I'll go now and try to do soft shadows :) Later

Shadow maps

Till now I thought that doing shadows is very hard... Well, I was very wrong, because, see it yourself.

Free Image Hosting at www.ImageShack.us

And don't get frustrated by the FPS, it's my computer :(
Well, till now I've done some samples for my N3DEngine and here's a list:
  • Label
  • Particles
  • Terrain
  • Water
  • Shadows
  • Destroy the targets
More are coming, about one every day :)

http://rapidshare.com/files/39521297/DestroyTheTargets.zip.html

Free Image Hosting at www.ImageShack.us

It's a little 3D mini-game where you are supposed to shoot those falling targets. Nothing special, but looks cool, because it's my first 3D game with particles :P

Free Image Hosting at www.ImageShack.us

And it isn't this. Even though, it has to do something with these pieces going into various directions. What's coming?? A suprise! No, really, I will tell you. It's a demo, a mini-game which will demonstrate the particle engine in action... Be patient :)

Me again

Free Image Hosting at www.ImageShack.us

A sample with the NGUILabel class in which you can see different states. The first label is only a label, not clickable and not blinking. The second is clickable and not blinking, third is not clickable and blinking, the fourth is disabled, and the last one is clickable and blinking. But that's not the reason why I'm posting this. Behold!

The particle system! I did it! Well, what's a game without particles?? Probably, nothing, because you'll always see particles somewhere, hell, even games like breakout have particles, and I didn't :(
But, a little experimenting with point sprites didn't hurt.

Free Image Hosting at www.ImageShack.us

That's a fire effect and most commonly used in games. But, I wanted to do something that is rare. This particle system can be used for various effects, like this:

Free Image Hosting at www.ImageShack.us

A little blood effect, which I will need in the PacKiller game, and also I'll do some particles for smoke (when you shoot, coming from the gun), wall parts flying around etc...
I also have to say that the particle system is very flexible, you can change parameters and make something unique very easy :)
Damn, I'll have to upload some smiley's.... :D

NGUILabel class

Link

So, what is this about? When you make a game, you will have a menu. You'll have text labels all over the place, then in-game labels etc... So I've created this class to suit my needs, of course, you will have to edit it a little. The class will render text that you want, and also can act like a button (but it doesn't have to). It can be enabled, disabled, supports mouse over color change, blinking, scaling, changing opacity etc... You'll see that all from the class :)

Did you know?

That I had problems with drawing models?? Apparently, when the model is exported and processed in the content pipeline, all of it's meshes are positioned on 0, 0, 0 (X, Y, Z). So, if your model had a box at 1, 2, 4, when you draw it, it would draw at 0, 0, 0. So, what's the deal?? Suddenly, I discovered that they can be positioned the way you like, but you have to do something. There is an array of matrices, that will help you to do this. So, let's begin:

private Matrix[] transforms;

You will use that matrix, to alter the world matrix, and set it to the shader. Now, we need to fill it and resize it.

transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);

and when rendering your mesh parts, always set the new world matrix which is equal to the main world matrix multiplied with the transform. Here's a sample:

below, or see this (link)

foreach (ModelMesh modelMesh in model.Meshes)
{
effect.Parameters["World"].SetValue(transforms[modelMesh.ParentBone.Index] * Matrix.Identity);

effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
foreach (ModelMeshPart meshPart in modelMesh.Parts)
{
device.VertexDeclaration = meshPart.VertexDeclaration;
device.Vertices[0].SetSource(modelMesh.VertexBuffer,
meshPart.StreamOffset, meshPart.VertexStride);

device.Textures[0] = meshMaterials[i].Texture;

device.DrawIndexedPrimitives(PrimitiveType.TriangleList,
meshPart.BaseVertex, 0, meshPart.NumVertices,
meshPart.StartIndex, meshPart.PrimitiveCount);
}
pass.Begin();
}
effect.End();
}

Note that I multiplied the transform with Matrix.Identity, you should swap that with your object matrix...
btw, you won't get another collision detection tutorial :( It's because you should do a million things besides it, and I'm too booooored to write about them :(
Sorry again


 

Copyright 2006| Blogger Templates by GeckoandFly modified and converted to Blogger Beta by Blogcrowds.
No part of the content or the blog may be reproduced without prior written permission.