WebGL

Is it possible to use WebGL max texture size?

僤鯓⒐⒋嵵緔 提交于 2019-12-30 06:38:30
问题 I am working on an app where higher resolution is always better. But I'm stuck with WebGL max_texture_size problems. I create an image of size exactly this dimension (16384x16384 on my laptop) and WebGL crashes saying that: GL_INVALID_ENUM : glBindFramebuffer: target was GL_READ_FRAMEBUFFER_ANGLE GL_INVALID_ENUM : glBindFramebuffer: target was GL_READ_FRAMEBUFFER_ANGLE WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost And the same happen when I try with 0.75 of the max values. Only working

How do we handle webgl context lost event in Three.js

◇◆丶佛笑我妖孽 提交于 2019-12-30 06:17:46
问题 I want to handle a lost context event in Three.js. There is a nice documentation about that here but unfortunately it doesn't work when I apply it to my renderer.domElement . I try to lose the context by clicking and some variable in loseContext() are undefined. I guess the structure is different in Three.js. Any expert? 回答1: You should be able to do something like this about the renderer was initialized and assuming of course that the variable you stored the renderer into is named 'renderer'

Which WebGL framework should i learn? [closed]

柔情痞子 提交于 2019-12-30 04:34:05
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I find a framework list on http://www.khronos.org/webgl/wiki/User_Contributions#Frameworks However, what is different of them? I read some article said, WebGL is driven by low level language, WebGL Framework just make it to high level language to easy implementation. I am

Three.js First Person Controls

被刻印的时光 ゝ 提交于 2019-12-30 04:10:11
问题 I'm playing around with Three.js and WebGL and can't quite get the controls the way I want. I chose to try to "roll my own" controls since Three.js's FirstPersonControls do not use pointer lock. Anyway, I took most of my code from the built-in FirstPersonControls, converted it to use pointer lock ( movementX instead of pageX - offset ), but I am having trouble smoothing the look motion. Here is my onMouseMove (using originalEvent since it is a jquery event): onMouseMove: function(e) { if(

WebGL/GLSL - How does a ShaderToy work?

◇◆丶佛笑我妖孽 提交于 2019-12-29 10:09:11
问题 I've been knocking around Shadertoy - https://www.shadertoy.com/ - recently, in an effort to learn more about OpenGL and GLSL in particular. From what I understand so far, the OpenGL user first has to prepare all the geometry to be used and configure the OpenGL server (number of lights allowed, texture storage, etc). Once that's done, the user then has to provide at least one vertex shader program, and one fragment shader program before an OpenGL program compiles. However, when I look at the

WebGL/GLSL - How does a ShaderToy work?

萝らか妹 提交于 2019-12-29 10:09:08
问题 I've been knocking around Shadertoy - https://www.shadertoy.com/ - recently, in an effort to learn more about OpenGL and GLSL in particular. From what I understand so far, the OpenGL user first has to prepare all the geometry to be used and configure the OpenGL server (number of lights allowed, texture storage, etc). Once that's done, the user then has to provide at least one vertex shader program, and one fragment shader program before an OpenGL program compiles. However, when I look at the

How to repeat the texture map like GL_REPEAT?

蓝咒 提交于 2019-12-29 07:36:15
问题 I have a house model in my game, and I have some materials for the house geometry. There is a material for the wall of the house, and I have a texture-map-image to show the bricks. var mat = new THREE.MeshPhongMaterial( { ambient: 0x969696, map: THREE.ImageUtils.loadTexture( 'textures/G/G0.jpg' ), overdraw: true,combine: THREE.MultiplyOperation } ); In this way above, the texture map appears like GL_CLAMP I want it to show like GL_REPEAT . What should I do? If you can not see the images check

Wireframe shader - Issue with Barycentric coordinates when using shared vertices

此生再无相见时 提交于 2019-12-29 06:31:36
问题 I'm working on drawing a terrain in WebGL. The problem is that I'm only using 4 vertices to draw a single quad by using indices to share vertices. So I can't upload unique baricentric coordinates for each vertex, because it's shared. Here's a picture that shows the problem more clearly. There's no barycentric coordinate that I can use for the question mark. (0,1,0) is used top left, (0,0,1) is used above and (1,0,0) is used to the left. So there's absolutely no way I can do this when I'm

Chrome Heap Snapshot - Why it doesn't show all the memory allocated?

半腔热情 提交于 2019-12-29 04:34:08
问题 I'm running some memory usage tests in a WebGL project that I have. If I start the page on Google Chrome and take a heap snapshot on the Profiles tab of Developers Tool, it will say that my page is holding 7.5 MB. The problem is if I look into Task Manager, the real value that it is using is almost 1 GB! It is expected, since I am really forcing the page to have thousands of objects, but the question is: why Chrome shows to me that I am using only 7.5 MB? 回答1: update there was native memory

“Tainted canvases may not be loaded” Cross domain issue with WebGL textures

一世执手 提交于 2019-12-28 04:21:07
问题 I've learnt a lot in the last 48 hours about cross domain policies, but apparently not enough. Following on from this question. My HTML5 game supports Facebook login. I'm trying to download profile pictures of people's friends. In the HTML5 version of my game I get the following error in Chrome. detailMessage: "com.google.gwt.core.client.JavaScriptException: (SecurityError) ↵ stack: Error: Failed to execute 'texImage2D' on 'WebGLRenderingContext': Tainted canvases may not be loaded. As I