Problem with While node

27 views
Skip to first unread message

Mathieu Dufresne

unread,
Dec 19, 2011, 1:52:32 PM12/19/11
to soft...@listproc.autodesk.com

Hello list!

 

This might be a bit lengthy but only because I really did my homework here so please bare with me!! J

 

I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?

 

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

 

I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.

 

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

 

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.

 

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

 

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

 

With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

 

So that’s it!

 

...

 

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

 

Please? J

 

 

Mathieu_Dufresne

 

WhileProblem.rar

Stephen Blair

unread,
Dec 19, 2011, 2:40:17 PM12/19/11
to soft...@listproc.autodesk.com
Hi

I don't think it is a problem with the While node.
I've seen this kind of thing before, in various contexts.

It's an evaluation thing, possibly one of those "beware of ICE optimization" things...

http://www.screencast.com/t/irfPlPo7lWA

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: December-19-11 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

Hello list!

This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)

I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

I've been playing with the while node for a few days and found myself hitting a wall more often than not.

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

So that's it!

...

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

Please? :)


[Mathieu_Dufresne]

image001.gif

Mathieu Dufresne

unread,
Dec 19, 2011, 3:41:15 PM12/19/11
to soft...@listproc.autodesk.com

Thanks for making it clear Stephen!

 

MatDuf

 

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Stephen Blair
Sent: 19 décembre 2011 14:40
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node

 

Hi

 

I don’t think it is a problem with the While node.

I’ve seen this kind of thing before, in various contexts.

 

It’s an evaluation thing, possibly one of those “beware of ICE optimization” things…

 

http://www.screencast.com/t/irfPlPo7lWA

 

 

 

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: December-19-11 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

 

Hello list!

 

This might be a bit lengthy but only because I really did my homework here so please bare with me!! J

 

I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?

 

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

 

I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.

 

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

 

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.

 

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

 

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

 

With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

 

So that’s it!

 

...

 

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

 

Please? J

 

 

Mathieu_Dufresne

 

Guillaume Laforge

unread,
Dec 19, 2011, 10:08:37 PM12/19/11
to soft...@listproc.autodesk.com
Hi Mathieu,

It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But ... you should not use the While node like this :).
Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).

For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).
The attribute "self.Cond" is evaluated after the While node is executed...

But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don't plug the while node in the Delay Set Data or you will get the same problem).

Here is the ASCII graph :

Set Data("self.Cond") > Delay Set Data > ICETree input port 1

While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2

An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.
In fact (and it the second part of the explanation), the While node is useful only if you set the condition ... while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).

I hope it will help you in your "ICE Ray Marcher" !

Cheers,

Guillaume Laforge


From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

Hello list!

This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)

I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

I've been playing with the while node for a few days and found myself hitting a wall more often than not.

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

So that's it!

...

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

Please? :)


[Mathieu_Dufresne]

image001.gif

Raffaele Fragapane

unread,
Dec 19, 2011, 11:28:23 PM12/19/11
to soft...@listproc.autodesk.com
On a loosely related note, what are you trying to do?
What you mention (I haven't seen the scene) sounds like the classic problem of wrapping to multiple intersecting meshes, either to build isosurface helpers (or maybe even an isosurface builder with ICE topo), or other things like muscle like skin push/volume wrapping.

If that's the case, you might have better luck doing something similar to raymarching and forcing input rules instead of trying to always raycast through different layers to the furthest.

Just sample along a direction at a reasonable interval, and test for point in volume at all intervals against as many volumes as needed, and then only at the first negative go back one interval to the last positive and trace out to the surface.
If you offer a bubble free set of meshes this is a good deal more reliable in ICE than testing for the furthest intersection, and amounts to more or less the same number of operations in most cases.

If you're trying to do something else, ignore this :)

Mathieu Dufresne

unread,
Dec 20, 2011, 11:02:29 AM12/20/11
to soft...@listproc.autodesk.com

Hi Guillaume! Thanks a lot for your input!

 

First off, I only used the while node that way to make it clear that something was wrong. In my original scene, the condition could be changed to false if the raycast node hit a surface meeting certain requirements.

 

So just to make it clear, you’re saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?

 

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Guillaume Laforge
Sent: 19 décembre 2011 22:09
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node

 

Hi Mathieu,

 

It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But … you should not use the While node like this J.

Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).

 

For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).

The attribute “self.Cond“ is  evaluated after the While node is executed…

 

