Particle's opacity fade out

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Particle's opacity fade out

Post by Adam Kesher » 11 Jan 2013, 20:20

Hi people,
I'm new here and I'll start with a little question. I'm a beginner to Ice too.
It may seem simple to some of you but I sorta can't figure it out by myself.
Let's say I'm working with a point cloud cube (4*4*4).
I want the particles which are the closest from the camera to be 100% solid and the ones which are the furthest almost totally transparent.
Actually I'd like it to look like the depth cue function within the viewport, but applied to a single point cloud.
Well if you guys have any suggestion/hint, like what kind of data I should look for, it surely could help.
Thanks in advance and cheers everyone

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: Particle's opacity fade out

Post by NNois » 11 Jan 2013, 21:12

Hello, sorry i don't have the time right now to do a complete explanation/solution, but i can orient you...

There is 2 way to do that
1. In the shader tree with computing the raylenght to your particle.
-Using a "Scalar State(RayLenghtMode)"
-> "Change Range(Where you set you set the distances you want in the "old ranges")"
-> to your material transparency/opacity

2. Computing the distance in your ice tree and passing it to your shader
- In ice you can get data of your camera global position, your particle position, and calculate the distance(there is a node for that)
-> use a rescale node to set you wanted distances
-> and pass that to an the alpha of a "set particle color"
-> there you can get the "color attribute" in your you shader and use that to drive the transparency
PS:if your ice tree is already using the alpha of the particle color, you can pass the calculated distance to a custom data with a set data node and using for example "self._myAlpha".

Sorry if this is too succinct
A++

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 12 Jan 2013, 10:23

Hey thanks a lot, I'll give those guys a try this weekend.
I will come back here in case I did not understand everything properly but that should already lead me on my way.
Cheers

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 12 Jan 2013, 11:42

hey I got it right, rad !
had fun with it playing with color channels as well, I like the effect

Image

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 12 Jan 2013, 15:27

Yet another way to achieve the look I wanted,
this time since the falloff always starts from the point which
is the closest from the camera, and not the camera itself, I
can have a better control over the way it fades out through
the rescale node.
Maybe there's an less complicated way of making it work but
well, it looks right so for now I'll be fine.
Image

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: Particle's opacity fade out

Post by NNois » 15 Jan 2013, 18:56

the only hiccup of this method (VS the render tree one) is the camera dependency ;-)
Last edited by NNois on 16 Jan 2013, 11:42, edited 1 time in total.

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: Particle's opacity fade out

Post by Tekano » 16 Jan 2013, 00:53

hey nice! :-bd have used exactly same way in this compound here (attached) to get the closest global position of any object (not just the camera) and also adjust the color in relation to the back or furthest away point.

did you know that you can also apply your same ICE tree that affects particle color to geometry objects and if you set the vertex display of the materials surface OpenGL properties to 'color' (see pic for details) it will also use ICE to color the vertexs as well as particles!
Attachments
fake_sss.JPG
fake SSS.xsicompound
(33.14 KiB) Downloaded 270 times
Gossip is what no one claims to like, but everybody enjoys.

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 16 Jan 2013, 10:22

Hey
NNois > Yes right and I noticed also that this type of setup doesn't work if instead of orbiting the camera around the point cloud, you rotate the point cloud. It all looks kinda frozen.
Tekano > Cool, thanks for the input, I was actually wondering about how to get this type of effect on geometry without having to fill the volume with particles. Right on time ;) I'll take alook at your compound today !

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: Particle's opacity fade out

Post by NNois » 16 Jan 2013, 11:47

Adam Kesher wrote: NNois > Yes right and I noticed also that this type of setup doesn't work if instead of orbiting the camera around the point cloud, you rotate the point cloud. It all looks kinda frozen.
For this you need to multiply the particle position (or the point position, this is the same, for tekano method) with the self.kine.global matrix
particle position>multiply vector by matrix(get data(self.kine.global)>>

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 17 Jan 2013, 15:55

Thanks for the tip since I wouldn't have figured it out by myself ;)

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 23 Jan 2013, 22:57

Hey guys,
been playing around with similar stuff lately, I moved to something a bit different.
As you can see in the file attached, I'm trying to have that kind of "fade/gradient"
look as discussed above, but this time flowing along a curve. I'd like the gradient
to start where the curve starts and end, well, where the curve ends :)
I've got it quite working at first, but it actually ain't that right. The problem is, all
the distance related stuff, as you can see, is not considering the flow along the
curve. Red spiral looks ok but things get a little more clumsy when it come to the
blue curve.
I really dont know how to tell Ice "well ok, apply this damn gradient, take in
consideration the range between the start and end point knowing you've got to
follow the curve the particles are sticking to"
Do you guys have any advice ? I've been trying to sort it out but found no solution.
Thanks in advance,
cheers

Image

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: Particle's opacity fade out

Post by Tekano » 24 Jan 2013, 00:40

from your particle cloud(or geometry) get closest location > point.u is what you are looking for to drive the gradient along a curve. this returns a value between 0 - 1 depending on the location on the curve
Gossip is what no one claims to like, but everybody enjoys.

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 24 Jan 2013, 09:51

thanks Tekano ! I'll post results ASAP
Cheers

User avatar
Adam Kesher
Posts: 19
Joined: 24 Oct 2012, 11:38
Location: Dijon, France

Re: Particle's opacity fade out

Post by Adam Kesher » 24 Jan 2013, 11:55

hey thanks again, everything works properly now ;)
See you later

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests