ExtendEyeDomeLightingMaterial.js 998 B

123456789101112131415161718192021222324252627282930
  1. import * as THREE from "../../libs/three.js/build/three.module.js";
  2. import {Shaders} from "../../build/shaders/shaders.js";
  3. import {EyeDomeLightingMaterial} from './EyeDomeLightingMaterial.js'
  4. //
  5. // Algorithm by Christian Boucheny
  6. // shader code taken and adapted from CloudCompare
  7. //
  8. // see
  9. // https://github.com/cloudcompare/trunk/tree/master/plugins/qEDL/shaders/EDL
  10. // http://www.kitware.com/source/home/post/9
  11. // https://tel.archives-ouvertes.fr/tel-00438464/document p. 115+ (french)
  12. export class ExtendEyeDomeLightingMaterial extends EyeDomeLightingMaterial{
  13. constructor(parameters = {}){
  14. super(parameters);
  15. delete this.uniforms.screenWidth
  16. delete this.uniforms.screenHeight
  17. this.uniforms.resolution = { type: 'v2', value: new THREE.Vector2()}
  18. this.uniforms.useEDL = { type: 'i', value: 1 }
  19. this.vertexShader = this.getDefines() + Shaders['edl_new.vs'] //改
  20. this.fragmentShader = this.getDefines() + Shaders['edl_new.fs'] //改
  21. }
  22. }