Planet

July 6th, 2011 by

We finished the planet for the Simulating the World seminar. The planet is completely procedural with L-Systems for procedural trees and particle systems for the clouds around the planet. The planet and all the stuff on it are also dynamically lit. The polygon count is around 160k all running in realtime with the use of the FireFly2 engine. :)

During the coming few weeks Marries and I will keep working on it to make it into a real game instead of a simulation. This will involve quite a lot of refactor. Both on the engine as on the application itself.

Procedural planet

May 22nd, 2011 by

I am taking the course Simulating the World (title says it all). As an assignment we have to create a procedural planet with procedural vegetation and weather. I am working together with Marries and Adriaan. I am way too excited about this assignment because we are allowed to use our own engine. Of course we are using the FireFly2 engine.

For those of you who know me it won’t be hard to guess that I want to go all out on this assignment just like last time. The assignment is just to create everything very simple but I wont settle for simple so I implemented all kinds of fancy stuff.

Anyway, this is not the final ‘product’ but I just had to post an image. :)

Variance shadow maps

May 13th, 2011 by

Today I added variance shadow maps to the FireFly2 engine. Currently shadows can only be enabled on spotlights. I started off with the implementation of regular simple shadow maps but found the quality unbearable at low and medium shadowmap resolutions so I added variance shadow maps.

Shadows cast by 2 spotlights

On Style: Mondriaan and the Mesh Emitter

March 9th, 2011 by

A little while ago, local hero and Ronimo developer Joost van Dongen published an article on his blog about the various options of visual styles and how differing and exploring in style can prove beneficial for small developers. His key point was that it’s easier for small developers to compete on style instead of quality, since larger developers can always put in more effort to improve and outperform on quality. He uses his game Proun as an example of a game that tries to adept a different style, one that has been inspired by the paintings of Kadinsky.  This sparked my interest as a Maya apprentice and small developer, so I took his advice and started exploring the possibilities. This post is mainly to force myself to think this subject and to track my thoughts.

Inspiration

Now I barely started thinking, and I already landed on one of the most famous Dutch abstract paintings: the unfinished “Victory Boogie Woogie” by Dutch master Piet Mondriaan.

Victory Boogie Woogie

Victory Boogie Woogie

Now I never was a big fan of modern or abstract art, but I always was slightly fascinated by this painting. It’s a bit hard to explain why. The first thing that captured my attention was that it uses colors that all yell for attention (red, yellow and blue) in such a way that the painting still looks like a harmonious whole. A bit like having a football team with eleven egocentric stars, and still managing to make them perform like a team. This well-distributed attention whoring of the colors also make the painting lively, even though it’s nothing more then rectangles spread. When I was searching for more information about the painting, I came across this animation, which awesomely shows how bruising  and lively the painting is. The details become part of the lively whole. Much as when you fly up with an airplane and fly above a city you know well. All the details, the colors and the people become part of something bigger and more rigid, a beautiful city full of life.

Ok, but how do we translate this into a style for games? Well, let’s take a ride at the train of thoughts! Victory Boogie Woogie is composed of small components (colored blocks) that fly together to form a lively whole (the painting). You see where I’m going?

Particles Boogie Woogie!

Particle systems! All makes sense right? For some years now, we’ve been using particle systems to model stuff that was too hard to model by hand. Instead, we break up the model into little particles, and let those particles be influenced by the laws of physics.  Many things work perfect for particle systems: Smoke flying upwards, fireworks spreading in the air, or rain falling down the sky.

Particles

...or leaves flying around a twister!

Now wouldn’t it be awesome if we could simulate the effect of Mondriaan’s painting? Can’t we try to make all these little particles to create a lively whole? We’re not really interested in emulating stuff that already exists, but more into creating full models that are made out of particles. Like a in-game character, for example. Can we create a character using the particles system? What are the benefits, and what are the difficulties?

The Pro’s

What would be the benefit of using particles based characters? Some things can be outright awesome. Take a shooter for example. I’m playing online with my particles-guy Hank and fire my shotgun at particles-guy Hans. Wouldn’t it be madness if Hans his particles got shot all over the place, creating a festival of bloody confetti, and creating a whole in Hans where he was hit?

No More Heroes

Like the visual festival of No More Heroes, but different

Imagine this with a rocket-launcher. Hans would be all over the place, and I imagine this being a quite satisfying visual effect. But there are so many more effects that we can create. Particles can boost the effect of speed and wind, or they can be used to set different styles. Think about characters who have particles dripping, or a character who is on fire, with the particles flowing up in the air. Particles system are also more intuitive and easy to morph. This enables your character to land stretching punches for example, or enlarge or stretch other parts of his body. Technically, a mesh emitter (that is, a mesh model that emits particles, not an emitter that emits meshes) could prove a big help in achieving these models. So much options!

The problem

Well, I and Bas were convinced pretty fast that there are a lot of innovative options to be explored. So I started to think about what could be done eventually, and what would be the design problems to tackle. For starters, I started sketching some interpretations. Next to it, I just draw something more easy to model, just another brainfart flying around.

brainfart mondriaan 1

Wow, that looks like...

