简体   繁体   中英

Photometric function Three.js

Does anyone know how to define a photometric function in Three.js?

At the moment I'm using a Lambert

new THREE.MeshLambertMaterial({ color: 0xffffff }) 

But I want to use a Lommel Seeliger and I don't know where and how to define it.

You'll have to write a custom fragment shader for this purpose. You can take a look near the bottom of this page for a sample implementation of a Lommel-Seeliger shader.

Within Three.js, use a ShaderMaterial to apply your shader. A nice introduction to the concept is this tutorial , basically you do

var shaderMaterial =
  new THREE.ShaderMaterial({
    vertexShader:   vertexShader,
    fragmentShader: fragmentShader
  });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM