CustomBlendingEquations.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>Costanti di equazioni di blending personalizzate</h1>
  11. <p>
  12. Funzionano con tutti i tipi di materiale. Impostare prima la modalità blending del materiale
  13. su THREE.CustomBlending, poi impostare l'equazione di blending desiderata, il fattore sorgente
  14. (Source Factor) e quello di destinazione (Destination Factor).
  15. </p>
  16. <h2>Codice di Esempio</h2>
  17. <code>
  18. const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  19. material.blending = THREE.CustomBlending;
  20. material.blendEquation = THREE.AddEquation; //default
  21. material.blendSrc = THREE.SrcAlphaFactor; //default
  22. material.blendDst = THREE.OneMinusSrcAlphaFactor; //default
  23. </code>
  24. <h2>Esempi</h2>
  25. <p>[example:webgl_materials_blending_custom materials / blending / custom ]</p>
  26. <h2>Equazioni di Blending</h2>
  27. <code>
  28. THREE.AddEquation
  29. THREE.SubtractEquation
  30. THREE.ReverseSubtractEquation
  31. THREE.MinEquation
  32. THREE.MaxEquation
  33. </code>
  34. <h2>Fattori di Origine (Source Factors)</h2>
  35. <code>
  36. THREE.ZeroFactor
  37. THREE.OneFactor
  38. THREE.SrcColorFactor
  39. THREE.OneMinusSrcColorFactor
  40. THREE.SrcAlphaFactor
  41. THREE.OneMinusSrcAlphaFactor
  42. THREE.DstAlphaFactor
  43. THREE.OneMinusDstAlphaFactor
  44. THREE.DstColorFactor
  45. THREE.OneMinusDstColorFactor
  46. THREE.SrcAlphaSaturateFactor
  47. </code>
  48. <h2>Fattori di Destinazione (Destination Factors)</h2>
  49. <p>
  50. Tutti questi fattori di origine sono validi come fattori di destinazione ad eccezione di <code>THREE.SrcAlphaSaturateFactor</code>
  51. </p>
  52. <h2>Source</h2>
  53. <p>
  54. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  55. </p>
  56. </body>
  57. </html>