zoukankan      html  css  js  c++  java
  • 光照计算公式

      color.xyz = emissive + ambient + diffuse + specular;

     

    The Basic Lighting Model

     The Emissive Term   自发光

     emissive=ke    ;  Ke is the material's emissive color.

    The Ambient  Term

     Ambient=Ka*globalAmbient

     Ka is the material's ambient reflectance and

     globalAmbient is the color of incomming ambient light. 传入的环境光

    The Diffuse Term

    diffuse=Kd*lightcolor*max(N点乘L,0)

    Kd is the material's diffuse color 材质的散射颜色

    lightcolor is the color of the incomming diffuse light 传入的散射光

    N is the normalized suface normal  归一化表面正常

    L is normalized vector toward the light source ,and  归一化向量向光源

    P is the point being shaded. 被着色点

    The Specular Term

    specular = Ks x lightColor x facing x (max(N · H, 0)) shininess

    where:

    • Ks is the material's specular color,
    • lightColor is the color of the incoming specular light,
    • N is the normalized surface normal,
    • V is the normalized vector toward the viewpoint,
    • L is the normalized vector toward the light source,
    • H is the normalized vector that is halfway between V and L,
    • P is the point being shaded, and
    • facing is 1 if N · L is greater than 0, and 0 otherwise.
  • 相关阅读:
    4、idea使用git
    ♫【MongoDB】
    -_-#【网站优化】预加载(Pre-loader) / 预读取(Pre-fetching)
    【Node】package.json
    ☀【移动】Google Maps JavaScript API v3
    -_-#【移动】视频分段
    ☀【Grunt】package.json, Gruntfile.js, npm install, grunt
    【three.js】
    【单元测试】
    洛谷——P1125 笨小猴
  • 原文地址:https://www.cnblogs.com/beipiaoboy/p/3254407.html
Copyright © 2011-2022 走看看