Search:

Type: Posts; User: greggman

Search: Search took 0.00 seconds.

  1. Replies
    6
    Views
    4,793

    Re: Issues with using ReadPixels

    By default WebGL clears the backbuffer after your render function exits back to the browser. In other words, if you something like this



    function render() {
    gl.clearColor(1,0,0,1); // red
    ...
  2. Replies
    1
    Views
    1,688

    Re: Why do we use buffers?

    They are stars because the sample is drawing "textured" rectangles.

    The general guideline for WebGL is that you setup all your vertices during initialization. If you have more than 1 shape make...
  3. Re: simple example - attempt to access out of range vertices

    You only setup your position buffer, then setup the color buffer, then your call to gl.vertexAttribPointer is using your color buffer (since that's the last buffer bound) but you never init your...
  4. Re: displaying complex pixels from very large images

    You're asking questions to which there is no simple answer. Googling for them brings up lots of samples. Each one though with details is too much for a forum answer I think.

    WebSockets...
  5. Replies
    1
    Views
    3,348

    Re: How to learn more about WebGL?

    There are lots of WebGL resources on the net. Just Google them?

    https://www.google.com/search?q=learnin ... e&ie=UTF-8
  6. Thread: depth buffer

    by greggman
    Replies
    4
    Views
    3,713

    Re: depth buffer

    It's usually easier to help if you can post a working sample in something like http://jsfiddle.net or http://codepen.io/

    As for reading the depth buffer values one way is to use the...
  7. Thread: Tesselator

    by greggman
    Replies
    4
    Views
    5,016

    Re: Tesselator

    You could try asking on stackexchange.com
  8. Re: Does webGL work on Ubuntu 12.04 LTS - with Google Chrome

    It probably means you have a blacklisted GPU

    You can try running chrome with --ignore-gpu-blacklist

    Be aware of course that means you're exposing your machine to buggy drivers
  9. Re: Lighting - Shader Langauge - Vector Magnitude

    Doh! If I had looked just one line down the reference card I would have seen the distance function



    float distanceToLight = distance(uPointLightingLocation, mvPosition.xyz);
  10. Re: Lighting - Shader Langauge - Vector Magnitude

    Looking at the WebGL Quick Reference Card
    http://www.khronos.org/files/webgl/webg ... rd-1_0.pdf

    You want length()

    as in

    float distanceToLight = length(uPointLightingLocation -...
  11. Replies
    1
    Views
    2,522

    Re: Grabbing image from canvas

    try



    var pixels = new Uint8Array(width * height * 4);
    gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);


    you can also use
  12. Replies
    1
    Views
    1,080

    Re: Multiple renders in one

    For rendering to quadrants you can set the viewport and scissor



    var views = [
    { left: 0,
    bottom: 0,
    width: canvas.width / 2,
    height: canvas.height,
    eye: [0, 0, -10],
Results 1 to 12 of 13