x


Fur, Hair, and Alternative Grass

Hey there,

I've spent hours trying to find a way of creating a sphere planet object with terrain on it, such as grass thats effected but local wind, I found thats it not really possible to use unity's terrain tools on anything other than a plane.

What I'm trying to do Is find some sort of Fur shader, like Cinema4Ds shader, and use it to create grass on a sphere, What would be the best way to go around doing this??

thanks

more ▼

asked Jan 04, 2010 at 11:59 AM

Caius gravatar image

Caius
21 3 2 4

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

We used the techniques found in GPU Gems Chapter 7 for rendering and animating grass in The SOL Game.

The basic idea is to do the actual grass animation on the GPU. In SOL the grass is distributed into clusters consisting of five transparent planes each. These clusters was manually positioned by the level designer. The planes was rendered using a custom shader that translates top vertices according to two sinusoids. The Cg code below shows how we did the animation in the vertex program.

v2f vert (appbase v) 
{
    float wind = _WaveAmplitude1 * sin(_WaveFrequency1 * 2 * 3.14 * _Time.y + v.vertex.x) + 
                 _WaveAmplitude2 * cos(_WaveFrequency2 * 2 * 3.14 * _Time.y + v.vertex.y);

    float split_v = 0.9; 
    v.vertex = v.vertex + wind * v.texcoord.y * _WaveDirection * (v.texcoord.y > split_v);  		

    v2f o;
    PositionFog( v.vertex, o.pos, o.fog );
    o.uv = v.texcoord;
    o.lightDir = ObjSpaceLightDir( v.vertex );
    o.normal = v.normal;

    return o;

}

Notice that we use texture v-coordinates to tell top vertices from bottom vertices.

more ▼

answered Jan 06, 2010 at 06:47 PM

Peter Bruun-Rasmussen gravatar image

Peter Bruun-Rasmussen
83 1 2 6

Unrelated to the question, I know, but... damn, that looked good. I hadn't seen SOL before, and I'm glad I found it through this question. I keep seeing interesting small games coming out of DADIU.

Jan 09, 2010 at 09:24 PM Ricardo
(comments are locked)
10|3000 characters needed characters left

There's a community created fur shader on the forums.

more ▼

answered Jan 04, 2010 at 01:37 PM

AngryAnt gravatar image

AngryAnt ♦♦
4.5k 20 22 58

that's over 3 years old - is it compatible with unity3?

Nov 25, 2010 at 11:58 AM ic
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2848
x159
x26

asked: Jan 04, 2010 at 11:59 AM

Seen: 10502 times

Last Updated: Jan 09, 2010 at 09:18 PM