Let’s make Marv do things

Scaling

Today I updated the scaling part of my vertex shader because it seemed wrong. And it was wrong. Before:

mat4 newmodel = Model;
newmodel[3][3] = Scale;
vWorldPos = newmodel * PosWithBone / Scale;
// output position
gl_Position = Projection * View * newmodel * PosWithBone;

After

// for scaling
PosWithBone.x *= Scale;
PosWithBone.y *= Scale;
PosWithBone.z *= Scale;
vWorldPos = Model * PosWithBone / Scale;
// output position
gl_Position = Projection * View * Model * PosWithBone;

The vWorldPosition is set so the pixel shader knows easily where the world is so I don’t have to send it as a uniform.

Flags

I plan on adding flags for capture the flag. I spent a bit of time on TurboSquid finding some free flags but only one was free in FBX format and it didn’t import properly, so I decided to go with using the dragon FBX, despite it being extrem,ely high poly count. I believe this won’t be a problem but if frame-rates slow down then I’ll just use another random object like soulspear.

Lights and scenes

The light were originally just structs, so I moved them out into their own header and class files for better code standards.

So far here’s what we have:

20130528000756

Playing with fog. Using the z buffer to darken the fragments depending on distance from the camera.20130528000839

Got a nice specular effect using a normal map created in crazybump.20130528001303 20130527232639

Marv ready to be animated.20130527232702

 

Testing fog colours. Here we have red fog.20130528001501

Using different textures on the level. Lava texture looks a bit too bright.20130528030046

Here we see the result of what Marv animated like before I removed the 4th bone transform from the indices. I’m going to assume that that last one is for the transform of the gun Marv is supposed to be holding.20130528030328

Using emissive textures to light up areas that are not lit. I couldn’t figure out the formula though so I removed it.20130528030358

Go home Marv, you are drunk.20130528030522 20130528032217Trying with only 1 bone index. Marv hated that.

 

Leave a Reply

Your email address will not be published. Required fields are marked *