分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

webgl学习路线总结

发布时间:2023-09-06 01:41责任编辑:郭大石关键词:暂无标签
API:
https://developer.mozilla.org/zh-CN/docs/Web/API/WebGL_API
WebGL 3D Perspective:
https://webglfundamentals.org/webgl/lessons/zh_cn/webgl-3d-orthographic.html#toc
https://webglfundamentals.org/webgl/lessons/webgl-3d-perspective.html
webgl-examples:
https://github.com/mdn/webgl-examples/
一个使用方便的 JavaScript处理向量和矩阵运算的库。sylvester:
http://sylvester.jcoglan.com/docs.html
性能监视器(监视FPS):
https://github.com/mrdoob/stats.js
动画引擎
https://github.com/tweenjs/tween.js
 
顶点着色器根据需要, 也可以完成其他工作。例如,决定哪个包含 texel面部纹理的坐标,可以应用于顶点;通过法线来确定应用到顶点的光照因子等。依此类推,这些信息可以存储在变化(varying)或属性(attributes)属性中,以便与片段着色器共享
<script id="shader-vs" type="x-shader/x-vertex"> ?????attribute vec3 aVertexPosition; ?????attribute vec4 aVertexColor; ?????????uniform mat4 uMVMatrix; ?????uniform mat4 uPMatrix; ???????????varying lowp vec4 vColor; ?????????void main(void) { ???????gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); ???????vColor = aVertexColor; ?????} ???</script>

  等价于:

` ?????attribute vec3 aVertexPosition; ?????attribute vec4 aVertexColor; ?????????uniform mat4 uMVMatrix; ?????uniform mat4 uPMatrix; ???????????varying lowp vec4 vColor; ?????????void main(void) { ???????gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); ???????vColor = aVertexColor; ?????} ???`

  等价于:

[ "attribute vec3 aVertexPosition;", "attribute vec4 aVertexColor;", "uniform mat4 uMVMatrix;", "uniform mat4 uPMatrix;", "varying lowp vec4 vColor;", "void main(void) {", ?"gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);", ?"vColor = aVertexColor;", "}"].join( "\n" );

  

webgl学习路线总结

原文地址:https://www.cnblogs.com/guxingzhe/p/8425382.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved