Content from 2013-07

Moving Again
posted on 2013-07-25 05:00:00

Hopefully, a week from now I'll get up at my Aunt and Uncle's in East Lansing, Michigan and start out to the border with Canada. Hopefully, later that day, Sarah and I will move into an apartment in Kitchener and start setting up a new life there for a few years.

Chicago has been a rough nine months. I pushed for moving here because it seemed like I was going nowhere in New York. I had gotten work at two colleges there as a lab assistant in shitty conditions with decent pay and then with great coworkers and very little pay. I was at the end of my rope and thought there was nothing more for me there, that I could never afford to live there and would be back in a parents house or living off of Sarah forever. Then I moved to Chicago, where nobody was interested in hiring me for anything more than one tutoring gig that lasted about two months.

Financially, it would seem, I moved to Chicago to burn money.

Luckily, though, there were a number of upsides. I got to meet a lot of nice people mostly Northwestern students but a bunch of great people from Roger's Park community organizations like Food not Bombs, who are doing awesome things in kitchens and gardens and on the streets!

It's given me some hope that I can still make new friends and try new things, and I'm hoping to bring those feelings with me to Kitchener and my new job and my new school.

Here's hoping I see everyone again soon.

Cooking with shaders
posted on 2013-07-08 10:33:06
Anyone who has bothered reading here will have some idea that I've been learning about making games lately.  I haven't written in a bit, because it's a lot of learning and I have very little that's finished enough to show off.  Yesterday, I got bored of working on my networking code, and decided to learn what these things called shaders were.  Luckily, I already knew about the CLinch framework, which had some shader support built in, so I could dive in without having to worry about linking and compiling them myself.

I played around a bit and made a spinning cube with some shading working, but man, having to work with C syntax again was frustrating.  Even more so was having to define the variables for the shader programs both in their explicit code and twice in the lisp that managed them as well.  That sort of work duplication is the sort of thing I think Lisp is well-suited to avoid, so I decided there needed to be yet another library for parsing lisp syntax into a lower-level language, so I started cl-glsl.

It's 5:30 am now, and it can already turn this:
(defun main ()
(let ((intensity :float)
(color :vec4)
(tex-color :vec4 (texture2D texture01 v-texture-coord)))
(setf intensity (dot light-dir (normalize normal)))

((> intensity 0.95)
(setf color (* tex-color (vec4 1.0 1.0 1.0 1.0))))
((> intensity 0.5)
(setf color (* tex-color (vec4 0.6 0.6 0.6 0.6))))
((> intensity 0.25)
(setf color (* tex-color (vec4 0.4 0.4 0.4 0.4))))
(setf color (* tex-color (vec4 0.2 0.2 0.2 0.2)))))

(setf gl_frag-color color))))

into this:
void main () {
float intensity;
vec4 color;
vec4 texColor = texture2d(texture01, vTextureCoord);

intensity = dot(lightDir, normalize(normal));
if (intensity > 0.95) {
color = (texColor * vec4(1.0, 1.0, 1.0, 1.0));
} else if (intensity > 0.5) {
color = (texColor * vec4(0.6, 0.6, 0.6, 0.6));
} else if (intensity > 0.25) {
color = (texColor * vec4(0.4, 0.4, 0.4, 0.4));
} else {
color = (texColor * vec4(0.2, 0.2, 0.2, 0.2));
gl_FragColor = color;


Which I'm going to call a resounding success and maybe go lie down now. Links to cl-glsl will appear here when and if it proves useful at all.

Good night!

This blog covers vegan, ice cream, Work, Vegan, Uncategorized, Rust, Resistance, Research, Repair, Recipes, Physics, Nest, Music, Lisp, Linux, Links, Link, Life, Language, Information, Image, Gnome, Games, Gallery, Food, Fascism, Esperanto, Emacs, Electronics, Education, Dog, Did You Know That?, DRM, Community, Comics, Colgate, Code, Buddhism, Books, Aside, Anarchism, 3D Printing

View content from 2009-04, 2009-06, 2009-07, 2009-08, 2009-10, 2009-11, 2009-12, 2010-05, 2010-06, 2010-07, 2010-08, 2010-09, 2011-01, 2011-02, 2011-03, 2011-04, 2011-06, 2011-07, 2011-08, 2011-09, 2011-10, 2011-11, 2011-12, 2012-01, 2012-02, 2012-03, 2012-04, 2012-07, 2012-08, 2012-09, 2012-11, 2013-02, 2013-03, 2013-04, 2013-06, 2013-07, 2013-09, 2013-11, 2014-01, 2014-02, 2014-03, 2014-07, 2014-11, 2014-12, 2015-01, 2015-02, 2015-07, 2015-10, 2015-11, 2015-12, 2016-01, 2016-05, 2016-08, 2016-10, 2016-11, 2016-12, 2017-02, 2017-06, 2018-04, 2019-03, 2009-03

Unless otherwise credited all material Creative Commons License by Matt Novenstern