Crap. Well, at least the particle drawing does. The Abstract representation looks OK, and seems to carry on the flavor that the original cartoon has.  Here we see the most important drawback I discovered till now of the particle model. The total lack of lines and detail makes it impossible to create all but the most simple textures. Sure, we can use color to distinct between different objects like the head or the hat, but stuff like eyes, eyebrows or noses can be extremely difficult to create.

“But Adriaan”, you say, “Why not create a new mesh with different colors and forms for the eyes as well?” Well, I’m not saying it’s impossible, but there is an inherited problem with that. The whole point of particle clouds is that they are not a connected mesh. There is always some space between the particles to look through. This can create a blurry effect (like making fire go over in smoke) that is exactly what we don’t want. Now, if you make the cloud dense enough, the space between particles is so small that the blur effect is cancelled, but then we may have to much particles to compute physics on, and we may be better off using a normal mesh model anyways.

Now I’ve actually been cheating when making a comparison between the particles model and the abstract model. Maybe you’ve already seen it while thinking over the problem described above. There is a huge difference between the left and the right drawing, and that is that I allowed the right drawing to change shape. Take the mouth for example. The jaw is disjoint from the rest of the head, allowing me to make a funny representation of the big smile. This is actually what I believe to be the key to making particles models to be visually acceptable without using dense particle clouds.

Shape that cloud!

Allow me to explain further. Take that horrible drawing above for example. Now I think small shapes like the ears are a lost cause. We’ll need to remove those, or enlarge them significantly. Now we got a good looking contour, but the inner details are still nowhere to be found. What I believe to be the magic trick here is the creation of holes in the character. That means, holes that reach from one face to another face on the opposite side.

drama mask

A bit like these drama-masks!

This way we can create a model that acquires all of his detail and identity purely on shape and color. That seems like an interesting challenge! I will be developing this idea the coming months together with my Maya skills. I’ll have to wait anyways, because the FireFly engine doesn’t support particles systems yet. (And that while Fireflies are such a nice example of a particles cloud!) I hope that you’ve enjoyed this exceptionally long brainfart!

-Adriaan Jansen

Last day of the GDC :(

March 5th, 2011 by

Its quite depressing when you know you’ve just walked into the last session of the GDC2011. Fortunately Fridays sessions where quite amazing. So lets get to it and cover some of these!

Automated level of detail generation

HALO:Reach has very high detailed models which are shaded by multiple shaders. This is expensive when theses models are very far away from the player since a) the player isn’t able to perceive the cool shaders and b) rendering is just expensive. So, what you generally do is generate low resolution meshes and assign different shaders (or simply the same) to them. This works very well however the artist has to generate these low-poly meshes which is tedious work. So in HALO:Reach they went with a different approach. What they did is implement a system that generates these LODs automagically. You can just run the high detail mesh through one of the many mesh simplifiers but most meshes are not suitable for this because the artist did not create the mesh with simplification in mind. So the mesh may for instance contain long triangles, mesh simplifiers don’t tend to work well with these. So another tesselation of the mesh is required. Bungie did this by voxelizing the mesh and than tesselating that mesh. This causes the mesh the change shape a little but hey! we are creating LODs after all so no one will notice. This voxelized mesh is actually great for simplifiers so thats problem is solved. The next problem is the large amount and often very complicated shaders. The approach they took was to approximate the diffuse and specular term over the surface of the mesh and create a texture of this to use for rendering. In the distance this creates a very good look. Creating this texture is done by rendering the model from different sides and different lighting conditions and averaging the results.

So in the end very cool stuff. Especially the voxelizing since I would have never though of that.

Effect in HALO:Reach

This 25 minute session showed three effects that were used in HALO:Reach. One of these techniques was screen-space colliding particles. This amazingly cheap effect utilizes the depth buffer to collide small particles with the world. Of course this doesn’t work for most of the particles but since the player can’t see these particles it’s a very cheap and convincing look.

Approximating Translucency

Again a very cool presentation of a technique in the frostbite 2 engine. This translucency technique is far from realistic but it is amazingly convincing, cheap and works with a deferred shader pipeline. So how does it work? It simply evaluates a thickness function that is baked in a texture and uses that to do the approximation. This thickness function is just the ambient occlusion of a model when the normals are inverted. Thats basically it! This adds just a little overhead on the gbuffers and a very minor overhead on the lighting resolve but it truly looks amazing. Also it can be combined with the Compute Shader approach to tell a tile if it should do translucency or not which makes it even cheaper. They reported that it took 0.03 ms on modern PC’s. Thats almost free! :D

What’s next?

So that was the end of the GDC2011. I have learned a great deal of techniques which I will probably be implementing in the near future (read hopefully this year). It was an amazing experience which I will not soon forget. San Francisco is an amazing city, especially down town. If you can go there, you should. I also met a lot of cool people from the industry with whom I’ll probably have contact after the GDC. (Did I tell you Marries and I are going to show our demo at Guerilla’s headquarters?). This alone was quite an experience. I really really want to go back next year so lets hope I win a price or something. Or even better lets hope I can speak at the conference next year! :D I also had quite a lot of fun with my two companions Marries and Emiel!

In the coming few weeks I will try to write two articles which explain two techniques in more detail: culling and our component based entity system. So you’ll hear from me soon!