View Full Version : Nearest Point On Surface
faultymoose 01-12-2007, 12:14 AM Hiya, I'm having a bit of a dilemma...
I need to drive the ambience channel of one shader based upon the illuminance of the nearest-point-on-surface of a neighbouring mesh. The intention is to solve a problem with varying illuminance across cards attached to a character.
Does anyone have any tips on how to achieve this, or perhaps alternative solutions?
Thanks heaps! <3
| |
faultymoose
01-12-2007, 12:27 AM
So far I have (with mainObject and objectCards):
samplerInfo.pointWorld > nearestPointOnMesh.inPosition
mainObject.outMesh > nearestPointOnMesh.inMesh
This (I think) gives me access to the worldSpace/objectSpace/UV coordinates for the nearest point on the mainObject based upon the worldSpace position of the currently sampled pixel.
Here's where I get stuck, trying to find the illuminance value at the resulting nearestPointOnMesh of mainObject...
My next thought was to somehow use a surfaceLuminance node to sample the luminance value of mainObject at the resulting position, but as far as I know the surfaceLuminance node only returns the luminance value of the current pixel being shaded...?
The Infernal One
01-13-2007, 02:17 AM
Try using pointOnMeshInfo node
faultymoose
01-13-2007, 07:49 AM
Unfortunately, it seems as though the pointOnMeshInfo node only returns a world space coordinate and surface normal according to UV coordinates.
faultymoose
01-17-2007, 04:41 AM
Okay I've thought of a slightly different solution:
Take the nearest point on the character's body from the currently rendering pixel on the character's card, and give that pixel the same surface normal as the nearest point on the body... if that makes sense?
The only problem is, I can't seem to get the connections to work - I've tried plugging the normal obtained from the nearestPointOnMesh node directly into the card shader's Normal Camera attribute. I've also tried plugging it into a bump2D node's Normal attribute, and the bump node into the card shader's Normal Camera...
Any suggestions?
The Infernal One
01-17-2007, 09:28 AM
There's one dvd by Weta about using closestPointOnSurface, sampler info and point on mesh info. I think is called Flow workflows in production, or something like that...
CGTalk Moderation
01-17-2007, 09:28 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2009, Jelsoft Enterprises Ltd.