•      Sign In
• Create Account

# EngineCoder

Member Since 02 May 2009
Offline Last Active Nov 02 2012 09:43 AM

### In Topic: New to OpenGL. Trying to figure it all out.

01 August 2012 - 08:37 AM

Then set the position in the shader with:
gl_Position = MVP;

No, you must multiply the vertex position with that matrix: gl_Position = MVP * a_position;

### In Topic: What are the basics to making a Game Engine?

21 July 2012 - 04:16 AM

I have written game/rendering engines both for fun and professionally. I don't always have a use case for my engine, but when deciding on what features I'll develop, I focus on those that are needed in games like Half-Life or Deus Ex, because some day I want to be part of a team working on something like that. In the mean time, I sometimes do small indie games using my engine so I get to learn game development and not just engine development. Doing real games using your own engine is a good way to test its power.

When developing an engine, I do it in the perspective of the engine's user, and try to make everything as seamless as possible for them. First I write API calls into a tech demo, then I implement them, so it's kind of a top-down process for me.

### In Topic: iPad3 static shadow maps

14 July 2012 - 07:00 AM

I dont actually use apple tools at all. I am using a crossplatform API called marmalade which lets me code in C++
I am not sure what kind of profiling tools I can use with it as I cant even use gdebugger with it.

Xcode includes a handy tool called Instruments that can be used to find bottlenecks.

### In Topic: What's wrong with my tangent calculation?

15 May 2012 - 11:22 AM

```tangent   = (deltaP1 * deltaUV2.v - deltaP2 * deltaUV1.v) / area;
bitangent = (deltaP1 * deltaUV2.u - deltaP2 * deltaUV1.u) / area;
```
I don't think you can trust your UV coordinates to point in the right direction: deltaUV1 and deltaUV2 and area can have "bad" signs and any sign change determines whether your normal (implicit from the choice of tangent and bitangent) points towards the front or the back.

Can you explain how do you relate UV coordinates to triangle facing?

Most tutorials do it that way, like: http://www.terathon.com/code/tangent.html

### In Topic: Camera Intilization in OpenGL ES 2.0

11 May 2012 - 09:43 AM

Here's my lookat() implementation:
```void Matrix::makeLookAt( const Vec3& aEye, const Vec3& aCenter, const Vec3& aUp, float* aMatrix )
{
assert( aMatrix );
Vec3 forward = aCenter - aEye;
forward.normalize();

Vec3 right = forward.cross( aUp );
right.normalize();

const Vec3 up = right.cross( forward );

aMatrix[ 0 ] = right.x;
aMatrix[ 4 ] = right.y;
aMatrix[ 8 ] = right.z;
aMatrix[ 12 ] = 0;

aMatrix[ 1 ] = up.x;
aMatrix[ 5 ] = up.y;
aMatrix[ 9 ] = up.z;
aMatrix[13 ] = 0;

aMatrix[ 2 ] = -forward.x;
aMatrix[ 6 ] = -forward.y;
aMatrix[10 ] = -forward.z;
aMatrix[14 ] = 0;

aMatrix[ 3 ] = aMatrix[ 7 ] = aMatrix[ 11 ] = 0.0f;
aMatrix[15 ] = 1.0f;
float translate[ 16 ];
Matrix::identity( translate );
translate[ 12 ] = -aEye.x;
translate[ 13 ] = -aEye.y;
translate[ 14 ] = -aEye.z;

multiply( translate, aMatrix, aMatrix );
}
```

PARTNERS