Coloring instanced feathers based on a texture

Discuss grooming techniques and working with Yeti graphs.
Heckler
Posts: 5
Joined: July 7th, 2014, 1:18 am

Coloring instanced feathers based on a texture

Post by Heckler »

Hi everyone

This is my second post on the forum, Ive got slightly better with Yeti now, but still there are things that I haven't found any answers for on the net so far.

I was wondering is there anyway to control the color of the instanced feathers on a geometry based on a texture map?

For instance if I want to get a gradient of color on the instanced feathers,or different feather colors on different parts of body, is there anyway to somehow get it using a texture map?

I really appreciate any answers

Regards

Sina

carlogiesa
Posts: 829
Joined: January 25th, 2013, 7:43 am

Re: Coloring instanced feathers based on a texture

Post by carlogiesa »

Hi Sina!

You define two attributes on the hair before the instancer, something like map_s and map_t and their default value are respectively s and t. This means, we just copy the s and t value to some new attribute called map_s and map_t. On the instancer node, you make sure to inherit those two attributes. Now, you can just use a texture node and use map_s and map_t as texture coordinates instead of s and t. This means, for each feather, it would always sample at the same position in the texture, since it takes the s and t value of the hair that the feather is instanced on. The texture can then be applied to an attribute that you can use in your shading network. Just be careful about color space.

Greets,
Carlo

Heckler
Posts: 5
Joined: July 7th, 2014, 1:18 am

Re: Coloring instanced feathers based on a texture

Post by Heckler »

Hi Carlo

Thanks a lot for your reply, is there any chance of attaching an example scene?

I am still not very clear about where to apply the texture and how to use the created attributes in the shading network?

I would much appreciate it

Regards

Sina

carlogiesa
Posts: 829
Joined: January 25th, 2013, 7:43 am

Re: Coloring instanced feathers based on a texture

Post by carlogiesa »

Hi Sina!

So, I just setup a test scene, but this works only with Arnold. I don't know which render engine you are using, but I cannot really help you with Vray. But the principle should be the same, as it would be for PRMan and 3Delight.

So, currently, the workflow described above does not work due to a bug in Yeti. Attributes are not inherited by the procedural feathers. That's why you can only use what Yeti actually gives you by default. And luckily, there are two attributes calles surf_s and surf_t that you can use to sample a texture.

In Arnold, you can use the aiImage node where you can specify your own texture coordinates. Applied to a yeti node with procedural feathers, you can just use two aiUserDataFloat nodes that recuperate surf_s and surf_t that you use in your aiImage node.

Et voilà:
colorFeatherInstances.jpg
colorFeatherInstances.jpg (155.32 KiB) Viewed 1548 times
If you use geometry as instances, the workflow described above should work perfectly.

Greets,
Carlo
Attachments
colorFeatherInstances.zip
(34.2 KiB) Downloaded 198 times

Heckler
Posts: 5
Joined: July 7th, 2014, 1:18 am

Re: Coloring instanced feathers based on a texture

Post by Heckler »

Thanks very much Carlo

We are using Vray in our studio but I will definitely try to get a trial version of Arnold to test your scene.

I am very curious to see how it works,

Thanks again for the test scene, much appreciate it :)

Sina

roxa
Posts: 3
Joined: March 10th, 2014, 3:57 am

Re: Coloring instanced feathers based on a texture

Post by roxa »

Hi Carlo,
As we are going to make some peacock feather with Yeti. And I'm searching a solution of mapping the special texture on a single feather. like this image:
http://www.funkita.com/12628-thickbox/p ... radise.jpg

So any special setting I need or I just need surf_s and surf_t?

Looking forward to your reply.

prakash

Re: Coloring instanced feathers based on a texture

Post by prakash »

Hi Carlo,

Yes it would be helpful.

I textured the feather curve using projection to get the peacock pattern and exported it.

The imported reference object inherit proper pattern in render (Textured_Reference_Object.jpg).

But after instancing the pattern is not proper(Instanced_Object.jpg)

Please let me know where i am going wrong.

Cheers
Prakash
Attachments
Instanced_Object.jpg
Instanced_Object.jpg (567.55 KiB) Viewed 1482 times
Textured_Reference_Object.jpg
Textured_Reference_Object.jpg (667.32 KiB) Viewed 1482 times

carlogiesa
Posts: 829
Joined: January 25th, 2013, 7:43 am

Re: Coloring instanced feathers based on a texture

Post by carlogiesa »

Hi!

What is your exact work flow? Can you provide a test scene? I managed to "project" texture coordinates the following way:

Use any tool to generate a feather and convert it to curves (jcFeathers in my case). I make sure that the curves are placed from -0.5 to 0.5 in X and from 0.0 to 1.0 in Y. I import them as guides into a Yeti graph and add two attributes that I call "tex_s" and "tex_t" and I map the point position. Both attributes must be varying so that they get applied per vertex. Fot "tex_s" I use following expression: P[0] + 0.5 and for "tex_t": P[1]. Now, I can use those attributes to map my texture (as explained above with Arnold, this is a trivial task).

Anyway, there seem to be an issue when instancing this cache. I just tried it and I have the impression that the instanced version of the feather maps the attribute in a wrong way. I will contact support@peregrinelabs.com to see what is wrong here.

I'll keep you posted.

Greets,
Carlo

prakash

Re: Coloring instanced feathers based on a texture

Post by prakash »

Hi Carlo,

Please find the scene file attached.

Will follow your steps mentioned.

Please Let me know if you get any updates.

Cheers
Prakash
Attachments
yeti_feather_Shading_v02.rar
(167.71 KiB) Downloaded 118 times

carlogiesa
Posts: 829
Joined: January 25th, 2013, 7:43 am

Re: Coloring instanced feathers based on a texture

Post by carlogiesa »

Hi Prakash!

I did send a test scene to reproduce the issue to the Peregrine Labs support. But I don't know when they gonna take a look at it. If it is an urgent issue, you should probably contact them yourself.

Anyway, I'll keep you posted whenever I have an update.

Greets,
Carlo

Post Reply