Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

Posts tagged ‘Planning’

[Week 4] Behind on schedule, but puffing on.

Since I spent most of the previous week bedridden, I have fallen behind a week and will have to rethink my planning. Yesterday I did pretty decently however, and now my billboards are in place. Cleaning code has gotten pushed back, and now focus will instead be on functionality. I’ll make it less messy when I feel I have the time.

This is the shader program for my first billboarded particles:

  1. [VS] Pass unprojected points directly down to the Geometry Shader
  2. [GS] GL_POINTS as input, output GL_TRIANGLE_STRIP
  3. [GS] Get the non-projected point. (modelView, no projection)
  4. [GS] Add/Subtract extents from the points for each corner of the billboard, then multiply with the projection matrix.
    projection * vec4(pos.x – extent.x, pos.y – extent.y,  pos.z, pos.w), //Lower Left
    projection * vec4(pos.x+extent.x, pos.y – extent.y,  pos.z, pos.w), //Lower Right
  5. [GS] Emit vertices accompanied by an outparameter for UV coords,
  6. [FS] Texture the billboard from a sampled texture!

This is mostly done, I just need to put up a texture on the billboard now. One interesting detail to note for someone new to geometry shaders (like me!), remember to generate points following a point only altered by the modelview matrix, otherwise the billboard will be skewed depending on the screen width and height!

Hopefully things will work pretty alright and I won’t have to overthink. I am slightly curious about the difference in consumption between these Geometry Shader billboards and normal billboarded particles. Maybe I’ll have to measure when I have time.

[Week 3] Unforeseen consequences

There are always some things you can’t account for in an initial planning, such as complications, little things you hadn’t thought about that you needed for the larger details, some minor things. This blog post will be short, but it will provide a good explanation on this week, and why I might have to revise my planning again.

I’ve been sick. From the very day I posted the last optimistic update, the only real thing I’ve managed to get done is the milestone presentation, then my situation has been very volatile. Sometimes I’ve been lying all day, sometimes I’ve been trying all day. But no amount of study or work has been profitable, because I’ve shortly thereafter had to go for more medicine, a cup of tea and bed. It’s been absolutely terrible. The extra time I had up is long time wasted, so I wouldn’t say I am behind on schedule. I can just pray tomorrow will be good enough to finally head out of my home and just get my work done.