Vegetation Maps || Just a thought
Vegetation Maps || Just a thought
Hi!
I wonder if it would be possible to use some sort of "vegetation maps" in irrlicht. i´ll explain what i mean:
we create a heightmap for terrain, lets say 128x128.
now we create a vegetationmap for that terrain, also 128x128.
now what is the vegetation map good for?
the color is 0,0,0 black. now were you want to have some sort of plants or grass you have to place a pixel with a color for it.(e.g. 1,1,1).
so far ok? we have a heightmap and a vegetation map which includes a black image with lots of 1,1,1 rgb pixels which should be replaced by models or billboards later
this is how i thought to make it work:
1. the vegetation map is a additional texure of the terrain. lets say texture3.
2. now scan the terrain.texture3 if there are any pixels with the color 1,1,1.
3. if found some pixels like that, create a billboard at this position.
4. repeat this until all pixels (128x128) are checked.
is this somehow possible? if yes i would like to try something like that, it would be a really great addition because its much easier to plant trees,grass,plants or anything else on the terrain like this. any comments or suggestions are welcome
I wonder if it would be possible to use some sort of "vegetation maps" in irrlicht. i´ll explain what i mean:
we create a heightmap for terrain, lets say 128x128.
now we create a vegetationmap for that terrain, also 128x128.
now what is the vegetation map good for?
the color is 0,0,0 black. now were you want to have some sort of plants or grass you have to place a pixel with a color for it.(e.g. 1,1,1).
so far ok? we have a heightmap and a vegetation map which includes a black image with lots of 1,1,1 rgb pixels which should be replaced by models or billboards later
this is how i thought to make it work:
1. the vegetation map is a additional texure of the terrain. lets say texture3.
2. now scan the terrain.texture3 if there are any pixels with the color 1,1,1.
3. if found some pixels like that, create a billboard at this position.
4. repeat this until all pixels (128x128) are checked.
is this somehow possible? if yes i would like to try something like that, it would be a really great addition because its much easier to plant trees,grass,plants or anything else on the terrain like this. any comments or suggestions are welcome
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
1) Yes, its possible to do it this way, i plan on doing so for cf.
A rgb or greyscale map with different values representing different types and/or different thicknesses.
This is the same technique used in BF:Vietnam
2) IT SHOULDN"T BE IMPLEMENTED INTO THE ENGINE
It should be implemented as a plugin type system, where you can just drop the class into ur project. Adding everything like this into the enigne would make the engine as bloated as a dead whale left to rot in the sun.
If u need it, u download it, implement it, and bamboozle
A rgb or greyscale map with different values representing different types and/or different thicknesses.
This is the same technique used in BF:Vietnam
2) IT SHOULDN"T BE IMPLEMENTED INTO THE ENGINE
It should be implemented as a plugin type system, where you can just drop the class into ur project. Adding everything like this into the enigne would make the engine as bloated as a dead whale left to rot in the sun.
If u need it, u download it, implement it, and bamboozle
hmm... ok if you already thought about doing something like this maybe i shouldnt start making one too. because i guess youre a much experienced programmer then i am i agree with you about to not implement this into the engine, a plugin would to it. hmmm... ok the hell with it i guess i will try it the next few days it cant be so hard to make (if you think about it is a really easy way how to make this i guess).
ps: i dont even now how to scan or trace right now *lol* ok i guess i need to experience the irrlicht api a bit before i go for it
ps: i dont even now how to scan or trace right now *lol* ok i guess i need to experience the irrlicht api a bit before i go for it
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
I think this approach will look a little ugly when you have to scale your terrain, because all your plants will reside on the vertexes of the terrain.
I would prefer to specify regions with that vegetationmap (using colors) for certain plants and randomize their positions a little. I think that would look a little more 'natural'.
I would prefer to specify regions with that vegetationmap (using colors) for certain plants and randomize their positions a little. I think that would look a little more 'natural'.
Hardwarespecs in signatures suck !
I'd love to see it in action GFX. Plz keep us updated!!
I guess you'll be having problems with the rotation of billboards, in case you want to simulate trees by copying-rotating the billboard several times in 360 degrees. Dunno if those bugs have been fixed. But at least it will work for grass and perhaps bushes, although it's also weird to see vegetation grow only in one direction.
let us know if you run into any of this.
I guess you'll be having problems with the rotation of billboards, in case you want to simulate trees by copying-rotating the billboard several times in 360 degrees. Dunno if those bugs have been fixed. But at least it will work for grass and perhaps bushes, although it's also weird to see vegetation grow only in one direction.
let us know if you run into any of this.
You may want to look into using axial billboards instead of just billboards..implement in IrrlichtNX ( www.irrlichtnx.mmdevel.de ). Keep us posted!!
i have irrlichtnx so i will try to use axial billboards. iam trying right now to get the vegetation on the right place of the terrain (i guess this is the hardest part ), the rest shouldnt be too hard to make.
i would use the vegetation like this:
grass = sprites (billboards)
bushes = models or many rotated sprites
trees = models because sprite trees dont look so good
maybe i should randomize the position of the entitys a little? because of erSitzt´s post but that would mean that if you start your level the entitys have to be placed somewhere else again, so this isnt good at all. or adding a variable so that you can choose between random placement and not.
but i hope that the script wont be so slow (placing so much entitys and trace them on the terrain). the pixel checking of the colormap goes really fast. if i have anything new i post it here. i also have to comment everything before posting the code i guess (for better understanding).
ps: sorry for my bad english
edit:
@erSitzt
i thought of getting the distance between the terrain and the entity and substract that from the entity height so that it is placed right on the terrain. (i found at least 2 functions in the api: getDistanceFrom();
getDistanceTo(); maybe these are usefull )
i would use the vegetation like this:
grass = sprites (billboards)
bushes = models or many rotated sprites
trees = models because sprite trees dont look so good
maybe i should randomize the position of the entitys a little? because of erSitzt´s post but that would mean that if you start your level the entitys have to be placed somewhere else again, so this isnt good at all. or adding a variable so that you can choose between random placement and not.
but i hope that the script wont be so slow (placing so much entitys and trace them on the terrain). the pixel checking of the colormap goes really fast. if i have anything new i post it here. i also have to comment everything before posting the code i guess (for better understanding).
ps: sorry for my bad english
edit:
@erSitzt
i thought of getting the distance between the terrain and the entity and substract that from the entity height so that it is placed right on the terrain. (i found at least 2 functions in the api: getDistanceFrom();
getDistanceTo(); maybe these are usefull )
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
Some things you might want to concider
Generally, placing a lot of nodes into the list causes major slowdowns in processing time. Try grouping all the geometry into 1 mesh at runtime. Take all the geoms and form one mesh, then add that to a scene node. I'm not sure whether this'll work well in irrlicht though, b/c of the design of the scene node structure
Also, maybe try imposters. Basically, after a certain point, change the mesh to a billboard (in the distance). Saves tris for something so far away, its a waste to draw the full model.
Generally, placing a lot of nodes into the list causes major slowdowns in processing time. Try grouping all the geometry into 1 mesh at runtime. Take all the geoms and form one mesh, then add that to a scene node. I'm not sure whether this'll work well in irrlicht though, b/c of the design of the scene node structure
Also, maybe try imposters. Basically, after a certain point, change the mesh to a billboard (in the distance). Saves tris for something so far away, its a waste to draw the full model.
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
this with the falling trees is a good idea. maybe some terrain mesh deforming too. that means that if i shoot a big rocket at the terrain it is creating a big hole in the terrain and destroys all the trees and makes the ground texture changing. but a lot of work i guess. i have a lot of time, though ... yeah cool idea, thx man!