Polygon colours from gradient

Discussions regarding Materials, Material-Compounds or Shaders, etc.
tarkovsky
Posts: 54
Joined: 05 Oct 2012, 20:02

Polygon colours from gradient

Post by tarkovsky » 06 Feb 2018, 11:04

Hi all.
How can I color whole polygons from a gradient shader?
I have a map, where I want the color/texture to look more "polygonized" (according to geometry).

Ideally color would be sampled at PolygonRefFrame and applied to whole polygon. ICE? Vertext color on disconnected polys (no experience whatsoever ;))?

Current:

Image

Image

User avatar
rray
Moderator
Posts: 1583
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Polygon colours from gradient

Post by rray » 06 Feb 2018, 11:49

With ICE there's a polygon position attribute that you can use for a closest location lookup or gradient calculation. I would do the gradient computation directly in ICE instead of baking/reading from a shader. That would give you a color per polygon which you can convert to per node which is what you need for writing into a vertex color property (there's no color-per-polygon in XSI). No disconnecting has to be done.

The conversion can be done this way: put all the per polygon colors into an array (with build array from set) and select from that array using NodeToPolygon.
"as a maya discussion grows longer, the probability of a suggestion involving deleting the preferences approaches one"

softimage resources section (formerly known as rray.de/xsi) updated May 30 2018

tarkovsky
Posts: 54
Joined: 05 Oct 2012, 20:02

Re: Polygon colours from gradient

Post by tarkovsky » 07 Feb 2018, 15:38

Thanks for the pointer rray - I'll give it a go :)!

tarkovsky
Posts: 54
Joined: 05 Oct 2012, 20:02

Re: Polygon colours from gradient

Post by tarkovsky » 19 Feb 2018, 10:40

Hello again.
Suggestion works great - thanks again, but I'm not sure how to do the gradient in ICE?

Image

t

User avatar
rray
Moderator
Posts: 1583
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Polygon colours from gradient

Post by rray » 19 Feb 2018, 11:48

Hi tarkovsky, there's a gradient node directly in ICE, when you plug the polygon's Y position into its input, it will be in polygon context.

Then you can connect it to the "Build array from set" node that you already have
"as a maya discussion grows longer, the probability of a suggestion involving deleting the preferences approaches one"

softimage resources section (formerly known as rray.de/xsi) updated May 30 2018

tarkovsky
Posts: 54
Joined: 05 Oct 2012, 20:02

Re: Polygon colours from gradient

Post by tarkovsky » 19 Feb 2018, 14:20

Got it! Thx! :-bd

Always struggling with context stuff!

User avatar
rray
Moderator
Posts: 1583
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Polygon colours from gradient

Post by rray » 19 Feb 2018, 17:32

Context in ICE is tricky.. the concept is great though. There could be user friendlier methods but these would require memory stored for all kinds of lookups and also some pre computation time
"as a maya discussion grows longer, the probability of a suggestion involving deleting the preferences approaches one"

softimage resources section (formerly known as rray.de/xsi) updated May 30 2018