WebGL

WebGL: Particle engine using FBO, how to correctly write and sample particle positions from a texture?

帅比萌擦擦* 提交于 2019-12-08 09:59:01
问题 I suspect I'm not correctly rendering particle positions to my FBO, or correctly sampling those positions when rendering, though that may not be the actual problem with my code, admittedly. I have a complete jsfiddle here : http://jsfiddle.net/p5mdv/53/ A brief overview of the code: Initialization: Create an array of random particle positions in x,y,z Create an array of texture sampling locations (e.g. for 2 particles, first particle at 0,0, next at 0.5,0) Create a Frame Buffer Object and two

webgl doesn't work on crosswalk framework for Android

大憨熊 提交于 2019-12-08 09:33:36
问题 I've trying all the samples of the Crosswalk engine and also compiled myself the sample project but I couln't make WebGl work in Crosswalk And it suposes to work Here is the tutorial I've been following http://software.intel.com/en-us/android/blogs/2014/01/02/developing-android-apps-using-intel-xdk-and-threejs with the apk at the bottom Also here I've downloaded the sample and compiled it myself https://download.01.org/crosswalk/releases/crosswalk-samples-0.1.tgz I tryed with the development

What are maximum dimensions of Three.js render canvas?

这一生的挚爱 提交于 2019-12-08 09:06:45
问题 When I set render canvas size to ~4000x4000px it's ok, however starting from around 4000 (tested 5k, 6k, 8k) it seems that scene is "cut off" in some way. See image below: So up to ~4k content is properly rendered in the center of canvas and for higher canvas sizes it cuts the content. Is it a Three.js/WebGL limitation? If yes then what are actual maximum canvas dimensions that don't cause any "deformations"? Is there anything I can do about it? I need to get canvas snapshot in high

hazy artefact on OS X WebGL on sides of volume rendering

倖福魔咒の 提交于 2019-12-08 08:52:26
问题 Does anyone know how to sort this weird effect? The sides of the volume we're trying to render seem artificially hazy. I'm running it on 2014 MacBook Pro, Intel Iris 1536 MB GPU, Yosemite v 10.10.2 (14C1514). I've heard that this is only a problem on machines running OS X, and it doesn't appear on Windows machines. I've also noticed it in some other places e.g. Leberba 回答1: khronos.org/bugzilla/show_bug.cgi?id=1337 Bug reported so closing 来源: https://stackoverflow.com/questions/29493673/hazy

How many textures can I use in a webgl fragment shader?

烂漫一生 提交于 2019-12-08 07:10:43
问题 Simple question but I can't find the answer in a specification anywhere. I'm probably missing the obvious answer somewhere. How many textures can I use at once in a WebGL Fragment shader? If it's variable, what is a reasonable number to assume for PC use? (Not so interested in mobile). I need at least 23 in one of my shaders so want to know if I'll be able to do that before I start work on the code or if I'll need to do multiple passes. 回答1: I'm pretty sure you can find out with var

How to embed a HTML page in webvr

帅比萌擦擦* 提交于 2019-12-08 07:05:05
问题 I have gone through the link "http://learningthreejs.com/blog/2013/04/30/closing-the-gap-between-html-and-webgl/", But I need not to add the texture instead I need that to be interactive like a webpage. So that i can go and play the inner pages also. 回答1: From the A-Frame FAQ: There is no direct way for the browser to display HTML or iframes within WebGL. While it is possible to overlay HTML elements or iframes on top of the canvas, they will not display in VR nor can it integrate with the

Multiple Programs in WebGL doesn't work

微笑、不失礼 提交于 2019-12-08 07:02:33
问题 I'm trying to use multiple shader programs in webgl but continue to get issues. It seems that if i have a different number of vertex shader attributes in programs then i get nothing rendered with no errors. Is there some constraint that means that programs have to have the same number of attributes? Do i need to disable/enable attribute locations when changing programs? It seems that just creating multiple programs causes the issue ( i dont even have to use the second shader, just the fact

webGL alternatives on Android

家住魔仙堡 提交于 2019-12-08 05:06:29
问题 As Android WebKit does not natively support webGL yet (true?) I am looking forward to emulate webGL in an embedded WebKit app. Are there any bindings which would expose OpenGL ES Java interfaces to Javascript in a manner it could be even close to webGL? 回答1: FYI: Firefox for Android does support WebGL. It's not the fastest, but it does work. 回答2: Not quite what you're looking for, but maybe this could help you: http://processingjs.org/ It's ProcessingJS, based on processing (http://processing

Updating width and height of render target on the fly

故事扮演 提交于 2019-12-08 05:00:52
问题 I've created a texture and a renderbuffer to render an existing 3d scene to a texture, and using that texture as an input for another webgl program. Below is pseudo code of the class that handles rendering the scene to a texture. What's the best way to update the texture width and height as needed (if a browser resize happens for example)? Do I need to create a new texture / render buffer every time ? I'm wondering if I can do this with less code than I'm currently doing? class Renderer {

Issue with Terrain Collision using Three.js

一笑奈何 提交于 2019-12-08 03:49:07
问题 I have created a terrain via a heightmap in Three.js and am using mrdoob's misc_controls_pointerlock for collision and movement. However, when I do objects.push(terrainobj); the performance goes down to about 3fps (from around 60) and there is no collision with the terrain. The collision is achieved via rays. How can I get around this? 回答1: If it's just a heightmap you could avoid using ray and do the collision checking right in the bitmap (using canvas and imagedata). You just need to