PDA

View Full Version : I'm creating a forest. How do I make lots of sprites stick to an uneven surface?


torebjerkan
10-10-2007, 10:25 AM
I'm trying to create a forest on a quite dramatically sculpted polygon surface(terrain). I using particles with emit from surface. For placement I've used Texture Emission attributes and activated Texture rate and emit from dark. I want of course the tree-trunk pictured on the sprite to stay firmly planted on the ground. I dont want the tree-trunk to go below the terrain and I dont want it to hover over the ground. I've tried to find the correct values using the min-max distance setting them to the same values. This approach would probably work if I had a flat surface or just one tree, but as we all know one tree does not a forest make. At the moment some of the sprites are hovering over the ground while some still grow from the proper point on surface. This is due to the parameters I've put in the Min/Max distance. Why can't all sprites stay the same distance from the surface when the Min/Max distance values are equal? Shouldn't they be? All I want is to have all my trees firmly rooted on the ground. That means preventing tree-trunks from going below the surface and preventing them from floating above the surface. Any suggestions how to sovle this? I'm getting the feeling they didn't have trees in mind when they implemented particle sprites into Maya. Conserve is of course set to zero so my trees dont go flying off.

Edited post:

I was thinking about one solution was to create an invisible emitter surface independent of the one I am going to render. That way I could manually adjust the height of the emittet sprites after I hav e saved their initial state. Is this a common way to tackle these kind of problems?

This is sort of step one. I have to get the above nailed down first.

Next I will have to think about trees of different sizes, meaning differently scaled sprites.
What about different kinds of sprites, meaing tackling a forest of different sort of trees.

NORMAL SPEED does influence from where my trees are grown. My god, this is good to know. Appearently setting just conserve to zero isn't enough.

mandark1011
10-10-2007, 05:40 PM
why not instance planes with an image on them then you can put your pivot at the bottom of the plane this should anchor all the planes to the ground plane but allow for differences in size and scale with expressions.

after reading your post more i would say that the emission surface should be a goal too. you can still use your texture rate to emit but write this expression in creation.
(sorry first in particle shape add the attributes goalU and goalV)
then in creation write this

goalU = parentU;
goalV = parentV;

this will tell your particles to stick to where they were born on the surface.

good luck

Aikiman
10-10-2007, 07:06 PM
Goal your particles first like Mandark suggested then add the goalOffset attribute. Multiply your spritescale in Y by half and apply the result to your offset, this will lift your sprites to sit on any surface as long as its goaled there. Also if you happen to use a random expression on the scale, this will account for that too. goalOffset needs a vector return so make x and z zero and Y your result from above.


Otherwise using instanced boards are a winner cause you can then also have raytraced shadows whereas sprites you cant.

torebjerkan
10-11-2007, 06:44 PM
Thanks. I'll try that. And I even get shadows! cool.

torebjerkan
10-12-2007, 10:18 AM
I need my trees to keep a certain distance from eachother, not clump into eachother. Should I make each tree a source of field using radial field to push them away from eachother and wait it out. Sounds rather tricky. There must be some script shortcut to this.

And perhaps more importantly, can I get a custom rotation on the instanced particles so that they always will be facing the camera. Perhaps rotating around just the Y-axis would be better.
I could try a constraint, although I'm not sure how happy the instancer will be about this. Best thing would probably be to type an custom expression and map it to one of the rotation options found under the instancer tab on the particleshape node.

Give me an opinion.

torebjerkan
10-12-2007, 11:35 AM
I orientconstrained the Y axis to the camera and changed the order of rotation so Y is calulated last. Two problems remain:

1. Getting the trees from not cluttering in the same spot.

2. Keeping trees from not interpreting their depth incorrectly. I was under the impression that the depth sort attribute should fix this. May be things are a bit different once particles get instanced. See attached file.

mandark1011
10-12-2007, 06:19 PM
as far as the trees clumping issue you could try killing individual particles based on particle ID, or the radial field idea, however i think with the kind of detail your going to get from instanced planes they wouldnt hold up near camera anyways so alittle interpenetration shouldnt matter too much.

the depth sorting issue to me may just be your video card in opengl this should render with proper sorting considering it is actual instances of geometry. i may be wrong but try rendering the frame to see if the sorting is fixed.

CGTalk Moderation
10-12-2007, 06:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.