4 registered members (ozgur, Ayumi, VHX, monarch),
1,161
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Realistic tree/grass weaving shader
[Re: IDontLikeSoccer]
#480215
05/26/20 20:19
05/26/20 20:19
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Hey! I'm afraid it's the only vegetation shader out there (as far as I know)... Maybe tweaking it might help? Other than that, I remember in AUM (can't remember the number) there was an example of how to animate bushes and grass via bones. It's not the fastest solution (since bones + their rotation for lots of grass can be slow), but it might be useful too. Greets! Edit: I was able to find the grass from AUM, take a look here: AUM 76 -> Hot at the forum -> Plant effect by Mocosgames
Last edited by 3run; 05/26/20 20:41.
|
|
|
Re: Realistic tree/grass weaving shader
[Re: IDontLikeSoccer]
#480234
05/27/20 11:25
05/27/20 11:25
|
Joined: Aug 2004
Posts: 87
IDontLikeSoccer
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2004
Posts: 87
|
Yes for tress maybe we need use separate model of tree and leaves. The only problem too many grass with while loop function killing fps in game . It is not clear to me how the people who made the game above solved that problem.
|
|
|
Re: Realistic tree/grass weaving shader
[Re: IDontLikeSoccer]
#480235
05/27/20 11:34
05/27/20 11:34
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
The only problem too many grass with while loop function killing fps in game You mean while loop for each grass? It can be solved easily, just use ENABLE_FRAME and event with EVENT_FRAME.
void grass_event_function()
{
if(event_type == EVENT_FRAME)
{
my->skill41 = floatv(wind_x + my->skill1);
my->skill41 = my->skill41 - 0.1 * sinv(16 * total_ticks);
my->skill42 = floatv(wind_y + my->skill2);
my->skill42 = my->skill42 - 0.1 * sinv(16 * total_ticks);
my->skill43 = floatv(wind_force);
my->skill43 = my->skill43 - 0.1 * sinv(16 * total_ticks);
my->skill44 = floatv(wind_amplitude);
my->skill44 = my->skill44 - 0.1 * sinv(16 * total_ticks);
}
}
action fx_animTree()
{
set(my, PASSABLE);
my->material = mtl_animTree;
// randomness for each grass
my->skill1 = 1 + random(2);
my->skill2 = 1 + random(2);
my->emask |= ENABLE_FRAME;
my->event = grass_event_function;
}
As for the trees, yes. It needs some solutions. Maybe we could find some shaders from unity or other engines and try to convert them. Edit: f.e. this one [Shader - Open Source] Polygon Wind - for Low Poly Tree Assets
Edit2: I tried to convert it, but failed... due to not being able to get vertex color (without that it looks like default animTree.fx), I tried float4 inColor : COLOR0, but that didn't work.
Last edited by 3run; 05/27/20 12:48.
|
|
|
|