[World modeling] Suggestions for a park?

I must accept it: I’m completely lost when it comes to 3D games world modeling. For 1 year I have been searching the net for tutorials about this, but I have never found that :confused: (at most, terrain modeling via heightmaps or interior scenes, but never a complete exterior scene with paths, roads and so).
Honestly, I don’t know why. They are not like the character modeling tutorials, wich you can find them even in the newspapers :stuck_out_tongue:.

Anyway :stuck_out_tongue:, I want to make a park level for an RPG but I don’t know exactly what to do.
Hope you can help me if this question has to do with Panda :confused:.

Dirt and brick roads
Ok, I have my base grassy terrain but I want it to have a dirt path or something that nicely blends with the grass around it.
I think in high end modeling packages they make this by composing layers, using an alpha mask to make the trick. But I can’t imagine how to do this using a real time rendering engine like Panda3D.
Maybe it’s possible by multitexturing the terrain or so, but I don’t know how to do so :stuck_out_tongue: (I have read the corresponding part in the manual) and I don’t think this would be suitable because the alpha mask resolution; that should be hi-res or the path will be blurry, I think.

So, I watched Zelda Ocarina of Time (a game wich I want mine to be similar for the art concerns) and I saw that it seems they modeled the path as a mesh that lies a bit over the base terrain and then they applied a transparency map to the road mesh in order to achieve the dirt path and the blending effect.

Ahm… this is what I have:

Of course, it has no texture nor opacity map yet. In fact, it is just a rough test :stuck_out_tongue:, but my question is: What do you think about my idea to make paths, roads and such?

I perfectly know the last question has not much to with Panda, but the next question sure has to do :stuck_out_tongue:.

Because it is a park, obviously I want it to have a lot of trees and I can think about three posibilities that anyway lead me to some question.

The least practical and the one I am not even considering seriously: Putting hundreds of low poly trees (maybe 500 polys each?) and then exporting all the world together like if it was a multimesh single model.

Come out with a Nintendo 64-ish solution :stuck_out_tongue: and put planes with a texture that simulates an array of trees.
I can do this and maybe is the right answer, but I’m sure I wouldn’t like to use this because of the poor quality effect it provokes :stuck_out_tongue:.

And the feasible but hard-working solution: Using billboards.
They would look just great and I think they are not so expensive, but I’m not really sure.
The first problem is that there must be a considerably large quantity of these and I know it’s not a good idea to have thousands of objects with very few vertices (maybe not thousands, because I can re-design the park and squeeze it so there should be less trees… maybe 200, I don’t really know).

Then, if I’m using billboards they need to be separated meshes, because of the transparency issues and the billboard effect itself.
AND, well… supose you tell me it’s not such a bad idea to have a few hundreds or dozens of 4 verts planes, but this leads me to another question: Do I really have to hand code the position, scale and type of tree I want to have… for every tree in the scene??? :confused: :confused: :confused: :confused: :confused:
Ok, maybe there’s no need to hard-python-code this, but at least this info has to be in an external file or something… which maybe I have to hand write or something :confused: x_X.

A more general question
In fact, the last option (the billboard one) makes me think about other thing that is somewhat obvious, but I’ll ask it anyway because I want to be sure :stuck_out_tongue:: Any time you want to add something with a “special behaviour” you must hard code it, right? I mean, I think this a sort of “extreme case” where I can’t just try to label each tree by using egg-opt-char because of the transparency issues when you have a single model with several “transparency layers” (hope you understand what I’m trying to say :confused:, I must say I am a complete brute when it comes to explaining things in a foreign language :stuck_out_tongue:).

Well. I’m really sorry if my noob questions have not “that much” to do with Panda, but believe me, I really don’t know where else to ask this or what to do. As I said, there are many tutorials about interiors modeling (… and for Quake-styled games) or terrain modeling but nothing aimed towards games.

Thanks in advance and excuse me for any inconvenience :confused:.

