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
vote
0answers
384 views

How can I compute spotlight attenuation when I only have a spotlight cutoff angle?

I am trying to compute the spot light attenuation, though I don't have a spotCosCutoff (cosine of the spotlight cutoff angle) predefined variable in the shader so I have to compute it myself. This is ...
1
vote
0answers
85 views

Textures occasionally rendering twice on a particular face [closed]

I am learning how to render 3D objects using webgl (no third-party libraries). I am currently facing a very confusing situation however, where my textures are rendering apparently twice over a ...
1
vote
0answers
169 views

Is there an out-of-the-box way to create a custom non-convex polygon in three.js?

Does Three.js offer an out-of-the-box way to create custom non-convex polygon, or do I have to use THREE.Geometry and set faces manually? I'm guessing that ShapeGeometry has something to do with this, ...
1
vote
2answers
767 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 ...
0
votes
2answers
6k views

Best physics engine for OpenGL ES (different implementations)? [closed]

Can you recommend a good physics engine which is easily portable between WebGL and other OpenGL ES implementations like in Android and iPhone? I don't want a game engine. Only the physics part.
0
votes
1answer
410 views

Unity 3D error when compiling to WebGL: Destination directory not found

When I try to compile my Unity project to WebGL in Development mode on Windows 8.1 (and with the latest version of Unity), I receive the following errors (the first one is truncated because it's ...
0
votes
1answer
316 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
189 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 ...
0
votes
1answer
203 views

Why are some of my normals facing away from the camera?

I'm trying to use WebGL to render some simple models, and I'm running into issues where pixels near the edge of my model are passing normals to my fragment shader that point away from the camera. This ...
0
votes
2answers
198 views

Need to know the origin and coordinates for 2d texture and 2d/3d vertices in webgl

Long story short, I know my coordinates are off and I believe my indices might be off. I'm trying to render a simple 2d rectangle with a texture in webgl here's the code I have for the vbo/ibo: ...
0
votes
1answer
237 views

3d immersive Virtual Conference meeting environment development on the web (3d website)-Help required [closed]

I want to develop 3d immersive virtual collaborative conference meeting environment on the web i.e an immersive virtual environment for our university Teachers to attend and address conference (...
0
votes
1answer
41 views

WebGL Redirecting URL

If player's browser don't support WebGL, I want to redirect Web Player version. I think it's possible in UnityLoader.js file but how? function CompatibilityCheck(){hasWebGL?mobile?confirm("Please ...
0
votes
1answer
34 views

Webgl, weird rendering with sprite that has alpha

So I have a webgl application where I render all kinds of objects, but in this specific example, I have two shaders. One that renders sprites and one that renders colored polygons. In this example I ...
0
votes
1answer
45 views

How to display a lot of small objects using WebGL?

Introduction The game scene contains a lot of 10x10 pixel elements: for 1980x1200 px. screen the number of elements on the scene can vary from 0 to 23760 (elements cannot intersect). The live ...
0
votes
1answer
2k views

Unity WebGL not loading on chrome

I've made a simple game but when I tried to load this on chrome its not loading. I am building for WebGL (HTML 5). I am getting these errors when the page loads. Unity version - 5.3.1f1 Chrome ...
0
votes
1answer
119 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
1k 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
122 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 ...
0
votes
1answer
67 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 I'...
0
votes
1answer
163 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 ...
0
votes
1answer
139 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 ...
0
votes
1answer
322 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
688 views

First person camera world matrix issue (in THREE.js and webGL)

I'm trying to create a Portal-like effect in webGL using THREE.js. I have two scenes connected by a pair of portals. The view of the 2nd scene in rendered inside the 1st portal using stencils and ...
0
votes
1answer
152 views

How would one outline an alpha transparency layer in javscript and/or php? [duplicate]

I simply want an outline/edge detection of the character/item/object that is selected or doing something. I'm seeing lots of versions of this question for different languages, but I would appreciate ...
0
votes
1answer
489 views

best way of rendering more 3D models in three.js that not slow down page?

I am in the way of creating a 3D web game using threeJS library. This is a multi-player game that players are 3D human models in game, and I need to add a human 3D model for each player that enters ...
0
votes
1answer
2k views

How can I implement 3D textures using webgl?

I went through the google I/O video but did not get exactly how to do it. If somebody could point me to a simple 3D texture implementation using webgl, it would be helpful. i basically have a volume, ...
0
votes
3answers
2k views

How do I create menu with text in OpenGL?

How would I go about creating a menu system with fonts in OpenGL? I want to make a dungeon crawler and will need a menu for inventory and stats for the weapons. I can draw a world made out of blocks ...
0
votes
0answers
17 views

OpenGL: Does it make sense to use an Index Buffer With GL_TRIANGLE_FAN?

When trying to draw circles in webGl (You can answer the question even in openGl terms, I'll understand both), I came across the TRIANGLE_FAN flag when calling either glDrawArrays (with only a vertex ...
0
votes
1answer
34 views

Webgl: is possible to use one color buffer to unsharp masking the depth buffer?

I'm noob to webgl. After reading the tutorials at webglfundamentals.org and "Introduction to Computer Graphics", i'm able to succesfully draw some stuff and the depth buffer without thirty-party ...
0
votes
0answers
22 views

Emscripten / webgl lazy rendering?

I compiled existing opengl es 2.0 code to webgl using emscripten. In the desktop version there is lazy rendering mechanism that only renders when required which is basically just saying invalidate ...
0
votes
0answers
78 views

Cannot load native dll in Unity webgl build

I'm trying to use NAudio to get a mp3 (using WWW) into an Audioclip. The thing is NAudio uses Msacm32.dll which I tried adding to the project, but the webgl build still cannot find it. The standalone ...
0
votes
0answers
39 views

How to implement mesh subtraction with user interaction in real-time?

I am trying to perform a subtraction on 2 mesh files imported from objloader using THREE.js and ThreeCSG but it is not working as long as the objects are too big or not closed or it will be so slow. ...
0
votes
0answers
35 views

Access Unity Webgl output from browser and vice versa

I receive a package of Unity webgl and put that into a course in Wordpress. The index.html produced form Unity is accessed inside an iframe there. This must be able to count user click when accessing ...
0
votes
0answers
102 views

Unreal Engine - Why is the size of even the most minimal HTML5 project ~ 155 MB?

I created a new project in UE4 (ver 4.10.4) with "no starter content" and "scalable to 2D/3D" settings. Essentially, there are a total of 5 assets in the project 1) floor, 2) light source, 3) sky ...
0
votes
0answers
110 views

Unity3D - Upload a image from PC memory to WebGL app

I need user to upload his(her) avatar picture from PC to game How can I create a file dialog and upload a image to WebGL game?
0
votes
0answers
77 views

Parse RestAPI in Unity WebGL build not working on Google Chrome

I am trying to integrate Parse in Unity Webgl build. As there is no specific SDK for WebGL provided by parse so for parse communication i am using RestAPI to Get the data from parse. As provided in ...
0
votes
0answers
172 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
61 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
42 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, 0,...
0
votes
2answers
180 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 ...
0
votes
1answer
372 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
688 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]); mat4.rotate(mat.mvMatrix,degToRad(-camera.yaw),[0,1,0]);...
0
votes
0answers
32 views

Strauss model : no specular component [duplicate]

I implemented the Strauss model with the metalness, transparency and smoothness parameters, taking the formulas from the book "Programming vertex geometry and pixel shaders", this is how I implemented ...
0
votes
1answer
1k views

Having a problem with texturing vertices in WebGL, think parameters are off in the image?

I'm having a problem texturing a simple rectangle in my WebGL program, I have the parameters set as follows: gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, textureImage); I'm ...
0
votes
1answer
419 views

WebGL CORS error loading simple texture in Chrome

Here's my code: function loadTexture() { textureImage = new Image(); textureImage.onload = function() { setupTexture(); } textureImage.src = "jumper2.png"; } function ...
0
votes
0answers
33 views

How do i draw a volume cube and fill it up with a 3D texture in webgl? [duplicate]

Possible Duplicate: How can I implement 3D textures using webgl? I have a set of (x-y) images of the cross-section of an object varying along the z-dimension. From that i have to construct a ...
0
votes
1answer
186 views

unity webgl not working on server

I own the servers of hokuco.com, I am wondering why my test build(not a development build) is not working in webgl I tried a test run as a .exe and it works fine. here is the url to my webgl project, ...
-1
votes
4answers
4k views

How can I use WebGL to create a tile-based multi-layer scrolling platform game?

I've found WebGL (based on OpenGL) to be a fiendish and unforgiving framework for those learning to write HTML5-based games. Despite the presence of many examples on how to get started, I'm really ...
-1
votes
1answer
145 views

WebGL - Open URL in new tab? [closed]

How to open URL in new tab for WebGL? Tried Application.OpenURL("url"). But it's opens a tab in same window Thanks
-2
votes
1answer
377 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: ...