grass attach to camera

Started by phiex, February 19, 2010, 11:06:31 AM

Previous topic - Next topic

phiex

Hi

I'm trying to have our pictures as close to reality as possible.
Now, I want my grass population grows only for (lets say) 1000m around the camera. For distances above 1000m i want only green power fractal.
I hear you saying "use that damn distance shader"...
BUT I want this all mounted to camera somehow, so if i move camera, it moves a grass population too. Automatically.
I can do it for surface layers, but not for populations.

And please...keep it as simple as possible. Im a newbie  :)

Tangled-Universe

well...use that damn distance shader ;)

Seriously: attach your render camera to the camera input of a distance shader.
Set the near and far distance to 1000m. (If you want a small region of fade-out of the grasses then set the far distance to 900m for example)
Now you have made a mask for anything within 1000m from your camera.
You can now use this distance shader to restrict populations only to within 1000m from your camera.
Since the camera is moving in animation, the distance shader moves along.

But keep in mind that you'll need to make a population area which spans the entire camera-path.
This will use much RAM, so perhaps you should try to move your population-area as well.
If you keep the same seed of the population then you should not be able to notice that the actual population area is also moving.

If you want to use slope/height restrictions as well then do the following:
Create a surfacelayer, pure white color. Set the slope and height restrictions.
Use the distanceshader as blendshader.
Use this whole as density shader for your population.

Hope this helps.
Cheers,

Martin

RArcher

In terms of moving the population around, all you should need to do is animate the population centre position to match the animated camera position.  This should drag the population around the exact same path as your camera so you can get away with a smaller population area.

Seth

Quote from: Tangled-Universe on February 19, 2010, 11:17:52 AM

This will use much RAM, so perhaps you should try to move your population-area as well.
If you keep the same seed of the population then you should not be able to notice that the actual population area is also moving.



Are you sure ?

Tangled-Universe

Quote from: Seth on February 19, 2010, 11:31:41 AM
Quote from: Tangled-Universe on February 19, 2010, 11:17:52 AM

This will use much RAM, so perhaps you should try to move your population-area as well.
If you keep the same seed of the population then you should not be able to notice that the actual population area is also moving.



Are you sure ?

About what?

If you move your camera for 10km in your animation you'd have to use a 10km wide population area as well which firstly needs a lot of time for populating and secondly likely uses more ram.
Instead you could link the position of your populator to the rendercamera and move it along. This way a 1.5x1.5km will probably suffice.
The unchanged seed assures that there won't be differences in the grass shown between frames.

phiex

that is the point, Martin
But how i could move population-area? (I mean other way than manually)

Seth

yep i was just wondering if the "locked" seed allows the population to look the same on each frames ^^
oh and the only "bad" thing about this is that TG2 will need to calculate the population for each frame and that can add a lot of rendertime... ;)

Tangled-Universe

Quote from: phiex on February 19, 2010, 11:45:22 AM
that is the point, Martin
But how i could move population-area? (I mean other way than manually)

I don't understand? Do you want to animate this?
If not, then just do it manually I'd say.

Tangled-Universe

Quote from: Seth on February 19, 2010, 11:47:34 AM
yep i was just wondering if the "locked" seed allows the population to look the same on each frames ^^
oh and the only "bad" thing about this is that TG2 will need to calculate the population for each frame and that can add a lot of rendertime... ;)

I'm pretty sure if you do not change the seed that the instances will be placed the same in every frame.
And yes, you'd need to recalculate the population every frame, which adds time. Therefore I suggested to minimize the area and link it to your camera-position, in order to minimize instancing calculations.

Seth

i agree with that.
the added render time might be problematic but it still is better than out of ram errors :)

phiex

Quote from: Tangled-Universe on February 19, 2010, 11:48:05 AM
Quote from: phiex on February 19, 2010, 11:45:22 AM
that is the point, Martin
But how i could move population-area? (I mean other way than manually)

I don't understand? Do you want to animate this?
If not, then just do it manually I'd say.

okay, thanks  ;)
i thought (just for excercise) something like force node network to "get coordinates from the camera and past them to population-area center"

Matt

#11
Moving the population centre will cause your instances to move, so you don't want to do that.

Larger population areas will only use more RAM if more instances are created. Since you're restricting the instances using a distance shader that moves with the camera, you will limit the amount of RAM that's needed. Larger areas will take longer to calculate the population, because the density shader needs to be tested for the whole area even if the shader returns zero, but the distance shader is a very simple shader so it might not be significant.

You probably need to enable "repopulate on every frame".
Just because milk is white doesn't mean that clouds are made of milk.

Seth

Quote from: Matt on February 21, 2010, 06:16:57 AM
Moving the population centre will cause your instances to move, so you don't want to do that.



ok !
so even keeping the same seed it will change the population.
thanks for that explaination Matt.

Tangled-Universe

I find that rather awkward and unexpected that using the same seed and restrictions still causes different populated instances when moving the populator?

Kadri

Think of a paper with points on it. If you move the center of the paper (if you move the paper ) the points will move with it .
They are dependent .

Kadri.