Skip to main content

Ramblings on happiness

· 8 min read
Raluca Nicola
Web Cartographer

For a couple of years now I've been reading/watching everything that fell into my hands about happiness. I accumulated a lot of ideas, but it's such a broad and subjective topic, that it's really hard to make a summary. I feel like now it's a good time to draw conclusions and structure these ideas into a blog post.

Day 1

· One min read
#version 300 es
precision highp float;
in vec2 u_resolution;
out vec4 color;

void main() {
vec2 vUv = gl_FragCoord.xy/u_resolution;
color = vec4(vUv, 1, 1);
}

Homogeneous coordinates

· One min read

If we consider $A=(1,2,3)$ we don't know whether it represents a point or a vector. Homogenous coordinates have one more dimension $w$ for that:

  • $w=0$ when A is a vector: $A=(1, 2, 3, 0)$
  • $w=1$ when A is a point: $A=(1,2,3,1)$

Adding two vectors will be a vector, subtracting two points will return a vector.

Uniforms

· One min read

Uniforms are values that are passed to the vertex and fragment shaders that are the same for all vertices/fragments.

How to use them:

// look up the location of the uniform
const timeLocation = gl.getUniformLocation(program, "u_time");

const ellapsedTime = performance.now();
// before drawing, we'd set the uniform
gl.uniform1f(timeLocation, ellapsedTime);

Types of uniforms:

  • integer or float → i/f
  • 1, 2, 3, or 4 dimensions → 1/2/3/4
  • single value or vector → v

Like this we can set the uniform using the following methods:

// v0, v1 -> floating point numbers
gl.uniform2f(uniformLocation, v0, v1);
gl.uniform3fv(uniformLocation, new Float32Array([v0, v1, v2]));

If we want to pass a matrix we use gl.uniformMatrix[234]fv. See documentation

Vertex attributes

· One min read

Values that are being passed from JavaScript to the GPU and that are different for each vertex, for example position, normals, colors.

As they represent vertex properties, attributes can only exist in vertex shaders. This is why if we want to use any of these attributes in a fragment shader, we'll need to pass them as varyings.

Example:

attribute vec4 a_position;
void main() {
gl_Position = a_position;
}

A student's guide to jobs in GIS and cartography

· 6 min read
Raluca Nicola
Web Cartographer

When I was studying cartography at university, I really liked web mapping and map design but I wasn't sure who would hire me with these skills. Back then, I didn't even know that the job I have today existed! I've been working in the field for about 6 years now and have come across many job types. With this blog post I'd like to give an overview of the possible jobs in GIS and cartography and I hope it will be useful for students and graduates.