Babylon实现光影反射效果
代码语言:html
所属分类:三维
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> PBR Reflection</title> <style> canvas { width: 100%; height: 100vh; display: block; } a { position: fixed; top: 0; left: 0; color: hsl(0, 0%, 100%); padding: 5vmin; font: 1em/1 monospace; } </style> </head> <body translate="no"> <base target="_blank" /> <canvas id="elCanvas"></canvas> <script src='http://repo.bfw.wiki/bfwrepo/js/babylon.js'></script> <script> const engine = new BABYLON.Engine(elCanvas, true); const scene = (() => { const scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color4(0, 0, 0, 1); scene.autoClear = true; // // gold mat // const mat0 = new BABYLON.PBRMetallicRough.........完整代码请登录后点击上方下载按钮下载查看
网友评论0