I noticed that THREE.js uses shaders internally to create core material "e.g. MeshLambertMaterial", So I decided to copy the lambert shader from Three.js code into a new shader and build on it.  This is the code I got (Copied faithfully fro...
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?  And if I remove this line, nothing cha...
For educational purposes I need to compare the performance of WebGL with OpenGL. I have two equivalent programs written in WebGL and OpenGL, now I need to take the frame rate of them and compare them.    In Javascript I use requestAnimationFrame to a...
I have the need to orientate an instance of THREE.Mesh to always face the camera. I know I could just use the [THREE.Mesh].lookAt() method, but I'm trying to work on my GLSL chops a bit more and want to be able to do this in a vertex shader.  I&#...
I'm working on a small multiplayer game which has a single skinned player mesh with many players using it. Some Background: I've tried loading via maya and blender collada export. Both seem to reference some form of animation data but I could...
Is there any way to let the browser returns the opengl version string?  I know that opengl is not executed by the browser, this is why in the code, the shaders are written as string to not make javascript syntax errors,  So, if the browser can interr...
I learn WebGL step by step via this book. I try to draw three points through using of the buffer (gl.ARRAY_BUFFER) instead of cycle (as I did the same earlier in other samples of the book).     var u_FragColor = gl.getUniformLocation(gl.program, '...
I am trying to render textured particles and i have the problem. Transparent pixels of texture doing a weird thing with render. Looks like particles that are behing nearest (to camera) particles are not rendering at all. But not always, some of them...
I'm writing a program that is supposed to draw 3D parametric shapes in webgl. The code I have currently seems to work (mostly) for a sphere, but when I switch out the equations used to find x, y, and z, for a torus, only the top half of the torus...
I want to get texture from webgl just like i can use getImageData()when the canvas context is 2d. how can i get texture form webgl context?...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.