Questions tagged [ogl]

OGL is a minimal WebGL library.

OGL on GitHub

OGL is a small, effective WebGL library aimed at developers who like minimal layers of abstraction, and are comfortable creating their own shaders.

Written in es6 modules with zero dependencies, the API shares many similarities with ThreeJS, however it is tightly coupled with WebGL and comes with much fewer features.

In its design, the library does the minimum abstraction necessary, so devs should still feel comfortable using it in conjunction with native WebGL commands.

Keeping the level of abstraction low helps to make the library easier to understand, extend, and also makes it more practical as a WebGL learning resource.

8 questions
2
votes
0 answers

How to make a proper planar reflection using ogl with a perspective camera?

I'm trying to reflect a WebGL scene in a plane with ogl, as a mirror would do. I made a naive implementation of the three.js reflector but all I got is a distorted image that doesn't match what an actual reflection would look like. I get the…
Julien Dargelos
  • 356
  • 1
  • 12
1
vote
1 answer

Camera.js:104 Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')

Why am I getting this error?Camera.js:104 Uncaught TypeError: Cannot read properties of undefined (reading 'attributes') at u.frustumIntersectsMesh (Camera.js:104:28). I'm using the OGL library? There is a media.js class where the error only…
Muaaz
  • 11
  • 1
1
vote
1 answer

How can I make the FragColor work with alpha?

I'm very new to OGL. I'm trying to get the fragment shader to show a png-image with transparency in it. So far I've managed to turn the transparent background in the image to black, the alpha channel then views in black, but how to I make the alpha…
Vendela
  • 21
  • 3
1
vote
1 answer

Fish-eye warping about mouse position - fragment shader

I'm trying to create a fish-eye effect but only in a small radius around the mouse position. I've been able to modify this code to work about the mouse position (demo) but I can't figure out where the zooming is coming from. I'm expecting the output…
Zach Saucier
  • 24,871
  • 12
  • 85
  • 147
1
vote
1 answer

Setting transparent background to this WebGL with OGL Flowmap effect?

I am trying to create the Flowmap effect from OGL examples but with partially transparent PNG image. I was struggling with this issue for many hours now and I don't even know whether it is the texture's fault the flowmap effect or any other thing.…
Filip Wachowiak
  • 63
  • 2
  • 10
0
votes
0 answers

Applying Barycentric coordinates to custom geometry: OGL library

I have an Icosahedron "position" and "index" array and want to view its edges after applying Barycentric Coordinate effect to it. I have inserted the position and the indexes but something is still missing. Problem 1: It is supposed to show all the…
Mr.Coder
  • 347
  • 1
  • 10
0
votes
1 answer

Raycasting on moving objects

I would like to create some mouse interactions on several moving planes and for that, I need to know which planes I'm hovering on. I've implemented the Raycasting method like in your example here but it seems like I'm hovering all my planes in the…
Gascha
  • 11
  • 1
0
votes
1 answer

Play GLTF animation using OGL JS

Does anyone know how to load a "GLTF" file and play the animation? Using OGL JS? I already can load the GLTF file but I can find an example of playing the animation, only this one: https://github.com/oframe/ogl/blob/master/examples/skinning.html But…