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

0
votes
1answer
11 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
2answers
212 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 ...
3
votes
2answers
106 views

How to hide a post-processed mesh outline when/where the mesh is hidden

I'm working on setting up an active outline in my 3d engine, a highlight effect for selected 3d characters or scenery in the screen. After working with the stencil buffer and getting some ...
1
vote
1answer
110 views

White dots artifacts when applying borders to hex tiled geometry

I have a hexagon tiled geometry I created in Blender Which I then load in WebGL, using THREE.js library. Below is the loading code, I've cut the code of creating scene, lights, etc. I create ...
0
votes
1answer
62 views

WebGL color quantization

I'm making a WebGL game in a 90s DOS games style. I'm trying to use a shader which would quantize colors to get reduced colors look. I found this solution: Palette reduction to pre-defined palette, ...
0
votes
0answers
27 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 ...
5
votes
2answers
3k views

Rendering 2d sprites into a 3d world?

In opengl how do I render 2d sprites in opengl given that I have a png of the sprite? See images as an example of the effect I'd like to achieve. Also I would like to overlay weapons on the screen ...
0
votes
1answer
138 views

Is it possible or not to share a geometry among many meshes and apply a different shaderMaterial for each?

I instantiate one PlaneGeometry, then I instantiate 200 meshes sharing this geometry and with their own instance of a given shaderMaterial. Here is a simplified version of the code : ... var geom = ...
0
votes
1answer
37 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 ...
1
vote
1answer
353 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 ...
0
votes
0answers
25 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
25 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
46 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 ...
1
vote
1answer
141 views

Unexpected quaternion rotation behavior

First off let me apologize for the vague title but I really couldn't think of a more descriptive one (maybe after reading this a more advanced user might be able to edit it). Alright, so I have been ...
0
votes
1answer
69 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
vote
0answers
39 views

How can I center a WebGL window in Unity?

I have a WebGL build for my game, however, I'm getting frequent requests to center the image. Right now it is left justified. How can I center the WebGL game window?
0
votes
0answers
65 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?
-1
votes
1answer
87 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
0
votes
0answers
48 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 ...
1
vote
0answers
66 views

Cell Based Simulation

I'm working on a cell based simulation in a pixel shader (webgl, shadertoy.com specifically), but am having some challenges trying to make the simulation consistent. Each cell (pixel) has the ...
0
votes
1answer
1k 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
262 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 ...
2
votes
4answers
372 views

How can I scale up sprites but maintain visual quality?

I am using WebGL. I have an isometric grid which contains tiles. Some have 'tree' sprites on them. If I have my tree sprite loaded from a texture with a fixed resolution, when I zoom into the grid ...
2
votes
0answers
48 views

Virtual infinite plane in shadow map

I have a WebGL deferred rendering pipeline, where I'm rendering shadow map with VSM technique. The goal is that the scene, or model, is hovering in space, and in addition to casting shadow on itself, ...
2
votes
0answers
52 views

GPU Spatial Clustering

I have a around 100k points on the screen (that might update). 2D points. The goal is to cluster them into groups, by a constant distance. Meaning, finding groups of points that the distance between ...
3
votes
1answer
49 views

Timers and performance for mobile JS

I'm using the Three.js JavaScript library to do some things in WebGL, and I wonder how the graphic aspects of timers are done on mobile. I was creating numbers with geometries and just replacing them ...
1
vote
0answers
28 views

How to use quaternion on another referential

I'm new on Three.js and despite a mechanical background, I can't find how quaternion works: it's like it always refers on local part referential and not the global one. I've illustrated it here : ...
1
vote
1answer
126 views

Unity — custom shader behaves differently on WebGL deployment (correct) and editor view (incorrect)

I started working on shaders and lighting on Unity3D 5.2.1f1. I set up a scene where the sun object rotates the directional light (the only light in the scene) based on its position to simulate a ...
2
votes
0answers
61 views

Understanding webgl min/mag filter texture artifacts in orthographic projection?

Summary Flickering and shimmering of image plotted on a geometry where the viewport exceeds the size of the screen. I am using an orthographic projection for the camera. In this case, it is tied to ...
1
vote
0answers
19 views

Unstable behavior when applying impulse

I created a video that describes the problem since it very hard to explain it. Basically, using physi.js, I am applying random impulse on the object. In the video, at 0:17 the problem begins when the ...
6
votes
4answers
5k views

Can't understand these UV texture coordinates (range is NOT 0.0 to 1.0)

I am trying to draw a simple 3D object generated by Google SketchUp 8 Pro onto my WebGL app, the model is a simple cylinder. I opened the exported file and copied the vertices positions, indices, ...
1
vote
2answers
88 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) ...
2
votes
1answer
66 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
118 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
51 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
73 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 ...
0
votes
2answers
159 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
2answers
467 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 ...
1
vote
2answers
716 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 ...
5
votes
2answers
506 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 ...
3
votes
0answers
330 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
1answer
167 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
1answer
253 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
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, ...
5
votes
2answers
971 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 ...
1
vote
0answers
42 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
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() ...
1
vote
1answer
106 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 ...
17
votes
3answers
7k views

Is there a way to use an arbitrary number of lights in a fragment shader?

Is there a way to pass an arbitrary number of light locations (and colors) for the fragment shader, and loop over them in the shader? If not, then how are multiple lights supposed to be simulated? ...
0
votes
1answer
291 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 ...