But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don’t plug the while node in the Delay Set Data or you will get the same problem).

 

Here is the ASCII graph :

 

Set Data(“self.Cond”) > Delay Set Data > ICETree input port 1  

                                                                           

While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2

 

An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.

In fact (and it the second part of the explanation), the While node is useful only if you set the condition … while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).

 

I hope it will help you in your “ICE Ray Marcher” !

 

Cheers,

 

Guillaume Laforge

 

 

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

 

Hello list!

 

This might be a bit lengthy but only because I really did my homework here so please bare with me!! J

 

I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?

 

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

 

I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.

 

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

 

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.

 

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

 

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

 

With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

 

So that’s it!

 

...

 

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

 

Please? J

 

 

Mathieu_Dufresne

 

Stephen Blair

unread,
Dec 20, 2011, 11:14:24 AM12/20/11
to soft...@listproc.autodesk.com
Hi

Setting self.Cond in the loop does make your While loop work.
http://xsisupport.files.wordpress.com/2011/12/while_setconditioninloop.png


Personally, I think you were using it properly.
That Max Repeat port makes it pretty natural to want to do a "while(true) loop" eg

while True:
do_something()
if condition: break

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: December-20-11 11:02 AM
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node

Hi Guillaume! Thanks a lot for your input!

First off, I only used the while node that way to make it clear that something was wrong. In my original scene, the condition could be changed to false if the raycast node hit a surface meeting certain requirements.

So just to make it clear, you're saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Guillaume Laforge
Sent: 19 décembre 2011 22:09
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node

Hi Mathieu,

It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But ... you should not use the While node like this :).


Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).

For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).

The attribute "self.Cond" is evaluated after the While node is executed...

But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don't plug the while node in the Delay Set Data or you will get the same problem).

Here is the ASCII graph :

Set Data("self.Cond") > Delay Set Data > ICETree input port 1

While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2

An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.

In fact (and it the second part of the explanation), the While node is useful only if you set the condition ... while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).

I hope it will help you in your "ICE Ray Marcher" !

Cheers,

Guillaume Laforge


From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

Hello list!

This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)

I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

I've been playing with the while node for a few days and found myself hitting a wall more often than not.

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

So that's it!

...

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

Please? :)


[Mathieu_Dufresne]

image001.gif

Mathieu Dufresne

unread,
Dec 20, 2011, 11:39:47 AM12/20/11
to soft...@listproc.autodesk.com

Hi Raffaele!

 

I’m surprised that you figured out so quickly what I was doing! J Indeed, I am looking into sliding skin solutions.

 

I don’t know what is involved in a point in volume calculation but I always thought it to be a rather heavy calculation. But judging from your mail, I guess a single point in volume is not as heavy as a single raycast? Otherwise, what’s the main reason for suggesting this instead of raymarching?

 

And if I want to do this on a human face, I guess this would be considered a bubble mesh, right? If so, would you say that the point in volume technique becomes irrelevant or that it still works but you only need to handle exceptions for when you are in a negative volume but still “inside” the mesh (like in the mouth for instance)?

 

Thanks!

 

MatDuf

Guillaume Laforge

unread,
Dec 20, 2011, 3:06:20 PM12/20/11
to soft...@listproc.autodesk.com
Hi Mathieu,

Just use the Delay Set Data and everything will work as expected !

> So just to make it clear, you're saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?

No, you can create the attribute before the While but a While is by definition useful only if you set the condition in it. If you set the condition to True before and only before the While, then you will just repeat
until your max parameter (and so a repeat node will do the job) . If the condition is set to False, then nothing will be evaluated, again, no need for a While.

The While is nice when you need to exit from a loop but don't know exactly when you will exit (depending on the result of your condition tested on every loop).

Make sense ?

Cheers

Guillaume

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Tuesday, December 20, 2011 11:02 AM
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node

Hi Guillaume! Thanks a lot for your input!

First off, I only used the while node that way to make it clear that something was wrong. In my original scene, the condition could be changed to false if the raycast node hit a surface meeting certain requirements.

So just to make it clear, you're saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Guillaume Laforge
Sent: 19 décembre 2011 22:09
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node

Hi Mathieu,

It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But ... you should not use the While node like this :).


Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).

For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).

The attribute "self.Cond" is evaluated after the While node is executed...

But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don't plug the while node in the Delay Set Data or you will get the same problem).

Here is the ASCII graph :

Set Data("self.Cond") > Delay Set Data > ICETree input port 1

