Wednesday 24 February 2010

The cheats of europe

Yeah I know, one way or another, we Greeks have made a complete mess out of it. It is, however, an oversimplification to assert that it is all because of the egotistical, negligent nature of the people.

The matter is more complicated, and for a wider view of Greece, its tribulations and hopes in the wake of the 20th century, have a good read of this book.

Monday 22 February 2010

Make a demo with 3 simple rules

The other day I was thinking that the continuity of parts and effects in our demos (mostly big demos that go to Assembly and the gathering) can be expressed in 3 very simple terms:

  1. A scene/effect is established on either a plane (quasi-2D) or within a cylinder/sphere (3D). Camera moves accordingly to show the effect.
  2. Planar scenes follow cylindrical scenes and so on.
  3. Long segments of the demo are dedicated to move from one mode to another. This process is called a "transition".
I'll give you an example: in iconoclast there is a scene with a glass-like cube. Camera rotates around (cylinder) -> camera goes inside a door, underwater scene (plane) -> second reality references (cylinder) -> music box, polaroids (plane) -> shark in cube (cylinder) -> final scene and end credits (plane).

Maybe your demo follows a similar pattern too!

Friday 19 February 2010

GLSL effect #1

I'm going to type in 3 cryptic lines in GLSL. Try them out yourself - maybe they can find a cozy home in one of your demos.



gl_Position.x=float(int(quant*gl_Position.x))/quant+gl_Position.x*0.001;
gl_Position.y=float(int(quant*gl_Position.y))/quant+gl_Position.y*0.001;
gl_Position.z=float(int(quant*gl_Position.z))/quant+gl_Position.z*0.001;


you can probably contract that into 1 line.

Thursday 18 February 2010

TopMod

So you are making a demo and you are on the lookout for some nice organic, abstract 3D models to grace your scenes. You know how it works: put one of these models in the middle of the scene, one (much larger) surrounding the scene and forming the background. Then put the camera in the middle and rotate, keeping the first object in dead center. Add a bit of hypnoglow, a bit of particle-dust, a bit of typography and you have 20-30 seconds of bliss.

How do you create these object then. Here is an idea: use TopMod. It is a simple 3D modeller that you can use to make 2-manifold meshes, with arbitrary genus. There are some youtube videos showing some models in action.

But take a very very deep breath in before you start using TopMod. It is annoyingly easy to crash. Use it wisely with wings3d (as in do all the fancy genus stuff with TopMod and let Wings do the dirty work of smoothing and refining) and you'll be in demo nirvana.