Well, most people around here (including me) are NOT professional game developers, and so they have to learn about all these questions. Part of the fun I would say, finding out how it is done. And Panda3D, employed for entertainment classes by Carnegie Mellon, is probably the best choice if it comes to newbie game engines.

Making roads a layer close above the ground is certainly a way to do this, and I can imagine this is very useful if you want to modify roads during the scene (creating new roads e.g.).

A more general approach is to have several detail textures (grass, cobbles, sand, dirt, …) and blend them together using alpha-maps. Detail textures don’t have to be large, 128x128 pixel is enough. The alpha maps need to have higher resolution, maybe one pixel per foot or per meter. But you can combine several alpha maps in one image (r,g,b,a channels, each a separate alpha map). The technique is called texture splattering or splattermaps, and employed by many current game. Google will find several tutorials.

Several modelers support painting splatter maps, directly or indirectly. A free modeler for terrain is EarthSculptor. On the Panda3D side you will need to write a shader to blend the single textures together. There are several example here on the forum.

The most simple thing is to use several low-poly tree models, create your scene, and then use flattenStrong on the root node to make one static model instead of hundreds of small ones. Again, the forum has some info about flattenStrong.

The best way is probably to mimic what commercial tree/vegetation packages like SpeedTree do: far away trees are billboards, and if close they are a mixtures or a static mesh for the trunk and branches, and several dozen “billboards” for leaves or leave groups. The reason why I have put billoards in “” is because you will have to use shaders again here, since traditional billboards would be way too slow.

I have some experimental code that transforms from ngPlant models to egg, but for the LOD stuff I need EggSwitchConditionDistance, which unfortunately is not wrapped in the current Panda3D release. Anyway, ngPlant is a very, very nice tool to look at :slight_smile:

I think you are right about that having several hundred or thousand billboards at the same time not a good idea. But maybe you can group them together in chunks, say 50x50 meter, and employ shaders again to render them. But, not implemented so far, just ideas.


Oh oh oh! Ok, now I undestand this bussines :stuck_out_tongue:.

There are no “world modeling tutorials” beacuse it is a matter of design, performance and so.
I mean, there is no such thing as modeling the whole world and then exporting it as it would be done with a character: You always need to make optimizations and so (I know this is kind of obvious :stuck_out_tongue:, but as I said, I’m a completely newbie :stuck_out_tongue:).
And I think that’s why popular 3D rendering engines (like OGRE) seems to need that you use BSPs, Octrees and so. And that’s why “Panda is so slow compared with others” (but if you know this it is obvious that of course Panda is not slow at all :open_mouth: ).

Anyway :stuck_out_tongue:, my video card does not support shaders, and I know NOTHING on how to program shaders :confused: , so it is not a suitable solution.

I tried the flattenStrong solution for the trees, but it seems that having too much alpha textured models severely hurts the framerate :confused: (my trees were nothing special: 1 cylinder with 4 2-triangled planes).
Also, I had some inadmisible transparency issues, where things were erased because of the transparent parts… ahm… i mean this:

I fixed that by using alpha { dual } in the egg file and by changing the alpha map for a “lower quality” one: Only black and white, no grayscale (in fact, the screenshot was made with the 2 color map. With the grayscale map, the tree erased a lot more :confused: ).
I read that using the dual mode is a expensive solution, but that was the only solution I could think on o_O… oh, yes: One tree is in fact a 5-nodes model (1 cylinder and 4 planes, as I said). I thought that having the pieces isolated would fix this transparency problem, and at a certain point it was true, because this way the planes didn’t erase the other planes, but they kept erasing the background O_o (I even tesselated the planes in order to have more vertices, as the manual says, and I got the same thing o_o).

So, because of the aparent framerate hurting alpha maps, it seems that unfortunately it is hard to have too many trees in the world (just as I expected), so I had to redesign the level and I replaced the “lots of trees” with a single “wall of maze-like bushes or something” :stuck_out_tongue: as you could see in the screenshot.

Anyway, at the end I talked a lot about my insipid life :laughing: .
Thank you so much for your help, enn0x. You really opened my eyes and now I understand that world modeling is not a trivial task :slight_smile:.