[Sidefx-houdini-list] H9 : CVEX shader question

calin casian calin at sidefx.com
Thu Oct 11 07:07:24 EDT 2007


I use cvex mainly to tweak geometry, fur in our case, on a strand by 
strand base. For example if you want to apply noise on the whole fur, 
not just the one you see in the viewport you'll use a cvex shader.
If you want to change the color of the fur based on a map you can pass 
the UV attribute to the SHOP shader and apply a normal SHOP shader.
You can pass attributes to the shader in the 2 corresponding fields from 
the fur sop. If you don't pass anything all the attributes that goes 
into the fur sop will be deleted.
Some common attributes you might want to pass are, "width" for the 
guides guideUV if your shader changes color from root to tip and UV for 
the skin.
You need to pass UV to the skin so that the fur knows it's position 
relative to the skin and it can pick up color from the texture map.
If you want to see the color feedback in the viewer you have to 
implement some of the shader capabilities in the cvex shader and export 
as a "cd" attribute.

I hope this mekes sense

cheers
calin




guillaume laforge wrote:
> Sorry for the noise, I think I understand my mistake now...
>
> In example 2, scale is just a parameter used for the result (P). It looks
> like the standard houdini behaviour to "override" this parameter if an
> attribute got the same name and type.
> CVEX is not so easy to understand for me :P.
>
> Cheers
>
> Guillaume.
>
> On 10/11/07, guillaume laforge <guillaume.laforge.3d at gmail.com> wrote:
>   
>> Hi,
>>
>> I'm learning the new workflow with the CVEX shaders and fur (sop and
>> procedural) in Houdini 9.
>> I don't understand completely how it works. Sometime the CVEX shader can
>> modify an attribute and sometime it creates this attribute.
>>
>> Example 1 : a CVEX applied in the skin shader parameter of a fur sop :
>>
>> If I create a Cd attribute on the rest skin geometry and add this cvex
>> shader on the fur sop it changes the fur color based on a color map file.
>> If I remove the Cd attribute, it doesn't work anymore.
>>
>> Code :
>>
>> cvex
>> gl_cvex_s_colormap(
>>             vector uv = 0;
>>             export vector Cd = 1;
>>             string map = "";)
>> {
>>     Cd = colormap(map,uv);
>> }
>>
>>
>>
>>
>> Example 2 : a CVEX applied in the guide shader parameter of a fur sop:
>>
>> If I add a scale attribute on the rest skin geometry, this code does
>> nothing. I must remove the scale attribute to see the effect.
>>
>> Code :
>>
>> cvex
>> gl_cvex_g_furrandomscale(
>>         export vector P=1;
>>         vector origin = 1;
>>         int fur_id = 0;
>>         float scale=0.5;
>>         )
>> {
>>     float r = random(fur_id);
>>     P += scale * r * (P - origin);
>> }
>>
>>
>> Why an existing  attribute is needed in example 1 and not example 2 ?
>> Any explanation on the CVEX shaders is welcome !
>>
>> Cheers,
>>
>> --
>> Guillaume Laforge | La Maison
>>
>>     
>
>
>
>   




More information about the Sidefx-houdini-list mailing list