(for the record I've never used TopMod for modelling for demos. But that is another story...)

Wednesday 17 February 2010

Realtime raytracing on GPU

Further to my comments on my new year's resolution, I also vowed to stay clear of any effect that uses "realtime raytracing" on the GPU.

It was a very tempting thought: over the past year I have been writing raytracers for viewing medical data for my company Ambivu. Have a look at some youtube videos here.

However, beyond visualizing big datasets, I don't see how realtime raytracing can help us with our new demo. I understand that it is useful for very small demos (4ks, even some 64ks) where you want to visualize a simple, or less than simple volume function in order to make, for example, a tunnel effect. For that use, it is ideal. For anything else, I honestly don't understand the point of using raytracing in place of triangles. Yes, you get proper reflections and shadows for free, but you can fake all that much more efficiently with the 3D graphics pipeline.

I have seen "demos" of real-time raytracing from commercial companies and I wasn't convinced it is the future yet. A mirror-like car in a plastic environment (running at barely interactive framerates) just doesn't convince me otherwise. Maybe you, reader, have a different opinion.

Monday 15 February 2010

New year's resolutions

Making Lifeforce back in summer of 2007 almost cost me my physical and mental health. It was far too big a project to carry out given the very limited time I had for my hobby. If I ever was going to make another demo of similar scope in 2010, things had to change.

I needed to alter my methods and streamline the process. So, in January, I made some new year's resolutions that I thought would help:

  1. Ditch Cg. I've been using Cg for almost 7 years and it served me well. But with the advent of GLSL, Cg is pretty much obsolete. So gone are all the little nuisances and extra C code to "link" my external variables with the shaders. GLSL works much more transparent and I need fewer recompiles.
  2. Ditch Blender, Maya and 3D Studio. I admit that I'll never become a master of those modelling programs, as I don't have the zen-like calm of a Tibetan monk to learn (of all things especially Blender) properly. They may be super-programs but for me they have always been a source of annoyment. First of all having to run them in the first place adds time! I will be doing something in code in visual studio and then I need to scale something in Blender or 3D Studio. All this process of run/load/finetune/save is costing in time. Part of the reason things had to be like that was my old insistence and total reliance on the .3DS format. There are historical reasons for that (the first "engine" that supported bump mapping, in planet risk, was using certain tokens in .3DS files). But that should change. So, ditch everything except, of-course, my sweet Wings3D - and use the .obj (Lightwave?) format. Yes, it is very primitive, loads slow and probably won't let you do materials and textures, at least with my loader. But it has everything else I need: geometry, UVs (if you need them, I never do), hard/soft edges, grouping of objects. Simplified my life by looong margin.
  3. Never do another "baked lighting" texture again. It takes forever to auto-uv and bake the model in annoying Blender. I still remember the absolute nightmare that Size Antimatters (which uses such textures extensively) was. Nice way to spend your evenings, waiting for the radiosity pass to finish!
  4. Start writing everything in a linear fashion. Start with Part 1, 2, 3 ... last part. And keep "parts" as long as possible, in order to reduce the number of total parts and hence complexity. Lifeforce had 11-12 parts, I'm aiming for a maximum of 6-7. It should make a lot of difference at the end when we have to link everything together (music and parts).
  5. Put more "program logic" (i.e. if (time>20) do this ..) in shaders, using ps3.0: conditional, loops. As a result, the complexity of the C++ code has gone down dramatically. Most of my code is now shader-work. I estimate that the C++ "engine" is probably around 80% down in lines of (horrible) code compared to Lifeforce. Important exception to this is the camera-work and all functions associated, and I'll explain more in future reference.
  6. Speaking of shaders, allow for reloading of all shaders for a given part while the demo is running (by pressing the space key). This has already reduced the refinement cycle times by a long margin. An additional tip is this: I put all my "real-time user-defined variables" (mouse position, buttons etc.) as arguments in *all* shaders. So if I want to fine-tune something and then something else I can do it with the mouse without having to restart the demo. It works very well.
I will elaborate more in due time. Further to this list, my new year's resolutions also include:

  1. Keep and use 2 computers for coding: one with a crappy NVidia 8600 and another one with a more modern ATI 4850. Do most of the coding on the 8600 and only occasionally try the demo on the 4850. Aim for a 16-20fps at HD on the 8600, it should be sufficient.
  2. Stop watching vimeo videos and xplsv.tv, trying to get "inspiration" (or, in other words, steal other people's ideas). It just doesn't work with me - usually a static image (one that is actually unrelated to computer graphics and effects) does the trick: a photo of a city, of a fruit, of a weird animal is more inspiring than most copy-and-paste "motion graphics" videos (some of them are really cool, though, and carry concepts I wished I had thought of myself).

I'll stop here for now. Yesterday someone asked me if my estimation of "33% of demo completed" is accurate or not. It really isn't, but I want to think it is, to give myself some courage.

Hello all!

Hello all,

This blog is all about a forthcoming demo from our group ASD (http://www.pouet.net/groups.php?which=1317)

I (navis) will be posting sporadic information on our progress over the next few months. For the time being this is all I can say:

  • The demo will not be presented at Breakpoint 2010. It wouldn't be possible anyway, there is tons of work left to do. I also won't be able to get there (or at the Gathering 2010) - Catholic and Orthodox holidays are on the same weekend this year and I'll be spending the time in Greece with my family. Looking forward to good food and warm weather!
  • Next stop would be a big party in Summer. Assembly 2010? Could be. Will depend on other factors. I'm sure we can finish the demo by then though.
  • The name of the demo is NOT "iconoclash"
So it is now middle of February and progress bar shows "33% done". Unlike all previous big demos that we did (planet risk, iconoclast, rupture, lifeforce etc.) this one is written in a strictly linear fashion: the introductory part was made first, followed by the next part and so on until, hopefully, we'll have the "picardy third" in the final cadenza sometime in July.

So far so good then.