Planetside Software Forums

General => Terragen Animation => Topic started by: Hannes on October 17, 2014, 12:22:12 pm

Title: Trees - Mesh displacer
Post by: Hannes on October 17, 2014, 12:22:12 pm
Just a little test for animating a population of plants. Of course the trunks are wobbling as well, but from a distance it works.
Title: Re: Trees - Mesh displacer
Post by: archonforest on October 17, 2014, 01:09:10 pm
I love it!
Title: Re: Trees - Mesh displacer
Post by: Kadri on October 17, 2014, 02:41:04 pm

Looks good.
Title: Re: Trees - Mesh displacer
Post by: N810 on October 17, 2014, 03:27:07 pm
Looks amazing.  8)
Title: Re: Trees - Mesh displacer
Post by: bigben on October 18, 2014, 02:55:30 am
Applied to a tree where the model is split up by the branching level and it could be really useful.
Title: Re: Trees - Mesh displacer
Post by: Dune on October 18, 2014, 04:05:09 am
Good action, Hannes! So this is not by transform shader or 4D noise, but mesh displaced... mmm.  I had the idea that it would only breakup the vertices, and not move branches. This might even be a better option for distance than a heavy mdd file.
Title: Re: Trees - Mesh displacer
Post by: Hannes on October 18, 2014, 07:51:53 am
Thanks guys. Yes, from a distance it's absolutely OK. You have to do some tests to get the correct settings of the power fractal, but, as you said, Ulco, it's probably easier than having to use a vast motion file. And there is of course a transform shader to move the PF.
One more thing: the trees have all the same motion of course, but since the instances are all rotated differently and the motion is rather subtle, it's not too obvious.

Title: Re: Trees - Mesh displacer
Post by: Dune on October 18, 2014, 10:46:07 am
So if you don't rotate them too much, say 10º, you can make a bunch of synchro dancing trees  ;D
Title: Re: Trees - Mesh displacer
Post by: zaxxon on October 19, 2014, 11:25:27 am
Thank you Hannes for your work on this technique. I certainly think it would work applied to populations of underbrush and tall grasses, areas where large motion files wouldn't work at any rate. Question: how hard would it be to vary the motion to simulate wind gusts?
Title: Re: Trees - Mesh displacer
Post by: Hannes on October 19, 2014, 11:39:30 am
The problem is that it's the same motion for each instance of one population. To get more variety you can of course mix a few populations with different mesh displacers. It works for a subtle breeze, but at the moment I have no idea how to achieve wind gusts.
Title: Re: Trees - Mesh displacer
Post by: Oshyan on October 19, 2014, 05:58:26 pm
It does only move the vertices, but depending on the scale of the displacement, adjacent vertices may move similarly enough over small area to appear to move together, yet create a larger overall movement across the whole model (think of a noise as displacement with scale of a couple of meters, and not very small Smallest Scale).

- Oshyan
Title: Re: Trees - Mesh displacer
Post by: Dune on October 20, 2014, 02:35:12 am
QuoteThe problem is that it's the same motion for each instance of one population.
Perhaps it is possible to feed a series of masked displacement into the mesh displacer, so make your pf's, but mask them by larger terrain areas through a transform shader set at world scale, then feed that into the mesh displacer. Theoretically (just thinking aloud) you should be able to get different movements in different parts of your pop.
Title: Re: Trees - Mesh displacer
Post by: Oshyan on October 20, 2014, 06:35:30 pm
I'm not sure that's true Ulco because if I understand correctly the mesh displacement is being applied on the *source* model for the population, and it is then instanced after that... Although you're right that color variation can work in world space, so maybe it is possible...

- Oshyan
Title: Re: Trees - Mesh displacer
Post by: Dune on October 21, 2014, 03:33:45 am
That was my line of thinking, and yesterday I did a small experiment, but too short to see what's going on; using a vdisp shader (X displace) setup with minimum height and an X moving PF (for gusts of wind movement), taken through transform shader. I have to try again, as that opens good posibilities. If it doesn't work, maybe it can be made to work (Matt?), like the pop coloring.
Title: Re: Trees - Mesh displacer
Post by: Dune on October 21, 2014, 11:06:55 am
It doesn't work  >:(
Title: Re: Trees - Mesh displacer
Post by: zaxxon on October 21, 2014, 01:07:14 pm
Sigh... that would've been nice.  Still, at some point we may have alembic support and while that means creating motions outside of TG, it would provide a means to render wind movement. It continues to amaze me that buried within this app are the potential controls to duplicate so many natural events and that we're even able to discuss such possibilities. Remarkable!
Title: Re: Trees - Mesh displacer
Post by: TheBadger on October 21, 2014, 03:37:21 pm
^^Like a princess in a chastity belt. :P
Title: Re: Trees - Mesh displacer
Post by: Matt on October 24, 2014, 03:06:43 am
Quote from: Dune on October 21, 2014, 03:33:45 am
That was my line of thinking, and yesterday I did a small experiment, but too short to see what's going on; using a vdisp shader (X displace) setup with minimum height and an X moving PF (for gusts of wind movement), taken through transform shader. I have to try again, as that opens good posibilities. If it doesn't work, maybe it can be made to work (Matt?), like the pop coloring.


What you're asking for requires either displacement on ray traced objects (in fact, *huge* displacements compared to the size of the polygons, which would bring any ray tracer to a crawl), or render-time vertex deformation on each instance. The latter means we are no longer doing instancing, because each object has a different form. The deformed object has to be stored in RAM somewhere for ray tracing. So either you completely lose the RAM-use efficiency of instancing, or we need a clever cache that generates deformed instances when rays hit them, and clears them out of RAM when they are no longer needed. It would also be incredibly slow if every single vertex in every instance needed to be deformed. To avoid this, we'd need to introduce an LoD scheme for plants that have high vertex density per pixel. Making that work efficiently is a major R&D project, but I would like to attempt this.

Matt
Title: Re: Trees - Mesh displacer
Post by: Dune on October 24, 2014, 04:53:08 am
Thanks for clarifying, Matt! Too bad it's not that easy. The best thing that would work now is mesh displace several pops of the same object spaced for a natural wind effect (with a time lag between the movement of instances in each pop), and if directional movement is required a max rotation of say 100º of the instances.