Arnold Shader Custom AoV

Source: Internet
Author: User

    • Add AoV parameter in [enum Zsjstandardparams]

Enum zsjstandardparams{... p_aov_spec_fresnel, P_aov_refl_fresnel, ...};
    • Node parameter

Node_parameters {...   Aiparameterstr ("Aov_spec_fresnel", "Spec_fresnel");   Aiparameterstr ("Aov_refl_fresnel", "Refl_fresnel");    ...}; }
    • Use a shader data struct-pass aov_name to shader

node_initialize{ shaderdata* data = new shaderdata;     Ainodesetlocaldata (node,data);}; node_finish{ if  (Ainodegetlocaldata (node))     {         ShaderData* data =  (shaderdata*)  ainodegetlocaldata (node);         ainodesetlocaldata (node, null);         delete data;    }};node_update{ ShaderData *data =  ( shaderdata*) ainodegetlocaldata (node);  data->aov_spec_fresnel = params[p_aov_spec_fresnel]. Str; data->aov_refl_fresnel = params[p_aov_refl_fresnel]. Str; aiaovregister (Data->aov_spec_fresnel.c_str (),  ai_type_rgb, ai_aov_blend_opacity);  Aiaovregister (Data->aov_refl_fresnel.c_str (),  ai_type_rgb, ai_aov_blend_opacity);}; Shader_evaluate{ shaderdata *data =  (shaderdata*) ainodegetlocaldata (node); ... if  (Sg->rt & ai_ray_camera )  {  aiaovsetrgb (Sg, data->aov_spec_fresnel.c_str (),  aicolor (Fresnel_spec));   aiaovsetrgb (Sg, data->aov_refl_fresnel.c_str (),  aicolor (FRESNEL_REFL));  }
    • Edit MTD File:

[attr Aov_spec_fresnel] aov.type INT 0x05 default STRING "Spec_fresnel" aov.enable _composition BOOL TRUE [attr Aov_refl_fresnel] aov.type INT 0x05 default STRING "Refl_ Fresnel "Aov.enable_composition BOOL TRUE
    • Edit Template file

Self.addaovlayout (Aovreorder = [' Spec_fresnel ', ' Refl_fresnel '])

Arnold Shader Custom AoV

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.