Trouble setting vertex colour

Discussions about SOFTIMAGEs© Interactive Creative Environment©
User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 07:28

Trouble setting vertex colour

Post by Pete » 03 Jan 2012, 02:47

Hi there,

I thought I'd have a go at making an ICE compound that would grab the vertex colours from a nearby mesh and apply those colours to the verts on another mesh.
I thought I'd just start by setting the colour of verts if they are close to the other mesh, but I can't seem to get it to set data on the vertex colour
Not sure what I'm doing wrong here can anyone see what the problem might be?

Thanks
Pete

Image

User avatar
dwigfor
Posts: 395
Joined: 17 Nov 2009, 16:46

Re: Trouble setting vertex colour

Post by dwigfor » 03 Jan 2012, 05:18

Search on Vimeo for Pooby's RayCam video. I forget the exact one, but it's one of if not his last one. He demonstrates how to set Vertex Colors on a grid through raycasting.

The important node was Node to Location (I think, or maybe that's an attribute). Great tutorial and I always end up searching for it for doing Vertex Colors stuff..

-Dave

User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 07:28

Re: Trouble setting vertex colour

Post by Pete » 22 Jun 2012, 06:15

Okay I got it half working, thanks to those vid's, they are pretty cool!

Image

Image

One thing I can't figure out still is that for some reason I can't blend back to the original vertex colours,
for some reason it won't let me plug that in.... does anyone know why?
It seams that i can plug either in but not at once. :(

Image
(yeah my screen capture wasn't happy with me plugging stuff)

Thanks
Pete

User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 07:28

Re: Trouble setting vertex colour

Post by Pete » 22 Jun 2012, 06:29

okay I figured it out! :D
Image

I had to set the new blend colours then blend that with the original colours.
Yeay.

User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 07:28

Re: Trouble setting vertex colour

Post by Pete » 22 Jun 2012, 06:39

Ahhhh F***K! I spoke too soon. if i do it this way it means i can't use the distance to blend as they are per point not per sample like the colour.

Image

anyone know how to make this plug in?

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Trouble setting vertex colour

Post by Mathaeus » 22 Jun 2012, 10:36

Pete wrote:Ahhhh F***K! I spoke too soon. if i do it this way it means i can't use the distance to blend as they are per point not per sample like the colour.
anyone know how to make this plug in?
as you said, it's about context, vertex colors are in "node" context, there's one on each corner of polygon.That is, 'under' one vertex, there's a chance for many vertex colors. This allows vertex colors to have a sharp mix on each side of some edge, if you want this.

'Get distance to surface" probably have a self.pointposition plugged into 'get closest location' or like, so it's per-point context, all the time. You could try a plain 'get closest location' with 'self.NodePosition' as input. This ensures the same context.

ICE tree

Or... if same color on all vertex colors that belongs to vertex, is enough: create a custom attribute in per point context, let's say, 3d vector. Convert vertex color inputs to this attribute, do all operations, set it back to vertex colors at the end of ICE tree.

User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 07:28

Re: Trouble setting vertex colour

Post by Pete » 25 Jun 2012, 01:13

Thanks Mathaeus,
That works great! I get a bit frustrated with ICE when stuff like this trips me up, at least there's a good community here when it does :)

User avatar
Mr.Core
Posts: 148
Joined: 10 Aug 2011, 10:35
Skype: giga-core
Location: Kharkov, Ukraine

Re: Trouble setting vertex colour

Post by Mr.Core » 25 Jun 2012, 17:39

You can also use a build array from set to build an array from per-vertex data, and then use self.nodeToVertex attribute to select relative vertex from builded array and set it at the actual node

User avatar
Pete
Posts: 118
Joined: 16 Jun 2009, 07:28

Re: Trouble setting vertex colour

Post by Pete » 27 Jun 2012, 01:24

Hey I thought I had my head around it but I just tried to plug a turbulize node in between the getDistance and the blend colour and it had the same context issues. Is it weird that it would have it there, I thought it would have kept the same context?