Location To Weight map

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Location To Weight map

Post by Pancho » 24 Feb 2012, 23:11

I'm running against a wall here. Should be simple, but I can't solve it. Looked into all different resources (proximity compound, Pooby's raycast vimeo movies, etc.). I simply fail to alter my weight map with the location/positions found by my ICE tree.

Till the get closest point node everything works smoothly. Get raycast properties is a custom node with determines a position and the direction. The first point position finds the hit locations, the get closest points finds the vertices closest to these points.

But now I fail to convert this position into a value on my weight map. While the blue show values only shows the positions of the correct hits of the ray cast nodes, the found show values outputs a true boolean for each point of the mesh. So I can't use it to filter a set weight execution (which I also can't connect to the if node anyways without turning everything into red).

So, how do I set the weights via the location???

Cheers
Thomas
You do not have the required permissions to view the files attached to this post.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 24 Feb 2012, 23:12

P.S.: I only used the closest location as it outputs a boolean. Actually the positions of the cloeset points are already correct.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Location To Weight map

Post by EricTRocks » 24 Feb 2012, 23:23

More info is probably needed here. You're raycasting from one mesh to another and getting the location. What information on the mesh you are raycasting to do you want to use to drive the weight map? Or is it whether the ray hits the mesh or not?
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

grahamef
Posts: 281
Joined: 23 Jun 2009, 19:01

Re: Location To Weight map

Post by grahamef » 24 Feb 2012, 23:34

Get Closest Points will return an array, even if it's an array with just one item. So, you'll need to select item 0 in that array before you can set a single value like a map weight.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Location To Weight map

Post by EricTRocks » 24 Feb 2012, 23:38

looked at your tree again and noticed you were raycasting onto the same mesh. See attached image. You have to add a bit to the position (See A. in the image) from which you are raycasting otherwise it finds the same point its raycasting from (thanks Stephen Blair for that tip a while back).
You do not have the required permissions to view the files attached to this post.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 24 Feb 2012, 23:39

I'm casting from a location to a mesh. The location on the mesh which are in close distance to the hit locations are supposed to have a weight value of 1, those vertices which don't a a point in close location should be zero.

The blue visual output shows the correct locations which shall have their weight map value changed. But the boolean output is true all over the place. Strange.

P.S.: The scene is attached. Please take a look if possible.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 24 Feb 2012, 23:44

Thanks to you both.

Eric, the problem aren't the locations. The positions found are fine. But the boolean is wrong. I tried it like you showed in your example hours before, but unfortunately on a complex object, the ray fired hit the object itself. So the boolean is true, even if the spot isn't visible to the light source. So I get errors in my map. I a way it is like as if there is no self shadowing enabled.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 24 Feb 2012, 23:46

P.S.: In one of Poobys vimeo videos he explains the same thing. You need the offset in normal position, otherwise all booleans will be true.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 25 Feb 2012, 00:33

Unfortunately none of your tips helped. I just realized that the position I use is the one of the "virtual" light and not of the offset lights. If I use the offset point of the mesh itself, the mesh will "hit" itself while raycasting. So details in the shadow area will apear lit, if the weight map would work correctly.

I'm feeling slightly dizzy...

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 25 Feb 2012, 00:49

If I do It the Pooby style, I'll end up with a weight map (hip-hip-huura), but it doesn't support self-shadowing as can be seen on the right side.

How do I get this right???
You do not have the required permissions to view the files attached to this post.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Location To Weight map

Post by Pancho » 25 Feb 2012, 00:50

P.S.: I understand why it get lit in the shadow area, but how do I approach this thing to avoid it???

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 16:43

Re: Location To Weight map

Post by Chris_TC » 25 Feb 2012, 10:35

Raycast from every point on your mesh towards the light (with the Normal offset of course). If you hit the mesh, this point is in shadow. If you don't hit the mesh, the point is lit.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 00:41

Re: Location To Weight map

Post by EricTRocks » 26 Feb 2012, 10:08

Using Chris_TC's logic here is a screen grab for a working ICE Tree setting the weight map value as I believe you need.
You do not have the required permissions to view the files attached to this post.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken