WebGL is a Javascript API for rendering interactive 3D / 2D graphics on the HTML5 canvas element. It is based on OpenGL ES 2.0.

learn more… | top users | synonyms

-1
votes
0answers
12 views

Bablylon.js and WebSockets [on hold]

Does anyone have any pointers to work done using babylon.js as a way of veiwing real-world data? We have a variety of real sensors are sending motion, location, and visual clues via WebSockets. We ...
0
votes
0answers
15 views

Unity WebGL or WebPlayer? [on hold]

The last time I tried WebGL (a couple of months ago), it ran at 30x lower framerate than webplayer, took forever to build, and had increased build size. Since then, I haven't seen significant work ...
0
votes
1answer
21 views

Create a WebGL native plugin

I am trying to create a WebGL plugin and I read in the docs here: http://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html But I'm not sure I understand. I created a file in ...
2
votes
1answer
36 views

WebGL - send part of texture to GPU

I have a matrix of pixels in RAM memory, e.g. 1000x1000 pixels. I send it to GPU using gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1000,1000, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels); Which works great. ...
0
votes
0answers
7 views

Error while running Unity WebGL build on MAMP localhost

I have built my game for WebGL platform and tried to run it on MAMP localhost. I am getting the following alert message in Google Chrome (Version 44.0.2403.125 (64-bit)) and in Safari (Version 8.0.3 ...
0
votes
0answers
18 views

Pass uniforms to Filter's shader

I wanna implement this shader (https://www.shadertoy.com/view/MslGWN#) in PhaserJS state. So i transformed the shader to WebGL style. I overload Phaser.Filter's update function to pass iChannel ...
0
votes
0answers
46 views

How to properly use large texture that is not power of 2?

I'm making a 2D game, rendered using WebGL (using ANGLE, which means that on Windows DirectX is actually used). This is desktop-only game, but would be great to be compatible with integrated graphics ...
1
vote
2answers
81 views

Applicaton.ExternalEval(String script)

I was wondering, if Application.ExternalEval(String script); in Unity3D can return something. Like:String playerName = Application.ExternalEval("prompt("Please enter your name", "player1")"); Thank ...
5
votes
2answers
200 views

Low quality bilinear sampling in WebGL/OpenGL/DirectX

I'm seeing low quality bilinear texture sampling in WebGL, OpenGL and Directx, and was wondering if anyone knew how to make it higher quality? The picture below should help show what I mean. The ...
1
vote
1answer
71 views

WebGL half float equivelant?

I'm trying to find a half float for the purposes of doing math in a fragment shader, not trying to have a half float texture. Is there an equivalent of the half float data type in WebGL? I know you ...
1
vote
2answers
44 views

WebGL Multiple Lights, Blending, and Render Order

I am trying to do simple forward rendering for multiple lights using additive blending in WebGL. Following advice from this SO and this one, I simply turn on blending using glBlendFunc(GL_ONE, GL_ONE) ...
0
votes
2answers
91 views

Fragment shader compiling in webGL but not in OpenGL

I am programming in Haxe (language compiling to multiple platforms) and I have written some shaders. My fragment shader runs fine in html5, but when I try to compile for native (OS X and/or Neko, a ...
1
vote
1answer
123 views

Techniques for drawing lines, with mouse, on 3D objects in WebGL or OpenGL?

Can anyone point me to techniques for drawing lines, with the mouse, on 3D objects in WebGL or OpenGL? Here's the effect I'm looking for, using WebGL: http://www.spacegoo.com/cadillac/ I can imagine ...
0
votes
0answers
34 views

Phaserjs, filters, save to image cache

I've tried to apply a Pixi filter to a image and save it to cache but the image doesn't get saved with the filter. colorMatrix = new PIXI.ColorMatrixFilter(); colorMatrix.matrix = [0,0.0,0.5,-0.2, ...
5
votes
2answers
733 views

How can I tell a fragment shader to not write a particular pixel?

In a WebGL I'd like to send a screen space quad through that gets processed by a fragment shader, but have the fragment shader only write out a pixel under certain conditions (say... that it was ...
3
votes
0answers
105 views

LibGDX's HTML project doesn't show anything in Browser

The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in ...
1
vote
0answers
39 views

Array of script class references in inspector

I'm trying to remove the Reflection part of ones of my scripts so it works in WebGL, however I am having some trouble. Basically I need a way to store references to classes in an Inspector array so ...
0
votes
2answers
91 views

WebGL techniques for normal mapping on morph targets?

I'm currently morphing some meshes by interpolating their positions and normals between target arrays, on the GPU, in WebGL. Now I need to apply normal maps to those morphs. For normal maps on ...
1
vote
1answer
77 views

How are CSS and WebGL coordinates related? [closed]

I'd like to build a simple framework which rendering combines web page DOM elements with WebGL, such that they're manipulable in the same coordinate space. How does the plain CSS coordinate system ...
0
votes
0answers
53 views

possible way to bring canvas 2d animation in canvas webgl context

when added 2d animation canvas in 3d webgl canvas as texture, 2d animation and 3d animation both stopped working. Any reference for this.
0
votes
1answer
183 views

WebGL (three.js) - rendering object behind camera far plane

I need to have one object that is always visible/rendered (a lens flare, to be exact). I don't want to set the camera far plane to the maximum possible distance between camera and the sun (performance ...
0
votes
1answer
83 views

JavaScript THREE.js webgl spotlight rendering

I'm playing with webgl/JavaScript/THREE and a spotlight. And I see unexpected results. And I don't understand what's going on, and I'm hoping you can point me in the right direction. In my particular ...
0
votes
2answers
360 views

Three.js: Lighting not calculating correctly on THREE.Geometry objects

I have a three.js (REVISION: '68') issue with the lighting of THREE.Geometry objects: I'm using the THREE.Geometry class to build up objects using vertices and faces, then I computeFaceNormals() ...
0
votes
1answer
73 views

Compress 16 bit raw data in webgl

I have a 3D volume where every voxel is 16 bits. Is there anyway I can use some kind of compression to store the data so I can use less video ram? Webgl supported different compressiosn if you enable ...
2
votes
1answer
152 views

How to implement user friendly screen panning on 3D HTML canvas for RTS game

How can I get RTS map panning like how it was done in C&C red alert (with the mouse at the edge of the screen moves the screen in that direction) with a Babylon.js RTS game in the html canvas? ...
0
votes
0answers
187 views

WebGL - Luminance textures from JPG images

Is there any way to create a WebGL texture with Luminance format from JPG image? JPG images have 3 color channels and luminance texture has only one channel. The problem is that gl.texImage2D can't ...
0
votes
1answer
61 views

How can I make a flapper game that scales to multiple aspect ratios?

So I've never made a game before besides a basic 4:3 aspect ratio flapper, so bare with me. Recently I had this wild idea that I wanted to make this complected (for a 2d) game in cca. Unfortunately ...
0
votes
1answer
121 views

Backface culling without light leaking through

I want to be able to see through walls, so to do this I used planes for the walls, and enabled backface culling. However with shadow mapping I have a lot of light leaking through: I read that using ...
4
votes
1answer
1k views

(Three.js) - What object3D properties are required to make rayCaster.intersectObjects() work?

FYI, i am trying to do something almost identical to the following: Merging geometry/mesh without losing benefits I essentially have a list of Three.object3D's. These objects are "merged" together ...
1
vote
0answers
59 views

WebGL stereo on Linux

Is there any way for us to use frame-sequential stereo with WebGL without having to boot into Windows and use the DirectX hack?
4
votes
2answers
120 views

Confused about Max Vertex Uniform Vector limit

While coding my WebGL app I've encountered an interesting phenomena: On my first PC (with GPU Radeon HD 5850), BrowserLeaks (link) tells me that in my browser - Google Chrome Version 36.0.1985.143m ...
3
votes
1answer
2k views

Orthographic Camera and Raycasting in Three.js

I'm working on a test project porting a simple game from iOS to Javascript. I've got the orthographic camera working and it can view the objects in the scene and move up and down the tower of meshes ...
0
votes
1answer
235 views

One draw call with one big mesh VS many draw calls with many little meshes

I have read that in order to optimize WebGL application, one should reduce an amount of draw calls. But does it mean that computing a one big mesh from all single meshes on CPU by modifying vertices ...
0
votes
1answer
1k views

Is HTML5/WebGL performance unreliable on low-end Android tablets and phones?

I've developed a couple of WebGL games, and am trying them out on Android. I found that they run very slowly on my tablet, however. For example, a game with 10 sprites or so runs as 5fps. I tried ...
2
votes
2answers
103 views

Linking one uniform variable to many shaders

Let's say, that I have 3 programs, and in each of those programs there is a view matrix uniform, which should be the same in all those programs. Right now, when my camera moves, I need to re-upload ...
2
votes
2answers
428 views

Strange if-else branching behavior in a fragment shader

In my fragment shader I have passed an uniform int uLightType variable, which indicates what type of light is in usage right now. The problem is that if-else branching does not work correctly - the ...
1
vote
2answers
494 views

Omni-directional light shadow mapping with cubemaps in WebGL

First of all I must say, that I have read a lot of posts describing an usage of cubemaps, but I'm still confused about how to use them. My goal is to achieve a simple omni-directional (point) light ...
1
vote
0answers
211 views

Adding rivers to procedural generated terrain [closed]

I have an heightmap generated using libnoise (c++). I am loading it from the babylon.js framework (3dWebGL). I have my heightmap image file and also a river position image file, also generated using ...
3
votes
2answers
242 views

10% idle time in WebGL

I'm using requestAnimationFrame to handle my frame rate in a WebGL game, and running through the Chrome profile shows that a solid 10% of the time is spent in (idle). Why is that? How can I reduce ...
-2
votes
1answer
179 views

List of GLSL ES built-in variables

I am writing an article on WebGL and three.js, I'm trying to search all the built-in variables available in the vertex and fragment shader. I've found many sites mentioning some, for example: ...
1
vote
0answers
347 views

How can I reduce draw calls when using glBufferSubData and DYNAMIC_DRAW?

At first I had the problem where I had about 150 rectangles rendered every tick. I only used STATIC_DRAW and glBufferData. I added support for DYNAMIC_DRAW and glBufferSubData and now I have a very ...
0
votes
1answer
126 views

WebGL wrong scaling of rectangle

I'm working with this tutorial http://www.html5rocks.com/en/tutorials/webgl/webgl_transforms/ and my result is, that the rectangle moves in the direction of it's scaling values, and also scales at ...
1
vote
1answer
266 views

GPU skinning algorithm incorrectly distorts mesh

I've been trying to implement a GPU-based matrix palette skinning algorithm with WebGL, but the rendering appears incorrect even though I can't find evident conceptual problems in the underlying ...
0
votes
1answer
124 views

bug in webgl phong shader: lighting rotates with object

I'm working on a simple phong shader in webgl, and I think I'm getting close but something is still wrong. Dead give away: if I have a billboard and have it roll (so it spins like a wheel), the part ...
1
vote
1answer
284 views

Custom lookAt function goes wild

I have written a custom lookAt function based on a lot of posts from all over the net, and it works very nice... except when a rotation (which is stored in a quaternion) crosses some 'threshold'. ...
1
vote
2answers
147 views

How to use blender files in your own engine?

It is not trivial to use your own shader on blender, so I've created a good-looking webgl shader. Now, what do I need to use the things I made in blender on it? An obvious first idea would be to parse ...
1
vote
1answer
602 views

How can I restrict the rotation of an object to a subset of axes using quaternions?

I've got a question about quaternions in my WebGL application. How can I rotate an object only around two axes? For example, how can I exclude/nullify rotation about the Y axis? The problem is that ...
0
votes
1answer
215 views

Strange quaternion camera streching in WebGL

So after a lot of researching about quaternions I almost got the quaternion camera working. Almost, cause it rotates in a proper way only in a vertical axis. Other rotations stretches and deforms the ...
0
votes
1answer
444 views

(WebGL) Point light per-fragment issue

I'm using an FPS-like camera, this is the code: CAMERA mat4.identity(mat.mvMatrix); mat4.rotate(mat.mvMatrix,degToRad(-camera.pitch),[1,0,0]); ...
2
votes
1answer
225 views

UV Texture coordinates out of [0,1] (WebGL)

I'm creating a 3D game with WebGL and i'm using Wavefront Objects as a base model format. I recently found some models, their texture coordinates of which are out of the typical [0,1] range and i ...