PDA

View Full Version : Instance distribution using normals



Boris Goreta
02-08-2016, 10:43 PM
Hello, I have instances distributed one over every polygon on the mesh. I am using normal as an option to rotate instances and it all works good until the mesh is deformed. This normal rotation algorithm is using up vector to calculate orientation and when the mesh is deformed the polygons that are pointing up or close to up have strange instance orientations.

Is there a way to rotate instances similar to this algorithm but using nodes so I would get better control over instance orientation or how do I overcome this problem with built in algorithm. The solution would be to look for this up vector from the base undeformed mesh (default state) but it doesn't.

raw-m
02-09-2016, 03:02 AM
Can't help, I'm afraid but I recently ran into this problem so would be interested to hear. The only solution I found was to bake out Instances and use a Scene to Modeler 3rd party script to get them into Modeler and then cut/paste them into the original model.

Kaptive
02-09-2016, 04:17 AM
Any chance of an image to see what is going wrong? I'm just playing with a test scene to see if I can recreate what you are talking about, but everything seems to work as expected on this end using normal rotation. So I'm not sure what is causing you trouble. A picture would really help in working out what you are trying to achieve (or what is going wrong). Cheers.

Boris Goreta
02-09-2016, 06:08 AM
Here is the scene. Let's say it is a chicken head with instanced feathers. I like how it looks on frame 0. But then when I animate this character its mesh of course gets deformed. To see the problem I have applied an MDD file to this mesh which rotates the head forward. As you can see feathers are not keeping the original orientation anymore because they use the up vector to calculate instance positions. How can I have this work with MDD animation ?

This would work if you would just rotate the entire object, but I need it to work with deformable meshes.


132326

raw-m
02-09-2016, 06:10 AM
This is my example - see how the leaves change orientation as the base object deforms?

132327

Boris Goreta
02-09-2016, 06:14 AM
Yes I see you have the same problem , did you try edge aligned ? With edge aligned orientation stays constant with deformation but I don't like how it orients the instances, it is a bit random.

Kaptive
02-09-2016, 08:40 AM
Ah right, I see. Hmmm, tricky. Not sure on this one. I'll have a go, but I'm not sure there is a solution to this. Though instances can be used on a moving deformation, I'm not sure they are designed to as it stands.
I've had a play to try and recreate the basic function of align to normal using nodes, but not having much success. Maybe someone with a deeper understanding of the node functions has an idea? I do see what you mean though, it is a bit of a frustrating problem, but at the same time, I can also see why it does it... it just doesn't really help you right now.

I think this is where the new fiberfx (in LW 2016/next) will be helpful. Not helpful right now though.

raw-m
02-09-2016, 08:54 AM
Thanks for looking, Kaptive. Tried all the alignment options, Boris, but Normals initially gave me the placements I was after. As mentioned, baking them out was my only option.

The "Next" FFX system looks hopeful (assuming its quick and doesn't crash as often as current versions :D).

Boris Goreta
02-09-2016, 09:05 AM
Where do I get info on the next FFX 2016 ? I don't know anything about it.

Oh I found about the new rendering features for FiberFX but I suppose fiber placement engine will stay the same.

FiberFX takes a lot of time just to position fibers over a mesh if you want dense fur, this could be improved.

raw-m
02-09-2016, 09:08 AM
Take a peak...
https://blog.lightwave3d.com/2015/11/fiberfx/

lertola2
02-09-2016, 10:43 AM
You could instance little triangles with one short edge onto your object. Then bring them into modeler via the Python Bake Instance script and FBX export. Then you have a new object with little triangles at the base of where you want each instance to be. You can put your instances onto the triangles with the edge alignment option and they should maintain their orientation when this object is deformed then I think.

Boris Goreta
02-09-2016, 10:53 AM
Well that's a clever idea, thanks for sharing I will definitely try this.

raw-m
02-09-2016, 11:01 AM
Nice, thanks!

spherical
02-09-2016, 04:52 PM
Yes, the high aspect triangle solution worked for someone who was populating seats in a stadium and the seat instance orientation was originally chaotic.