zoukankan      html  css  js  c++  java
  • 3delight and useBackground

    为什么3delight使用maya的useBackground材质渲出来的阴影怪的不行,后来发现它使用的阴影计算方法有点不一样。

    原因就在shading_utils.h文件里头定义的computeShadowValue函数,把这个函数修改成下边的方法才好使一点。

    float computeShadowValue(normal i_N)
    {
       float shadowValue = 0;
       varying float totalLightIntensity = 0;
     
       normal unitN=normalize(i_N);
       normal Nn= ShadingNormal(unitN);
       extern varying point P;
       illuminance(P,Nn,PI/2)
          {
               float Cl_shd=0;
              color Cl_noshd=0;
              float k = Nn.normalize(L);
       
              lightsource("__3dfm_shadowing", Cl_shd);
              lightsource("__3dfm_unshadowed_cl", Cl_noshd);
         
              float unshadowed_intensity = luminance(Cl_noshd); 
         
              shadowValue += k * Cl_shd * unshadowed_intensity;
              totalLightIntensity += k *unshadowed_intensity;
          }
         
          shadowValue /= totalLightIntensity;
          return shadowValue;
     }

  • 相关阅读:
    域账户-配置文件
    创建任务计划
    查看系统和PowerShell版本
    查找数组中元素的索引位置
    更改计算机名称,修改密码
    生成GUID
    微服务架构 vs. SOA架构
    springMvc架构简介
    Spring Boot和Spring cloud
    Spring链接汇总
  • 原文地址:https://www.cnblogs.com/jerrykon/p/2615022.html
Copyright © 2011-2022 走看看