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:
Playing with fog. Using the z buffer to darken the fragments depending on distance from the camera.
Got a nice specular effect using a normal map created in crazybump.
Testing fog colours. Here we have red fog.
Using different textures on the level. Lava texture looks a bit too bright.
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.
Using emissive textures to light up areas that are not lit. I couldn’t figure out the formula though so I removed it.
Go home Marv, you are drunk.
Trying with only 1 bone index. Marv hated that.