by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Mikola Lysenko
    @mikolalysenko
    gregfan: yeah this is all based on regl https://box3.codemao.cn/
    going to work on opening up registration outside china soon
    Mikola Lysenko
    @mikolalysenko
    webgl2 still doesn't work in safari or most mobile browsers
    but if you only care about chrome/ff it may not matter
    Eric Arnebäck
    @Erkaman
    :lollipop:
    Amit Patel
    @redblobgames
    I think if I had to fall back to plain webgl, I'd give up in most cases :-/ regl has spoiled me!
    deluksic
    @deluksic
    Are you sure about safari? Ipad pro 2020 has webgl2 switch in experimental features
    Leo Accounts
    @leoccnts_gitlab

    Would someone be willing to give me some pointers regarding how to implement jump flooding in regl?

    Like https://www.shadertoy.com/view/Mdy3DK

    This blog also captures what I'd like to accomplish. http://rykap.com/graphics/skew/2016/02/25/voronoi-diagrams/
    Ricky Reusser
    @rreusser
    @leoccnts_gitlab Neat! I'd never worked through this before, so I gave a regl implementation a shot here: https://observablehq.com/@rreusser/gpu-voronoi-diagrams-using-the-jump-flooding-algorithm
    Leo Accounts
    @leoccnts_gitlab
    @rreusser Thanks Ricky! This is very helpful.
    Olivia Jack
    @ojack
    Does anyone have any resources, advice, or examples for dealing with large data sets? I am just digging into this so anything is relevant! But some specific questions, how to stream from a server and render in webgl as things are received (without waiting for the whole file), also any recommendations about file formats / compression
    Nick Matantsev
    @unframework
    @rreusser nice job! I actually always wondered how one would implement Voronoi in raster passes, and JFA looks very clever
    i like the 2D drop shadow application from the blog, very cool
    Max Bittker
    @MaxBittker
    @ojack have you seen this library? https://github.com/regl-project/resl There might be some good ideas to take from the code if the library doesn't suite your needs
    i've used it to load medium sized videos and 3d models but i couldn't tell if it was actually streaming
    Ricky Reusser
    @rreusser
    @ojack a bit late, but a couple random things:
    substack wrote up some tools for a format called bga, with the goal of making things as easy as possible to transfer directly to a gpu
    depending on what the dataset is, it might be possible to pass interleaved data (e.g. point0, color0, point1, color1, etc) rather than separate chunks of data
    this would make it smoother to use something like bga which defines the layout of the data in the header, then use buffer.subdata to insert the pieces into a preallocated buffer as they're received
    It does look like resl might be a good candidate for managing the plumbing for this approach, using stream: true and onData: https://github.com/regl-project/resl#parser-interface
    not sure if that meets your particular needs or not, but just a couple ideas
    Olivia Jack
    @ojack
    thank you @rreusser @mbittker this is really helpful :)
    Ricky Reusser
    @rreusser
    @ojack I won't go on and on, but reading back, I wasn't sure if I conveyed what I meant or not
    I'm really bad and never use structs, but they're a thing that exist, e.g. https://github.com/regl-project/regl/blob/cadd226650d345ac3599b067ebfb848439dc4fd8/example/lighting.js#L26-L29
    not sure if you can use them with attributes or if you just have to set up strides and offset if you use interleaved data
    either way, the benefit of interleaving for large, streamed data is that rather than having a lot of buffers to manage, you can just fill in data in one buffer, set up attributes that all point at the same buffer but with different strides,
    and then the only thing you have to do as data is received is change the count and draw as many things as you've received
    that's all I meant :) I've never tried it, but I'm pretty sure it's a simple way to stream data, and I've always wanted to try it…
    nanjizal
    @nanjizal
    is this a suitable place to ask generic WebGL questions on animating UV values? I don't know what regl means?
    nanjizal
    @nanjizal
    https://www.codeply.com/p/D2FhTDBLpD it uses interleaved data. I have since fixed some aspects of UV but I am still not sure I am setting my shader up well it seems to ignore UV values
    Amit Patel
    @redblobgames
    regl.js is a library that lets you write webgl in a more functional style https://github.com/regl-project/regl
    I'm guessing someone here may be able to help but I don't know what animating UV values means :-(
    Mikola Lysenko
    @mikolalysenko
    sure
    nanjizal
    @nanjizal
    I found some of my issues were down to not setting up the texture uniform. But very strangely my current code seems to completely ignore the uv values. I guess now haxe supports pure function modules it might be a good language for regl.
    well setting the texture uniform location up
    currently i have x,y,z,r,g,b,a,u,v array of floats but it seems to ignore the u,v values for each corner. I know position and color work fine in the same buffer but is there a problew using u,v in the same buffer?
    Olivia Jack
    @ojack
    After initializing a regl buffer, is there a way to see what data it currently contains, as well as type, etc?
    Matthew Wetmore
    @wetmore
    there is a private (but still accessible) property called _buffer on a buffer object, you can see its fields here: https://github.com/regl-project/regl/blob/ddb0e88f9c797fea9c7143c642a62505325b41a7/lib/buffer.js#L54
    Mikola Lysenko
    @mikolalysenko
    ojack: yes, you can just call it as a function
    const b = regl.buffer(...)
    then do: b(newData)
    or you can use b.subdata(...) to just initialize it again
    last is the fastest option
    the same pattern works for textures too
    Clément Cariou
    @ClementCariou
    Hello I made this useful piece of code : https://github.com/ClementCariou/Basic-Geometry-Renderer. I'm trying to make a library out of it. I'm thinking about supporting many prop types to simplify its usage. Some kind of magic scope middleware which introspect the parameters of draw commands would be nice but I don't think it's possible.
    Mikola Lysenko
    @mikolalysenko
    You can use scoped functions
    but maybe i'm not quite understanding what you want