I've been working on some foliage in maya the past few days, getting them to look right in-game is a really difficult task. I've tried planes, bent planes and all kind of stuff, it's still not what I had in mind.
So now I'd like to make the planes parallel with the camera instead pretty mush like Oblivion.
Right now I do not have any ideas on how to do that with a shader (if it's possible even). I'd like to have the trunk on a different MDL file as I'm using Slins normal map shader on it, and all the planes (leaves) in either one MDL file or have a single MDL plane and use some sort of a for loop which checks through either "bones" with names or vertexes and inserts them accordingly and then giving them each an action which has like my.pan = camera.x or something. But I guess that would be abit slow if I have like 50+ Trunks.
So does anyone know or have some ideas which could help me achieve this without shader programming as I have no clue about it or if the for loop idea would work?
Thanks in advance!
//Endu
Re: [HELP] Foliage that is parallel with the camera
[Re: Enduriel]
#255898 03/13/0910:4503/13/0910:45
If you mean foliage that always faces the camera, you could try a sprite. Just don't give it an angle of any kind and it will always turn to face the camera. If you wanted to make it impassable you could try making a cube and making it completely transparent.
Last edited by Max_Prower; 03/13/0910:54.
Re: [HELP] Foliage that is parallel with the camera
[Re: Max_Prower]
#255910 03/13/0912:0103/13/0912:01
Oh well, I fixed my problem with a for loop that checks through the vertexes and adds leaves to them accordingly, and then assigning an action that makes it always be parallell with the camera
Here is the code for the people who maybe wants it
Code:
STRING* leaf_string = "leaf.bmp"; //The leaf file, can be a plane mdl with alpha aswell
ENTITY* mdl_with_vertexes_only;
action face_camera()
{
while(1)
{
my.pan = camera.pan;
my.tilt = camera.tilt;
wait(1);
}
}
function Add_leaf_to_vertex(ENTITY* ent)
{
var i;
for (i = ent_vertices(ent); i > 0; i--) // repeat until all vertices are checked
{
VECTOR v;
vec_for_vertex(v, ent, i);
ent_create(leaf_string,v,face_camera);
}
}
action tree() // Assign this to the mdl file that is supposed to have only vertexes
{
mdl_with_vertexes_only = me;
Add_leaf_to_vertex(me);
}
Re: [HELP] Foliage that is parallel with the camera
[Re: Enduriel]
#256408 03/16/0917:2103/16/0917:21