GitHub – KhronosGroup/glTF-Sample-Viewer:使用 WebGL 在 glTF 2.0 中进行基于物理的渲染
| Name | ||
|---|---|---|
|
5b1c210 · 3 weeks ago
|
||
|
|
3 weeks ago
|
|
|
|
4 years ago
|
|
|
|
8 months ago
|
|
|
|
3 weeks ago
|
|
|
|
3 weeks ago
|
|
|
|
5 years ago
|
|
|
|
last year
|
|
|
|
last year
|
|
|
|
7 years ago
|
|
|
|
6 years ago
|
|
|
|
last year
|
|
|
|
3 weeks ago
|
|
|
|
3 years ago
|
|
|
|
last year
|
|
|
|
3 months ago
|
|
|
|
last year
|
|
|
|
3 months ago
|
|
|
|
3 months ago
|
|
|
|
3 months ago
|
|
存储库文件导航
glTF 示例查看器 Web 应用程序
这是使用 WebGL 2.0 的官方 Khronos glTF 2.0 示例查看器:
链接到实时 glTF 2.0 示例查看器。
- glTF 2.0
- KHR_animation_pointer
- KHR_draco_mesh_compression
- KHR_lights_punctual
- KHR_materials_anisotropy
- KHR_materials_clearcoat
- KHR_materials_diffuse_transmission
- KHR_materials_dispersion
- KHR_materials_emissive_strength
- KHR_materials_ior
- KHR_materials_iridescence
- KHR_materials_pbrSpecularGlossiness
- KHR_materials_sheen
- KHR_materials_specular
- KHR_materials_transmission
- KHR_materials_unlit
- KHR_materials_variants
- KHR_materials_volume
- KHR_materials_volume_scatter
- 对于使用 KHR_materials_diffuse_transmission 的密集体积
- 对于使用 KHR_materials_transmission 的稀疏卷
- KHR_mesh_quantization
- KHR_texture_basisu
- KHR_texture_transform
- KHR_xmp_json_ld
- EXT_mesh_gpu_instancing
- EXT_texture_webp
- 直接通过UI选择所有glTF-Sample-Assets
- 通过拖放加载您自己的 glTF/glb 和 HDR 文件
- 自定义照明和色调映射
- 使用集成的 glTF-Validator 检查验证错误
- 选择不同的材料变体
- 启用/禁用特定动画
- 启用/禁用 glTF 功能/扩展并查看调试通道
- 下载渲染图和当前相机属性
- 显示有关当前加载文件的统计信息
- 指定 URL 参数以修改加载时的行为
click + drag:旋转模型
shift + drag
middle mouse button + drag:平移相机
scroll
right click + drag:变焦相机
GUI:用于更改型号和设置
- 在选择列表中选择一个 glTF 模型
- 将 glTF 文件拖放到查看器中
- 拖放 .hdr 全景图文件
URL 参数添加到示例查看器 URL 的末尾:
?key=value&another_key=another_value
可能的参数:
model=URL_to_file:从指定的URL加载glTF/glbnoUI:禁用 UIyaw=90:沿 Y 轴绕模型运行相机(以度为单位)。使用 90 度,您可以从左侧查看模型。pitch=90:使相机沿 X 轴绕模型运行(以度为单位)。使用 90 度,您可以从顶部查看模型。值范围:-90 至 90distance=5:模型在正数时变小,负数时变大。相对于初始摄像机位置。
本地使用和调试,请按照以下说明作:
-
签出
主分支 -
拉取所需 glTF-Sample-Renderer 的子模块
git submodule update --init --recursive -
生成 Web 应用
- 跑
npm install - 在浏览器中使用 开始演示,然后打开 http://localhost:8000。
npm run dev
- 跑
进行更改时,项目会自动重新生成,目录中填充 Web 应用程序。此目录包含部署到 Web 服务器所需的所有文件。./dist
- 要求
- 安装适用于 Visual Studio Code 的 Debugger for Chrome 或 Debugger for Firefox 扩展
- 在 Visual Studio Code 中打开项目目录,然后选择或创建文件。
Debug->Add Configuration->ChromeDebug->Add Configuration->Firefox.vscode/launch.json - 对于 chrome:在文件中追加到
/dist${workspaceFolder}launch.json Debug->Start Debugging现在应该使用示例查看器启动 Chrome 或 Firefox 窗口,并且应该命中 VS Code 断点。
npm install / npm run dev 给出以下警告:
以下警告来自第三方,不会影响示例查看器,因为从未执行上述第 179 行。
(!) "this" has been rewritten to "undefined"
https://rollupjs.org/troubleshooting/#error-this-is-undefined
node_modules/iobuffer/lib-esm/text-encoding-polyfill.js
177: : typeof self !== 'undefined'
178: ? self
179: : this);
^
180: //# sourceMappingURL=text-encoding-polyfill.js.map
以下警告是由旧的 bulma 版本引起的,buefy-next 目前依赖于该版本。 这应该在即将发布的版本中修复:ntohq/buefy-next#208
[0] [build] DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
[0] rules will be changing to match the behavior specified by CSS in an upcoming
[0] version. To keep the existing behavior, move the declaration above the nested
[0] rule. To opt into the new behavior, wrap the declaration in `& {}`.
[0]
[0] More info: https://sass-lang.com/d/mixed-decls
[0]
[0] ╷
[0] 51 │ ┌ &:not(.is-rounded)
[0] 52 │ │ border-radius: $radius-small
[0] │ └─── nested rule
[0] 53 │ font-size: $size-small
[0] │ ^^^^^^^^^^^^^^^^^^^^^^ declaration
[0] ╵
[0] node_modulesbulmasasselementsbutton.sass 53:3 button-small()
[0] node_modulesbulmasasselementsbutton.sass 252:5 @import
[0] node_modulesbulmasasselements_all.sass 5:9 @import
[0] node_modulesbulmabulma.sass 5:9 @import
[0] stdin 60:9 root stylesheet
以下警告源自 rollup 复制插件,该插件仅用于开发将文件复制到 dist 文件夹。
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
2. 分享目的仅供大家学习和交流,请不要用于商业用途!
3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员!
8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载
声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性
GLB下载网 - GLB/GLTF模型与格式资源免费下载,支持在线浏览与转换 » glTF 2.0 中使用 WebGL 进行基于物理的渲染
常见问题FAQ
- 免费下载或者VIP会员专享资源能否直接商用?
- 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
- 提示下载要提取码
- 分享过期和重复下载怎么办
- 模型和平台不兼容怎么办
