Location To Weight map
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Location To Weight map
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
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
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
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?
-
grahamef
- Posts: 281
- Joined: 23 Jun 2009, 19:01
Re: Location To Weight map
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
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.
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Location To Weight map
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.
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
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.
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
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
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...
I'm feeling slightly dizzy...
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Location To Weight map
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???
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
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
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
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.