zoukankan      html  css  js  c++  java
  • 3delight ptc workflow from 3delight forum

    volume
    ptc_surface_bake(
    string ptc_file = "";
    string ptc_coordsys = "world";
    float i_Ci=3;
    float bleeding_intensity = 0.25;
    )
    {
    color aov_incandescence = 0;
    color aov_surface_color = 0;
    color Ci=0;
    surface("aov_surface_color", aov_surface_color);
    surface("aov_incandescence", aov_incandescence);
    surface("Ci", Ci);

    color color_indirect = Oi * aov_incandescence + (aov_surface_color * bleeding_intensity)+(Ci*i_Ci);

    bake3d( ptc_file, "", P, N,
    "coordsystem", ptc_coordsys,
    "surface_color", color_indirect,
    "interpolate", 1 );

    Ci = Ci;
    }

    #pragma annotation ptc_sortbleeding "gadgettype=checkbox:0:1=custom value;"
    #pragma annotation ptc_clamp "gadgettype=checkbox:0:1=custom value;"
    #pragma annotation bake_ptc "gadgettype=checkbox:0:1=custom value;"
    #pragma annotation ao_ptc "gadgettype=checkbox:0:1=custom value;"

    volume
    ptc_surface_bleeding(
    string ptc_map = "";
    string coordsyst = "world";
    string envmap = "";
    string envspace = "world";
    string ptc_sides = "both";
    float ptc_clamp = 1;
    float ptc_sortbleeding = 1;
    float ptc_bias = 0.045;
    float ptc_maxdist = 1e15;
    float ptc_coneangle = 180;
    float ptc_maxsolidangle = .2;
    float ptc_samplebase = 0;

    float ptc_falloffmode = 0;
    float ptc_falloff = 0;

    float rad_intensity = 1;
    float ao_ptc = 0;
    float ao_coneangle = 180;
    float ao_maxdist = 0.5;
    float ao_bias=0.045;
    float ao_maxsolidangle=0.2;
    float ao_falloff=3;
    float ao_falloffmode=1;
    float bake_ptc = 0;
    string ptc_bake_Ci ="";
    output varying color aov_ambient = 0;
    output varying color aov_envcolor = 0;
    output varying color aov_occlusion = 1;
    )
    {
    normal aov_camera_space_normal = 0;
    surface("aov_camera_space_normal", aov_camera_space_normal);

    color aov_surface_color = 0;
    surface("aov_surface_color", aov_surface_color);

    float occlusion = 0;

    aov_ambient = indirectdiffuse(P, aov_camera_space_normal, 0, "pointbased", 1,
    "filename", ptc_map,
    "hitsides", ptc_sides,
    "coneangle", ptc_coneangle,
    "clamp", ptc_clamp,
    "coordsystem", coordsyst,
    "sortbleeding", ptc_sortbleeding,
    "maxdist", ptc_maxdist,
    "falloff", ptc_falloff,
    "falloffmode", ptc_falloffmode,
    "samplebase", ptc_samplebase,
    "bias", ptc_bias,
    "maxsolidangle", ptc_maxsolidangle,
    "environmentmap", envmap,
    "environmentspace", envspace,
    "environmentcolor", aov_envcolor)*rad_intensity;

    if(ao_ptc==1){
    aov_occlusion = 1-occlusion(P, aov_camera_space_normal, 0, "pointbased", 1,
    "filename", ptc_map,
    "hitsides", ptc_sides,
    "coneangle", ao_coneangle,
    "clamp", ptc_clamp,
    "coordsystem", coordsyst,
    "maxdist", ao_maxdist,
    "bias", ao_bias,
    "maxsolidangle", ao_maxsolidangle,
    "falloff", ao_falloff,
    "falloffmode", ao_falloffmode);
    }

    Ci += aov_ambient * aov_surface_color * aov_occlusion;

    if(bake_ptc == 1){
    bake3d( ptc_bake_Ci, "", P, aov_camera_space_normal,
    "coordsystem", coordsyst,
    "surface_color", Ci,
    "_radiosity", aov_ambient,
    "interpolate", 1 );
    }

    }

    volume brikmap_read(
    string map = "";
    output varying color aov_ambient = 0;
    )
    {

    color aov_surface_color = 0;
    surface("aov_surface_color", aov_surface_color);

    color res =0;
    texture3d(map, P, N, "_radiosity", res);
    aov_ambient = res;
    Ci+= res*aov_surface_color;
    }

    from http://www.alessandrodallafontana.com/pages/wip_mall.htm
  • 相关阅读:
    智慧养老民政监管平台建设方案
    CF600E Lomsat gelral dsu on tree
    dsu on tree详解
    【Spring 从0开始】Spring5 新功能,整合日志框架 Log4j2
    【Spring 从0开始】JdbcTemplate 数据库事务管理
    【Spring 从0开始】JdbcTemplate 数据库事务参数
    【Spring 从0开始】JdbcTemplate 数据库事务管理
    【Spring 从0开始】JdbcTemplate 操作数据库
    【Spring 从0开始】AOP 操作
    【Spring 从0开始】AOP 操作中的相关术语、环境准备
  • 原文地址:https://www.cnblogs.com/rdRoad/p/1627664.html
Copyright © 2011-2022 走看看