Questions tagged [webgl]

WebGL extends the capability of the HTML canvas element to allow it to render accelerated graphics in any compatible web browser. **DO NOT TAG QUESTIONS ABOUT 3D LIBRARIES (like THREE.js) WITH THIS TAG** unless the question is specifically about a WebGL API feature. **DO NOT TAG QUESTION ABOUT UNITY WEBGL WITH THIS TAG!!**

Filter by
Sorted by
Tagged with
160
votes
8answers
57k views

Learning WebGL and three.js [closed]

I'm new and starting to learn about 3D computer graphics in web browsers. I'm interested in making 3D games in a browser. For anyone who has learned both WebGL and three.js... Is knowledge of WebGL ...
143
votes
9answers
95k views

Is there any reason for using WebGL instead of 2D Canvas for 2D games/apps?

Is there any reason, except performance, for using WebGL instead of 2D-Canvas for 2D games/apps? In other word what 2D functionalities are offered by WebGL which are not possible to achieve easily ...
90
votes
4answers
52k views

In WebGL what are the differences between an attribute, a uniform, and a varying variable?

Is there an analogy that I can think of when comparing these different types, or how these things work? Also, what does uniforming a matrix mean?
72
votes
6answers
85k views

How to stop a requestAnimationFrame recursion/loop?

I'm using Three.js with the WebGL renderer to make a game which fullscreens when a play link is clicked. For animation, I use requestAnimationFrame. I initiate it like this: self.animate = function()...
71
votes
5answers
37k views

Javascript Typed Arrays and Endianness

I'm using WebGL to render a binary encoded mesh file. The binary file is written out in big-endian format (I can verify this by opening the file in a hex editor, or viewing the network traffic using ...
65
votes
1answer
41k views

What does `precision mediump float` mean?

In the learningwebgl tutorial1 I've found an interesting line in the fragment shader. precision mediump float; I've found an article about it here, but I still can't understand what does it mean? ...
63
votes
5answers
28k views

WebGL/GLSL - How does a ShaderToy work?

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 ...
61
votes
2answers
15k views

Rendering meshes with multiple indices

I have some vertex data. Positions, normals, texture coordinates. I probably loaded it from a .obj file or some other format. Maybe I'm drawing a cube. But each piece of vertex data has its own index. ...
60
votes
7answers
67k views

How to detect collision in three.js?

I am using three.js. I have two mesh geometries in my scene. If these geometries are intersected (or would intersect if translated) I want to detect this as a collision. How do I go about ...
60
votes
1answer
2k views

Interior Mapping shader self shadowing

I'm tinkering with Joost van Dongen's Interior mapping shader and I'm trying to implement self-shadowing. Still I couldn't quite figure out what coordinates shadow casting light vectors need to be in. ...
59
votes
5answers
11k views

Improved Area Lighting in WebGL & ThreeJS

I have been working on an area lighting implementation in WebGL similar to this demo: http://threejs.org/examples/webgldeferred_arealights.html The above implementation in three.js was ported from ...
58
votes
4answers
17k views

Is it important to call glDisableVertexAttribArray()?

I'm not entirely clear on the scope of enabling vertex attrib arrays. I've got several different shader programs with differing numbers of vertex attributes. Are glEnableVertexAttribArray calls local ...
56
votes
4answers
48k views

How do I learn WebGL the fast way? [closed]

I am learning WebGL these days, but I found that it's really hard to understand the pipeline. Is there any head first WebGL tutorial online ? Should I learn GLSL ? The code to draw something with ...
55
votes
7answers
50k views

Proper way to detect WebGL support?

I am attempting to detect WebGL support across multiple browsers and I've encountered the following scenario. The current version of Firefox appears to report positive support using the following ...
50
votes
4answers
31k views

SceneJS vs Three.JS vs others [closed]

Pros and cons anyone? Couldn’t find a complete feature set for three.js library. Though I do know it’s popular and in active development. Maybe someone have done some R&D on WebGL engines and can ...

15 30 50 per page
1
2 3 4 5
412