Fork me on GitHub
#off-topic
<
2016-12-23
>
sophiago05:12:40

oh, hi! i haven't been on here in a while and just saw this discussion 🙂 i have a bit of experience in glsl, originally for live art projects and the last many years for 2d image processing in webgl. it's really not too tough to play around with in that context. it's on my to-do list to port my react.js components for hotswapping shaders to Om.Next so hopefully will get to that early next year

sophiago05:12:45

here's the javascript version if you want to take a look: https://github.com/Sophia-Gold/WebGL-Convolution-Shaders

sophiago05:12:17

currently the easiest way to import glsl is as string literals (requires es6). you can see all the ones i use in that demo in this file: https://github.com/Sophia-Gold/WebGL-Convolution-Shaders/blob/master/convolution.glsl.js

sophiago05:12:56

these are all really simple ones in that they're all one-pass, i.e. no VBOs

nikki21:12:10

@sophiago: oh awesome! 😄

nikki21:12:18

Theres this thing called 'gamma'

nikki21:12:21

A clj lib

nikki21:12:27

That compiles sexps to glsl 😮

nikki21:12:22

But also i think w/ regl.party and watching for a new spec you can hotswap shaders pretty well it seems like

nikki21:12:46

But om.next hotswapping sounds p cool

sophiago21:12:21

oh, i think i took a look at gamma a while back!

sophiago21:12:42

i was thinking of writing cljs wrappers for glsl, but now probably not

sophiago21:12:11

regl.party seems more along the lines of three.js, no?

sophiago21:12:21

as in a real 3d library?

nikki21:12:05

Nah its just a quick way to do webgl without calling the gl funcs

nikki21:12:22

The basic example will immediately make sense if u check it out! On phone so hard to link haha 😅

nikki21:12:08

As u can see it just says the geom in the buffers and the shaders

nikki21:12:09

Declaratively

nikki21:12:23

Instead of creatShader shaderSource etc

sophiago21:12:36

it's quite a higher level of abstraction i think. webgl is based on opengles, not the desktop version. so 3d stuff like that is quite a lot of work

nikki21:12:53

Mm no it actually is just straight webgl api

nikki21:12:01

Yeah opengles just does buffers and shaders

nikki21:12:09

Its similar to the core profile desktop api

nikki21:12:17

But yeah diff from the oldskool glBegin stuff

nikki21:12:35

The 3d happens because of the transform in the shader

sophiago21:12:05

oh i guess they're just importing models in some? and have fairly complex shaders going on?

nikki21:12:19

Yeah the model is require('bunny')

nikki21:12:29

3d transform comes from gl-mat

nikki21:12:33

Theyre using libraries i gueds

nikki21:12:52

But regl itself is fairly low-level for sure

nikki21:12:10

Its equivalent to the gles api but in object form rather than stateful list of procedural function calls

sophiago21:12:20

well, it's not that tough to sync event loops and such. more what's difficult is just drawing anything in 3d of significant complexity

sophiago21:12:31

i mostly use it as a rasterization api

nikki21:12:06

Oh yeah was looking at the blur convolution

sophiago21:12:10

i think there's a lot of potential to accelerate just regular 2d graphics

nikki21:12:20

Definitely, and thats what im into too

sophiago21:12:26

yeah, a nice gaussian blur is really impossible to do in the browser

sophiago21:12:32

on the cpu i mean

nikki21:12:34

I think 3d is just a choice in the shader, ultimately its a 2d view

sophiago21:12:39

it slows things down unbearably

nikki21:12:55

I was implementing webgl in c++ to use in react native

nikki21:12:12

Which is why been doing this lately

nikki21:12:02

gl-react is nice to do convolutions in a component if you've seen it

nikki21:12:58

We're trying to get it to run on react-native 😅

nikki21:12:34

Live art is cool -- was it like at a bar / club over some music

nikki21:12:44

My roommate is trying to do that atm w quil

sophiago21:12:28

nah, i actually wasn't doing much live performance. but really into max/msp and generative art so nothing was rendered ahead of time

sophiago21:12:37

that's when i learned glsl

nikki21:12:48

Cool max/msp!

sophiago21:12:15

yeah i remember them having a clojure object and being like, "clojure...lol what's that?"

sophiago21:12:23

that was in like 2009

nikki21:12:39

Thats p awesome, have u been doing clojure since

nikki21:12:41

Im rly new to clj

sophiago21:12:05

not that long actually. but i knew scheme for quite a while before

nikki21:12:13

Mostly the gfx ive done is c/cpp and recently doing a bunch of js / objc / java for work cuz rn

nikki21:12:26

Oh i see yeah like racket?

sophiago21:12:48

i use guile these days

nikki21:12:59

Guile's website is nice

sophiago21:12:01

it's pretty bare bones

nikki21:12:18

Speaking if live gfx do u wanna see this thing i made once 😮

nikki21:12:03

Its like live lua coding of a c engine but u can grab and edit objs visually

nikki21:12:08

Its for games i guess

nikki21:12:17

I rly rly wanna redo in cljs

nikki21:12:34

Cljs is so much better suited for this sort of thing by like 4x

sophiago21:12:35

cool, sprites!

sophiago21:12:02

i wrote a little sprite library for js i used a whole bunch

sophiago21:12:40

i made it to interactively timewarp videos...this turned out to be the best solution. so it can handle pretty large spritesheets (.5-3mb jpegs usually) at 30fps

sophiago21:12:04

i couldn't do infinite scroll or anything, but at least three to a page running at that size

sophiago21:12:32

and displaying in 720 resolution usually

nikki21:12:00

oic -- the canvas api for drawing?

nikki21:12:04

i've never actually used it haha

nikki21:12:15

btw what did / do you use guile for? curious about that

nikki21:12:26

it seems like has really quick bindings for C

sophiago21:12:04

oh i never used scheme for any production code. just prototyping algorithms and playing with interpreters and such

sophiago21:12:44

you should look into canvas if you're doing any web graphics

sophiago21:12:59

just the 2d api is gpu accellerated

nikki22:12:10

oh -- i like directly writing shaders haha but i'll check it out

nikki22:12:19

i'm doing the cljs / js stuff in the context of rn so canvas isn't available

nikki22:12:38

you might think this is cool

nikki22:12:45

it's a diff way of rendering 3d

nikki22:12:48

that involves no transformations

nikki22:12:58

it just evaluates a distance function that describes a smooth surface :thinking_face:

nikki22:12:00

pretty nifty

nikki22:12:54

yeah you can do really weird stuff like twisting and repeating things to infinity and all this stuff

nikki22:12:55

cuz of the math

nikki22:12:12

it's nice for 'live art' type stuff looks like

nikki22:12:46

I'm working through the "living clojure" book atm

sophiago22:12:03

haven't heard of that

nikki22:12:10

it's really nice!

nikki22:12:18

the author had a podcast interview which made me wanna check it out

sophiago22:12:51

i'm exhausted and at least need to finish speccing up this project i've been trying to push a commit on today 😕

nikki22:12:29

haha cool! i'm probs gonna be on this slack for a bit to ask cljs qs whenever i get stuck on this book

nikki22:12:35

loving this community

sophiago22:12:48

yeah it's great. everyone is very helpful

sveri22:12:40

Indeed, this is the nicest community I have ever seen