- Home /
to Verlet or to Perlin ?
I am wondering how expensive it would be in comparison, to create an effect for a procedurally generated mesh.
It's a thruster for an engine, and I'm imagining 200 verts which are going to be 'animated' per frame.
Regarding Perlin, there's a nice effect I just discovered if i take a sample (Mathf.PerlinNoise(0,0) to (1,1)
(see picture here : http://answers.unity3d.com/questions/307988/is-this-reading-the-full-range-of-perlin-noise.html )
and then push that sample range as a fixed size up in perlin (time,time) to (time+1,time+1) , it creates a really nice curtain effect. This is just animating the vertices and doesn't take into consideration the changes in transform as the flame moves with the spacecraft.
Regarding Verlet, this is a concept I have just discovered, and just looking at a few search results I have alot to learn and understand before I can implement these 'sticks' that connect the vertices and pull them around relative to the parent gameObject. So, long time with lots to learn and accomplish.
There is a third option which is something I have already built, based on some excellent help from Aldo
(see question here : http://answers.unity3d.com/questions/290695/calculate-spline-points-on-complex-geometry-mesh.html
From this I have created a 'sock', with 2 animation curves, one being the shape of the curve, and one being the 'wave' that scrolls through the vertices. Depending on the vertex z position factored with time , imagine vert 1 starts at the start of the curve, reads right from 0-1 , then loops. This actually makes some nice pulse effects and smooth sine wave actually gives an eerie 'breathing' effect!
So to summarize and place a solid (couple!) of questions down, and imagine all this is applied in iOS development :
1/ How expensive would each case be to do in comparison to each other computationally?
2/ How expensive is it to animate verts in this fashion every frame? Should I consider an InvokeRepeating (hi Fattie) as this is a small effect and I could 'tinker' with the timing so it doesn't have a noticeable stutter.
3/ With what I have made (Iris Sock), and what I am capable of currently (perlin), and have no clue on implementation yet (verlet), what would be my quick and quite painless 'go with that' answer . Should I just use a 'Sprite Combo'? Yes I think the sock is cool and it is complete however it doesn't factor change in parent transform, but for something like verlet, which could be great once I have that 'aah' moment when I can actually imagine and see that 'stick' pulling along vert B while from a fixed Vert A as child to moving object. Wow.
Edit : to help clarify the effect I am after : for the 'flame' or 'cloth' material to be affected by the movement of the parent gameObject movement through world space. For example attached to a spaceship doing alot of quick turning and fast acceleration. Like a flame being blown by wind from different directions. My sock is static along the Z-axis.
Here is a picture of my Iris Sock :
// Tris / Verts
// 200 / 100 => Pent
// 400 / 200 => Deca
Of course, if anyone has a helpful link regarding verlet in any form, that would also be very cool. Google has some very nice equations yes (http://lonesock.net/article/verlet.html) but if you think 'yes I have a bookmark that could help' I as ever am very grateful. Thankyou everybody =]
Does anyone have some information on
1 - Verlet and cloth implementation, and
2 - effects of modifying 600 verts on a mesh every update?
Yes, bumped it once more!
Answer by jaskij · Sep 07, 2012 at 10:07 AM
Ok, looking at those things, and doing some research of my own, I dare say that iris folding would be the fastest, then Verlet (if you know derivateves and such, look at en.Wiki, it becomes quite easy then) and lastly Perlin noise (I recommend simplex noise, whihc IS a bit faster).
If you want to stick with Perlin/Simplex, try looking at this paper.
edit
After giving it some thoughts, I might've been wrong between on the Verlet-Perlin part, but that depends too much on the implementation and whether you calculate Verlet on a per-vertex basis. (Doesn't look like it requires that, but might be wrong there).
Thankyou for the paper, it is very interesting (I just passed it to a fellow programmer for the multi-dimensional use). You make a good point as I don't really state my intention. I wish the 'flame' or my 'cloth' material to be affected by the movement of its' parent gameObject movements through world space. For example attached to a spaceship doing alot of quick turning and fast acceleration. Like a flame being blown by wind from different directions. $$anonymous$$y sock is static along the Z-axis.
I have also been thinking of calculating the projected point Z (the tip of a straight sock) directly behind the spaceship, then when this point changes in world space, lerping the calculation of the X-Y vert position based on the lerp between current point Z and point Z directly behind the craft. Did that make sense?
The perlin description was to imply I can animate the verts around the sock by just cycling through a small sample of perlin like reading an animation curve or a heightmap, which with different values does make some nice curtain-flapping effects more dynamic than my socks' wave ripple along the surface. Thankyou again for the Simplex information.
Hi there, I bumped this question several times, and you were the only one with a comment, and some excellent information, so you get the tick. Thank you again.
Your answer
![](https://koobas.hobune.stream/wayback/20220613080721im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Null Reference Exception Assigning Vertices to Mesh 0 Answers
Why vertex positions appear (0.0, 0.0, 0.0) ? 1 Answer
Voxel mesh generation not working. 1 Answer
Best Way to Link Vertices into Mesh 0 Answers
Grouping vertices? 1 Answer