The only Pro feature I am using is the stars. They are drawn directly with OpenGL quads. This may not sound too complicated. The complicated part was making sure they were always 1 pixel wide. If the width in screen space is allowed to vary, they will flicker madly as the player turns around.
So it was kind of tricky to give the correct coordinates in object space to compensate for the pespective distortion.
In theory, I could have used a particle system to do the same. However, I would have needed to do the same size compensation for the particles, and that would have been way too slow.
It turns out that using a skybox is faster than either method as soon as you are drawing a couple of thousand stars. And there is no limit to how many stars you can plot onto a skybox. So I think I will be doing that next time.
I was going to ask in my first post in this topic, but forgot, sorry. I said to myself, “Hang on, all these stars are exactly 1 pixel big…did he do that programatically somehow?” The disadvantage of using a skybox is that you can’t really get those nice pinpoint stars. (In addition to using way more VRAM.)
Well, better late than never
The script is not exactly user-friendly, so I don’t think it belongs on the Wiki, but let me know if you are interested, and I’ll post it somewhere.
I suspect you might understand it. It is uglier than it is advanced. Here it is, warts and all. The most strange thing about the script is the “cut_limit” which requires you to understand something about how Dot products work.
You can either feed it a mesh of your own. It should have colors for each vertex. Or you can let it generate a bunch of random stars.
The script is supposed to be used on a “background” camera, a level below the main camera, since it draws on top of everything.
Thanks! I get about 75% of it. At least this is an improvement compared to when I started with Unity a year ago, when I would have looked at it blankly for a minute, said “Huh”, and gone back to making balls roll down ramps with the physics engine.
Very soothing and dreamlike. I got lost in it, and forgot to go to bed early like I was supposed to. Even though it’s not a game, I somehow won it anyway. (I guess that didn’t make sense.)
Carsten, I am so incredibly in love with this! It’s just so beautiful in so many ways. I’ve been fascinated with fractals and iteratively generated organic shapes for many years, though my programming chops aren’t nearly good enough to do anything close to this. So it’s just luscious.
A couple of suggestions that might enhance the amazing experience you have created:
The movement of the character controller and mouselook seems very jerky and hard to control on my Santa Rosa MacBook Pro. I really wanted to have smoother walking and mouselook so I could really look around more easily.
It would be neat to be able to choose between the black star background and maybe an abstract but lighter skybox (not fluffy clouds or anything. I’m thinking some of these shots would make amazing desktop backgrounds.
Unless it’s too processor-intense, it would be awesome for the trees to persist at a greater distance, so you can see more of them after they’ve grown.
Of course, I’m sure you have even bigger and better plans for this, so it’s hardly fair to complain about it (except for the mouselook, which is kinda frustrating).
Gosh I don’t know. The tree growing seems pretty smooth, so even though I don’t know the actual frame rate, I wouldn’t say the whole think is jerking along.
We’veseen with WolfQuest that some things actually show up as issues when you have a much higher frame rate than what you test on, but I don’t know if this is the situation or not.
If it’s just an input thing, are you using USB Overdrive? Because that can cause problems, although it seems to be mostly in fullscreen with the webplayer, at least on my machine.
I use a Kensington Turbo Mouse trackball and the Kensington drivers. In general I have very smooth response from it, and when I use the stock character controller, it doesn’t jerk around, so that’s why I mentioned it to Carsten.
Maybe there’s enough overhead with the procedural meshes that it’s still GPU bound even on the nVidia 8600M GT, and so that’s the real problem.
You should probably not be limited by the CPU. Unless it is really weak at floating point work. I wrote it on a single processor G4. You can hit “Tab” to get a FPS counter. Could you tell me what rates you are getting?
I expected the people with Intel graphics cards to have trouble, since they are very sensitive to many vertices, and that is what this demo has lots of. However, I am surprised if your Nvidia card can’t keep up.
The problem might be the other way round like you suggested. But I am getting nyself a Mac Pro in a couple of weeks, so I am going to find out if that is the case.
By abstract, do you just mean a single solid colour? You see, I am not really an art guy, and have never made a skybox. The stars are random-generated and drawn directly using OpenGL.
It was too CPU intensive on my current machine. I am not promising anything, but I will probably be trying to stress my new machine soon anyway.
Thanks for the nice comments - and the constructive criticism.
I probably played so long with the weird controls that I thought that everybody else could use them as easily as me. Typical lack of usability testing.
About plans: I don’t really have any grand plans for this. It was just something I felt compelled to make. I’ll probably throw in a fractal tree or two in what I am making now, just because I can.