View Full Version : Coloring blobby mesh suing particle proximity
Vushvush 03-24-2004, 08:49 PM Ok guys, so you know the trick of using distance between "something" and the worldpoint on a surface, and through a ramp coloring that surface based on proximity?
How would I do the same trickm only instead of using a sphere, or a surfacem use every particle in a particleshape to do this coloring?
Essentially, the end result is using particle color to color the polymesh of a blobby surface.
I'm posting this in rendering as well as this is cross discipline :)
|
|
alexx
03-25-2004, 09:40 AM
basically no problem.
you just use the normalized distance between particles to change their rgbPP using a ramp.
only problem and really slow to compute: you have to calculate the distances for all the particles, which is terrible slow if you got some more..
cheers
alexx
Vushvush
03-25-2004, 02:26 PM
Can you please go into a little more detail?
Also, what if I want to use the colors particle to color a surface based on their proximity to said surface? Like, have a particleshape with red and blue particles, and as the particles flow over a surface, their proximity will actually affect that surfaces color?
alexx
03-25-2004, 02:43 PM
oh.. i thought you wanted just to color the particles differnetly when they get close to each other...
with the surface that is a lot harder to get..
the bassic approach would be the same as having to surfaces that get close to each other.
only difference should be, that you need an expression to calculate all the particles distances.
on a hint on how to use that information check out the shader:
expression-driven distance shader v1.0
from highend3d.
hmm.. i wonder if that could be done with a 2d fluid texture..
i remember having seen a "pond" like texture, that uses fluids and particle collisions.
but i am not really good with fluids.
maybe search in here for the words "duncan" and "rain".. that should help.
cheers
alexx
Vushvush
03-25-2004, 02:54 PM
I'm aware of most of this. My biggest hurdle is how do I get the colors AND positions of all these particles?
if you could help me out, as I'm not sure about most of the syntax/commands it would be VERY helpful.
alexx
03-25-2004, 03:27 PM
quite easy..
particeles have their own getAttr command:
getParticleAttr
so to get the position of particle #10:
getParticleAttr -at position particleShape1.pt[10];
for some reason i do not understand at all, that command does not return 3 values, but 6..
so put the result to an array and just use the first 3 ones.
for the color it would be:
getParticleAttr -at rgbPP particleShape1.pt[10];
please keep me updated with what you are doing, since i am interested in the result.. could be way cool
cheers
alexx
Vushvush
03-25-2004, 03:47 PM
ok cool, that will help a lot I think.
The deal now, I think, would be using a sampler info node on the surface, and getting the avg RGB value of the particles within a certain distance from that point and assigning those results to the color channel.
More help would be helpful (that was intended)!
alexx
03-25-2004, 03:58 PM
sorry.. i have to do a bit of my work that i get paid for, and this is nothing i can directly write down without taking some serious r&d :/
Vushvush
03-25-2004, 11:26 PM
Well, this is deffinitly a little over my head :)
Where I currently stand, I'm trying to use the distanceBetween technique of coloring a surface to try and color the surface as the particles go over it.
The thing I can't figure out is how to pump all the particle positions through the distancebetween node like the samplerInfoNode does. Of course, I believe the mechanic of sampling is different from an array of positions, but still seems like this is the way to take things.
PLEASE HELP MORE :)
Vushvush
03-26-2004, 12:13 AM
Another thing I wonder about, is it possible to get worldPosition attributes from the particleSamplerInfoNode, and funnel those into a regular shader, not a software particle shader?
CGTalk Moderation
01-17-2006, 08:00 PM
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-2013, Jelsoft Enterprises Ltd.