All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
75 views

When perspective division is necessary?

I'm very confused when it is necessary for a homogeneous coordinate (x, y, z, w) get divided by w (ie. converting to (x/w, y/w, z/w, 1)). According to this page, when a homogeneous vertex coordinate ...
1 vote
1 answer
178 views

OpenGL: Problem with lighting when rotating mesh

I'm drawing some static geometry (a sphere, a cube, etc.) together with some dynamic geometry (a rotating torus.) I can see that there is a problem because specular lighting on the torus is static and ...
  • 15.8k
0 votes
2 answers
100 views

Text Rendering Problem with Distance Field in WebGL

I made this Distance Field example with Qt OpenGL 3.3: It works very good. I made it using this video tutorial: OpenGL 3D Game Tutorial 33: Distance Field Text Rendering I rewrote this example line ...
0 votes
1 answer
228 views

Problem with normals when drawing instanced mesh

I'm rendering a sphere with instanced drawing, while rotating the model-view-matrix around the Y axis. It looks ok at the beginning: But at another angle, things get worse: It looks to me like a ...
  • 15.8k
1 vote
0 answers
59 views

Understanding "texImage/texSubImage upload scan cause pipeline flushes."

I'm trying to understand what Mozilla mean by "Prefer doing uploads before starting drawing, or at least between pipelines" when talking about texImage/texSubImage uploads in WebGL. As an ...
  • 541
0 votes
0 answers
138 views

difference between canvas and gl.canvas

in WebGL, we create a rendering context with const canvas = document.getElementById("#mycanvas"); let gl = canvas.getContext("webgl2"); in every operation I see people using gl....
0 votes
1 answer
104 views

Why are simple 2D shapes drawn in CAD editors in segments

After looking at some programs for 2d modeling, I noticed that all primitives are drawn as segments (see attached picture). For example, why is the circle drawn as a polygon? It seems to me that it is ...
  • 13
1 vote
1 answer
810 views

How does Chrome support webgl on macOS?

I found libGLESv2.dylib libswiftshader_libGLESv2.dylib libvk_swiftshader.dylib in Chrome.app. And in https://webglreport.com/?v=2 it says: Vendor: WebKit Renderer: WebKit WebGL Unmasked Vendor: ...
  • 1,414
0 votes
1 answer
359 views

2D Color Grid in GLSL Fragment Shader

I'm trying to achieve this pattern in GLSL: While getting that effect on the X axis is straightforward by scaling, using floor() and mix(): void main() { vec2 st = vTexCoord; float maxColumns = ...
-1 votes
1 answer
465 views

What are the use cases of sampler2D uniforms in WebGL / OpenGL? [closed]

Samplers goes into a little too much depth without use cases. What are the use cases of sampler2D (texture) uniforms in a vertex shader? Are they used to pass data in ever, or what do you use them for ...
  • 71.5k
1 vote
1 answer
1k views

Draw image with OpenGL

How to draw video/image over map (GMap.Net) with open OpenGL/OpenTK (video from drone) My question is how to draw video image on map since video can be looked with different angle on map and image ...
  • 103
1 vote
0 answers
328 views

How many times vertex shader is called, if I use 4 vertices and 6 indices to create a quad? [duplicate]

I am trying to assign unique id for each vertex being processed by the vertex shader in webgl1 as a color. Lets say I have 4 vertices and 6 indices representing the connectivity for two triangles that ...
user avatar
1 vote
2 answers
199 views

Encode axis aligned unit vector in a single float value

I want to encode axis-aligned unit vector in a single float value. Like this: 0: vec3(0, 0 ,0) 1: vec3(1, 0, 0) 2: vec3(0, 1, 0) 3: vec3(0, 0, 1) To convert float to vector according to the table ...
0 votes
0 answers
53 views

How Premiere pro-like dynamic rendering effects works?

You know, each track item of Premiere pro can have dynamic number of rendering effects like Blur, Mosaic, Noise, ... and they can be added/removed in anytime. My question is, how this can be done ...
  • 15
1 vote
1 answer
1k views

How to Gouraud shading with diffuse lighting in WebGl?

I stuck with implementing Gouraud smooth shading. I'm missing something and I need help. First about diffuse lighting. To get diffuse light I'm using this formula: Id * Kd * max( dot(N,L), 0.0) I ...

15 30 50 per page
1
2 3 4 5
10