I wanted to keep this the last thing I’d do. It sounds like a difficult thing to implement. But I can’t save this for the later any longer.
I just have to start building my game world to be able to add other features.
Dont know what they mean by billboards. Maybe sprites? From the images the billboards could go over 300, or even 1000.
Also they say BatchPage is much faster than plain entities/ node(paths). Im guessing they use something like flatten() or rigid bodie combiner. As far as I know those can’t be ‘un-done’, so I would like to hear your opinion.
treeLoader = TreeLoader(trees, TBounds(0, 0, 1500, 1500)
# And add a entity at the desired position/rotation/scale
treeLoader.addTree(myModel, position, hpr, scale)
No idea what compression technique it is.
We could put this in a panda task:
The system has a separate way of handling grass, it also has a way to add shadowmaps to grass and trees, but that one is probably beyond my knowledge.
i think they mean quads/planes when they say billboards here?
Im not really a fan of using billboards for grass. many games use it, but in my opinion its pretty noticeable and looks fake.
I would like to know about your opinion on what additional/unique optimizations can be used for the grass.
I don’t really like the idea of having density maps for trees and big vegetations. There are games with huge worlds where say, you have to look for treasure hidden under a specific tree. But I like the idea of using them for grass. I think there is a code snippets somewhere here on the forums which I could use as a reference. ---------------------------------------
Now, for positioning the trees, I could make a Blender script which would export positions, rotations ans scales of objects (empties?) to a simple text file, and shoot a collision ray for each tree in the beginning to get the z position.
Theres nothing mentioned about the terrain loading. Should we only use geomipterrains in this case?
For the BatchPage trees… how would you use RigidBodyCombiner in this case?
I would like to know of any optimization techniques which could be used in implementing such a system.
Im sorry for the huge post and I know this sounds pretty ambitious, but I hope the advice and techniques posted on this page can be helpful to others as well and will share all my results with the community.
I have the Ogre3D source, and Ogitor Editor to, they include the PagedGeometry; also have source for an open source game project called DungeonHack
That uses the PagedGeometry in its infinite terrain game in development. Took a bit work to download all the parts involved and compile, also had to fix a few things for it to work for me, but it lays out terrain and trees and grass (with movement) very fast as you move yourself (FPS character) across the terrain.
The impostor trees look good but sometimes are shaded lighter than they should given an evening sun position, then when they switch to actual entity they get darker.
But all in all it’s pretty cool.
I do program in C++ and I was thinking of looking at the code and see how it could be used with Panda…
Ive put some base code for this we can work from.
The thing is I havent actually posted any opensource project before for others to be able to download/ modify. Where would you suggest me to host the project?
Okay, back on topic. Right now for positioning the trees Im thinking of using an image. I couldnt find any info about this on the web, so if anyone has any tips/suggestions, please post it here.
Right now Im thinking of something lik this: basically Red, Blue and Green pixels mark trees on the vegetation map. The value of each determines the size of the tree. Thus there can be 3 types of trees. Yep, not very smart.
You have four channels; (assuming you don’t use 16-bits images) you have 4294967296 possibilities per pixel. They can surely be used more efficiently than that.
In your approach, there can be multiple trees of different types per pixel. Let’s assume that that’s impossible - there cannot be two trees at the same location.
With that in mind, you could do something like this: have the Red channel represent the type of the tree, and have the Green channel represent the size of the tree. Blue could be the rotation, and Alpha perhaps a colour tint or position randomisation so.
This would allow for 256 types of trees. That’s a lot better than 3.
Okay, another thing, a detail map is just a texture which is applied on top of the original terrain texture? But wont simply tiling a small detail texture over a huge terrain be a preformance issue? Or is there some other way of doing it?
EDIT: btw, anyone know how to convert Ogre .mesh files to something usable?
Wont look good without those trees
Not an issue. The texture sampling time does not depend on texture scale (except for a bit of cache performance). Having a highly tiled texture adds a multiply to the UV before sampling, and thats it. Sampling is done per pixel on screen, not per pixel on the texture. Adding a detail texture does add one more texture sample per pixel per frame, but thats not too bad.
Yeah Ive read about it, but that site sucks. The page you linked just has the description of that importer. Theres no link, which is weird, Ive also found this page: ogre3d.org/tikiwiki/BlenderI … ture=Tools but again I dont see any download