WebGL

What is the mipmapping and Power-of-Two error?

天大地大妈咪最大 提交于 2021-01-25 07:00:36
问题 I run into this error when I set a non-power of to image on webGL: Error: WebGL warning: drawArrays: TEXTURE_2D at unit 0 is incomplete: Mipmapping requires power-of-two sizes. Note, I am currently learning webGL. I have notice that when I use a Power-of-Two image every thing works fine. gl.bindTexture(gl.TEXTURE_2D, texture); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, this); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); All I want to do is learn to

three.js中的文字

坚强是说给别人听的谎言 提交于 2021-01-23 10:59:53
1.三维文字    三维字体文字,使用的是 FontLoader ,字体文件通过来 facetype.js 生成 addCityText: function () { var self = this ; var citys = self.citys[self.mapname]; var group = new THREE.Group(); group.name = "cityname" ; // 载入字体 var loader = new THREE.FontLoader(); loader.load( "../assets/fonts/FZLanTingHeiS-UL-GB_Regular.json", function (font) { // 创建文字 for (city of citys) { var textGeo = new THREE.TextGeometry(city.name, { font: font, size: 1.4 , height: 0.6 , weight: 'bold' , }); var txtMater = new THREE.MeshBasicMaterial({ color: 0xffffff }); var textMesh = new THREE.Mesh(textGeo, txtMater); textMesh.name =

sdf 渲染文字在three.js中

早过忘川 提交于 2021-01-23 09:07:18
sdf 渲染文字在three.js中 最终效果: 上面是 SDF文字贴图,下面是在webgl中渲染。 实现 使用 tiny-sdf 制作sdf文字贴图。 在场景中渲染,核心类: /** * 生成SDF标签 */ class LabelSDF { constructor ( { height , content } ) { const bufferF = 8 ; // 影响生成文字图片的分辨率 const fontSize = 256 ; const fontWidth = fontSize + ( fontSize / bufferF ) * 2 ; const width = height * content . length ; this . textInfo = this . getSDF ( content , fontSize , bufferF , fontWidth ) ; const geo = this . getGeo ( width , height , fontWidth , this . textInfo , content ) ; const mat = this . getMat ( this . textInfo ) ; const mesh = new THREE . Mesh ( geo , mat ) ; this . mesh =

LightningChart JS Angular图表使用示例

萝らか妹 提交于 2021-01-21 09:38:38
LightningChart JS是Web上性能最高的图表库具有出色的执行性能 - 使用高数据速率同时监控数十个数据源。 GPU加速和WebGL渲染确保您的设备的图形处理器得到有效利用,从而实现高刷新率和流畅的动画。非常适合用于贸易,工程,航空航天,医药和其他领域的应用。 下载LightningChart JS最新试用版https://www.evget.com/product/4189/download LightningChart ® JS角使用示例 这个仓库陈列柜如何LightingChart整合® JS图表库为角应用。 有关LightningChart更多信息® JS可以从我们的网站上,可以找到https://www.arction.com/lightningchart-js/。 该项目是使用Angular CLI版本8.3.6生成的。 开发服务器 ng serve为开发服务器运行。导航至http://localhost:4200/。如果您更改任何源文件,该应用程序将自动重新加载。 代码脚手架 运行ng generate component component-name以生成一个新组件。您也可以使用ng generate directive|pipe|service|class|guard|interface|enum|module。 建立 运行ng build以构建项目

Why WebGL is faster than Canvas?

拜拜、爱过 提交于 2021-01-21 07:47:14
问题 If both use hardware acceleration (GPU) to execute code, why WebGL is so most faster than Canvas? I mean, I want to know why at low level, the chain from the code to the processor. What happens? Canvas/WebGL comunicates directly with Drivers and then with Video Card? 回答1: Canvas is slower because it's generic and therefore is hard to optimize to the same level that you can optimize WebGL. Let's take a simple example, drawing a solid circle with arc. Canvas actually runs on top of the GPU as

WebAssembly

爷,独闯天下 提交于 2021-01-17 20:43:32
WebAssembly From Wikipedia, the free encyclopedia Jump to navigation Jump to search WebAssembly Paradigm Imperative , structured , expression-oriented Designed by W3C Developer W3C Mozilla Microsoft Google Apple First appeared March 2017 ; 3 years ago Typing discipline Static License Apache License 2.0 Filename extensions .wat .wasm Website webassembly.org Influenced by asm.js PNaCl WebAssembly (often shortened to Wasm ) is an open standard that defines a portable binary-code format for executable programs , and a corresponding textual assembly language , as well as interfaces for facilitating

支付宝App 3D动画和小游戏背后的故事

故事扮演 提交于 2021-01-10 04:36:59
3D动画和游戏一直是前端领域的难点,支付宝App从2017年春节推出AR红包开始,一直在Web3D领域进行探索和实践。本文将以亲历者的角度,为你讲述这段不断探索和自我突破的经历。 文 / 曾柏然 很荣幸到了五年陈,我做的工作一直和Web3D相关,从头到尾经历了支付宝Web3D发展。本文把这段经历记录下,从技术和业务两方面分析,支付宝Web3D是如何在集团技术中逐渐上位的,并且尝试推演未来的各种可能性。 初生牛犊不怕虎 2016年底,一款Pokemon go的手机AR游戏爆火,大家开始在现实生活中捕捉自己的宝可梦,AR的概念也因此进入大众视野。 也许是受到Pokemongo的启发,2017年春节,支付宝推出了AR红包,大家扫周围的环境,就能发现朋友藏的红包。产品中红包是一个3D模型,虽然是2016年,但是在支付宝里面做3D动画渲染,这还是第一次。 当年的AR红包是多个团队完成的,图像识别是写客户端代码团队实现的,而红包动画是前端团队实现的。其实当时红包动画是由一位游戏开发大佬通过C代码实现的,但这位大佬所在的团队是前端团队。新春之后,前端自然有发展3D渲染的打算,但是客户端团队出于各种的考虑并不想把AR的3D渲染交出去,所以支付宝当时3D渲染分成两条线发展,客户端做AR和3D渲染技术,而前端开始了真正意义上的Web3D探索,他们的代码是纯净的JS

Cesium入门1

与世无争的帅哥 提交于 2021-01-08 20:47:03
Cesium入门1 - Cesium介绍 Cesium中文网: http://cesiumcn.org/ | 国内快速访问: http://cesium.coinidea.com/ Cesium简介 Cesium官网: https://cesiumjs.org 官网中标题写到: An open-source JavaScript library for world-class 3D globes and maps Cesium是一款开源的基于JavaScript的3D地图框架。其实他就是一个地图可视化框架 官网中描述写到: CesiumJS is a geospatial 3D mapping platform for creating virtual globes. Our mission is to create the leading web-based globe and map for visualizing dynamic data. We strive for the best possible performance, precision, visual quality, ease of use, platform support, and content. CesiumJS 是一款用于创建虚拟场景的3D地理信息平台。目标是用于创建以基于Web的地图动态数据可视化

WebGL/OpenGL text labeling animated instanced shapes

风流意气都作罢 提交于 2021-01-07 02:55:06
问题 I'm rendering a variable number of circles in the plane with variable size, color, and position using instancing. I'm hoping to reach on the order of 10k-100k circles/labels. in float instanceSize; in vec3 instanceColor; in vec2 instanceCenter; The buffer backing the instanceCenter attribute changes every frame, animating the circles, but the rest is mostly static. I have a quad per circle and I'm creating the circle in the fragment shader. Now I'm looking into labeling the shapes with labels

WebGL/OpenGL text labeling animated instanced shapes

廉价感情. 提交于 2021-01-07 02:54:28
问题 I'm rendering a variable number of circles in the plane with variable size, color, and position using instancing. I'm hoping to reach on the order of 10k-100k circles/labels. in float instanceSize; in vec3 instanceColor; in vec2 instanceCenter; The buffer backing the instanceCenter attribute changes every frame, animating the circles, but the rest is mostly static. I have a quad per circle and I'm creating the circle in the fragment shader. Now I'm looking into labeling the shapes with labels