While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2

An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.

In fact (and it the second part of the explanation), the While node is useful only if you set the condition ... while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).

I hope it will help you in your "ICE Ray Marcher" !

Cheers,

Guillaume Laforge


From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

Hello list!

This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)

I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

I've been playing with the while node for a few days and found myself hitting a wall more often than not.

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

So that's it!

...

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

Please? :)


[Mathieu_Dufresne]

image001.gif

Guillaume Laforge

unread,
Dec 20, 2011, 4:06:58 PM12/20/11
to soft...@listproc.autodesk.com
I just saw that Stephen made a nice review around the problem : http://xsisupport.wordpress.com/2011/12/20/the-case-of-the-while-loop-that-didnt-evaluate/

In case someone didn't see it yet.

Mathieu Dufresne

unread,
Dec 20, 2011, 4:36:58 PM12/20/11
to soft...@listproc.autodesk.com

Yes definitely!

Thanks guys!

It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But … you should not use the While node like this J.

Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).

 

For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).

The attribute “self.Cond“ is  evaluated after the While node is executed…

 

But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don’t plug the while node in the Delay Set Data or you will get the same problem).

 

Here is the ASCII graph :

 

Set Data(“self.Cond”) > Delay Set Data > ICETree input port 1  

                                                                           

While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2

 

An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.

In fact (and it the second part of the explanation), the While node is useful only if you set the condition … while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).

 

I hope it will help you in your “ICE Ray Marcher” !

 

Cheers,

 

Guillaume Laforge

 

 

From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node

 

Hello list!

 

This might be a bit lengthy but only because I really did my homework here so please bare with me!! J

 

I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?

 

What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...

 

I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.

 

In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.

 

To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.

 

I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.

 

Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).

 

With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.

 

So that’s it!

 

...

 

In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???

 

Please? J

 

 

Mathieu_Dufresne

 

Raffaele Fragapane

unread,
Dec 20, 2011, 7:19:32 PM12/20/11
to soft...@listproc.autodesk.com
Well, we've done a fair bit of that here recently (so I kinda have to toe the line on what I say at present time), and I did a fair bit of it myself before that started from similar premises, and continue to toy around with the techniques at home on and off.

You are taking the path of least resistence, from an implementation footprint point of view, and I can tell you it can be made to work quite nicely, so persist :)
From my personal experience, and not the one matured on the current show:

Point in volume isn't terribly expensive. From any given point inside a mesh you can cast a ray in a random direction, and count the intersections. An odd number means you are inside the mesh, an even number means you're outside. You have to account for fringe cases and glancing hits, but on surfaces like muscles, bones and so on, if your base muscle suit is well made, they are all extremely rare, and absolutely non existent if you direct, or at least bias, the raytracing. That means in more cases than not, when dealing with muscle shapes, point in volume costs you exactly one intersection :)
Raymarching will inevitably almost always be more expensive than raytracing through a limited number of objects, requires tweaking of the marching interval, but it ends up requiring less and simpler input rules. It evens out in the end.

IE: Run a spline inside limbs, run a weightmap along the interested region tho tell each vertex what U to shoot for in the spline, and raytrace in that direction. That will always guarantee clean and controllable hits, and allows for some really nice tricks to deal with crawling (or fighting it) and tricky areas like roll in the arm with bicep and forearm collapsed.

Bear in mind that even with extreme care in what you're doing, high frequency in the meshes (wrinkles, bumps and so on) will send the cow udders up, so you will need a simpler intermediate layer for the technique to work well, and a binding of that layer to the final mesh.
Of course the meshes need to be manifold, watertight, and topologically well configured. A non watertight mesh will bite you in the ass majorly with false positives and odd glancing hits.

The temptation to run everything through the muscle system is great. It never really works :) Make sure you can blend across both skinning and shapes and muscle systems. Doing stuff like eyes and mouths and other similar shapes, or objects with a thickness (eyelids) and trying to turn around tight corners with a muscle system is like oral surgery with a chainsaw.

You will also, of course, need to take care of de-intersecting the resulting mesh after the projection, even if you go for a relatively sparse and non uniform density. A denser mesh with a cloth sim or a smoothing in barycentric space (ala stretchMesh) and then a reprojection will normally take care of that. Iterate as needed.
As counterintuitive as it may sound, sparse seldom gives good results, as it will be near impossibe to equalize well after projection.
Reply all
Reply to author
Forward
0 new messages