What you’re looking at may well be the first official preview pic for Hairlock. Unless I change the name to Redlock… or whatever.
But I’m too tired to even draft a 5 line blurb, which is where my ambition lies. For the game itself, well… Fancy running this through the profiler since adding more trees and more growth is hitting me low.
- 16.4/18.6% procedural grass. Awkward considering so little of it is showing in this shot. Well what’s awkward is I should really grid-chunk this stuff, and likely define LOD nodes for it.
- 14/4% decorations. That’s the shorter plants and all the stones. Yea… each stone is rendered as a 3D object. Compared to grass, other decorations use pretty efficient bounding boxes. Maybe too efficient. I’d like to use less GL calls for these (grid-chunking again – different problem, same proposed solution)
- 11.1/4% the terrain. All trees, trunks and the ground count as terrain; plus the axe at the front.
- 10.4% rendering actors – count the little lady and the crow.
- 7.7/10.6% objc_msgSend
- 0.7/0.5% clouds in the sky (animated, not quite visible on this pic)
- 0/18.3% eval geometry for decorations
In all cases i gave two figures – the first one for the scene presented here, the second for walking around, but mostly focusing on a very different kind of scene.
Is it so bad after all?
I wrote a few times that optimization isn’t the first thing to have in mind. I’ve been struggling a little to manage drawing everything I want (to be accurate, I have a radical impulse to add more grass). I also started this post assuming that I couldn’t balance around 15FPS. Wrong.
I was staring at my little cotton clouds crossing the screen, and I suddenly realized that the clouds were obscured by otherwise invisible background elements – because I have a linear fog set to start at 1/4th of the viewing distance. Point is, I have this reference scene with a couple of houses in the background, and what this little observation shows is that balancing didn’t require this stuff to disappear.
I don’t like large elements (5-10% of the screen) to pop in the blue; conclusion, I likely need to do a couple of things that have little to do with optimization:
- Account for an object’s size when deciding whether to draw a far object or not. Grass vanishing would be fine (no, actually I really like the jagged effect on far edges, and I’d also like better-than-spikes grass blades in the foreground)
- Altogether prevent larger-than-something objects from disappearing in another way than exiting the field of view. That makes plain sense. If it’s not within viewing distance, it can’t appear. If it’s already on the screen, it shouldn’t disappear. This might kill frame rate a little at times – no so much so, because keeping stuff visible will force less of the new stuff to enter the screen.
- Worry less about using fog to ease in and out, and more about using fog to bring atmosphere.
Notes to self
- Still need to improve this grass and render it faster.
- Should really try VBOs.


Comments