Sometimes I guess it’s interesting to see the steps along the way that lead to a final screen shot. For whatever reason, this “far tree” thing, I took lots and lots of screen shots along the way.
So, initially, I had to make sure that all of my tree entities were in the right place and that I could extract and draw them as easily as I guessed that I could.
There was at least one misstep where I forgot to flip y for z.
But here they are after I got some basic x-aligned, properly sized, wire frame quads:
…yep, they are in the right place.
So then I rendered them as transparent quads to get an idea of the GPU impact. Here are two pics, one with and one without, for comparison:
That was also when I was still batching an entire 1024x1024 area. There are generally 3 to 4 visible at any one time. I eventually split that and subdivide it into 16 256x256 areas for better culling and so that I could convert coordinates to bytes.
The GPU stats improved nicely… I’ll just link to the imgur album if you want to see that, though: http://imgur.com/a/Q7XKS
Next I had to render a few different types of trees. So I wrote a little test app:
…which I then turned into a proper atlas in photoshop.
So then just to see what it would look like, I switched out my semi-transparent quads for one of the atlased trees… still just using the Unshaded material, no lighting, no fog, no alpha discard:
Ugly but promising. Especially the far away stuff.
Here’s another ugly one with the tree types properly selected. Still no lighting but at least I have a proper alpha threshold now:
…and that’s when I went to bed.
When I got back to it this evening, I worked on properly billboarding the quads and setting up ‘abused’ normals to simulate more dynamic lighting. I’ve left alpha off so that the lighting is more obvious in these pics: (same view, different times of day)
And then the final effect: (similar view to above, multiple times of day)
I think the trees look nice and round.
You can see the final money shots, here:
http://hub.jmonkeyengine.org/forum/topic/december-monthly-wip-screenshot-thread/#post-253311