Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Mar 2009
Offline Last Active Jun 08 2013 11:39 AM

Topics I've Started

Motion Blur with FBO

11 April 2013 - 10:53 AM

So I am trying to come up with a way to do a motion blur effect without using the velocity vector method, this is not because I cannot do it with that, but a section of work I am working on where the requirement is to store each frame in an FBO then motion blur them.


Right now I pass my 4 FBO's into my shader. Then I run this fragment shader with them and output the result, I cannot seem to get this to produce any effect other than darkening or lighting the engine depending on changes to the code below. I have also tried mixing the frames together and applying weights. I think is is an issue on how many FBO frames I am holding.


#version 330

in vec2 uv0;

uniform sampler2D Blur1;
uniform sampler2D Blur2;
uniform sampler2D Blur3;
uniform sampler2D Blur4;

out vec4 colour;

void main()
	vec3 colorA = texture2D(Blur1,uv0).rgb;
	vec3 colorB = texture2D(Blur2,uv0).rgb;
	vec3 colorC = texture2D(Blur3,uv0).rgb;
	vec3 colorD = texture2D(Blur4,uv0).rgb;
	colour.rgb = colorA + colorB + colorC + colorD;

	colour.rgb /= 4;



How can I get a passable motion blur with 4 frames? I can also go up to 8 FBO frames.

Papagayo lip sync to a Face Gen Model

06 April 2013 - 11:36 AM

I am working on a project where I can take Papagayo 's lip sync output and use it on a Face Gen head in Maya through a mel script.


The only thing I am stuck on is Papagayo uses the  Preston Blair phoneme series, and I cannot find out what phoneme series Face Gen uses.


If anyone could help me out figuring out how to convert from one to the other that would be great.



Passing a Matrix4 to a Vertex Attribute [Solved]

05 April 2013 - 07:57 AM

So I am looking for a way to pass a Matrix4 from my program into my shader as an attribute.


As for the reason why, I am working on a particle system and every particle requires its own Model matrix so I can do things like per particle rotation.


I know you cannot just do this, because you can only used 1,2,3,4 where the 16 is. I do know I could split this into 4 vectors, but then I have to reassemble on the other side so I would rather not do that.

glVertexAttribPointer(3, 16, GL_FLOAT, GL_FALSE, sizeof(ParticleData), (const GLvoid*)36);



Is there a way to pass this into the shader some way that doesn't involve me adding code to disassemble and reassemble my matrix?



I should add I have a struct that holds the information for each particle so I am using interleaving to pass data.


I also found a code sample that works for non interleaving:


for (unsigned int i = 0; i < 4 ; i++) 
glEnableVertexAttribArray(WVP_LOCATION + i);
glVertexAttribPointer(WVP_LOCATION + i, 4, GL_FLOAT, GL_FALSE, sizeof(Matrix4f), (const GLvoid*)(sizeof(GLfloat) * i * 4));
glVertexAttribDivisor(WVP_LOCATION + i, 1);




As a side note, I am applying my ModelView to a GL_POINT which then gets passed into a Geometry shader, if I apply a rotation to that GL_POINT will it be reflected on the textured triangle strip that comes out the other side.





Just my luck, I spend hours searching for an answer, decide to post and find it within 5 minutes after posting...


I just need to add the offset of 36 to the code above.

Delta Interpolation Issues

04 April 2013 - 11:57 AM

So I am working on fixing an issue with my game loop and my particle systems which run fine on my average power laptop, but run really fast on my home desktop which is on the upper end of powerful for home PC's


I have the issue narrowed down on the fast computers to being delta when multiplied with my force then added to my velocity (which before this was 0). I get this happening (see attached)


My Final Velocity Value

Attached File  velocityvalues.png   6.56KB   20 downloads


My Input Force

Attached File  Forcevalues.png   7.05KB   21 downloads


My Input Delta

Attached File  Deltavalue.png   2.37KB   23 downloads



So the question is how do I solve this so that this doesn't happen?

Debugging Memory Leaks in Visual Studio 2010 (c++)

30 March 2013 - 05:00 PM

I am trying to debug memory leaks in my game application, which consists of a executable and a dynamic-link library.


This is the code I have added following some msdn pages. 


#include <stdlib.h>
#include <crtdbg.h>

#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#define new DEBUG_NEW

int WINAPI WinMain(HINSTANCE hInstance,
					HINSTANCE hPrevInstance,
					LPSTR lpCmdLine,
					int nCmdShow)


	int result = loop();


	return result;



My Output looks like this though:


Detected memory leaks!
Dumping objects ->
{298045} normal block at 0x0B0AB5F0, 32 bytes long.
 Data: <Threshold: 0.800> 54 68 72 65 73 68 6F 6C 64 3A 20 30 2E 38 30 30 
{298037} normal block at 0x0B0A3B30, 8 bytes long.
 Data: <        > 10 B3 0A 0B 00 00 00 00 
{298020} normal block at 0x0B0AB0E8, 32 bytes long.
 Data: <Middle Grey: 0.1> 4D 69 64 64 6C 65 20 47 72 65 79 3A 20 30 2E 31 
{298012} normal block at 0x0B0A3C60, 8 bytes long.
 Data: <        > C0 AF 0A 0B 00 00 00 00



As far as I know I should be getting file and line numbers at this point, I did fine something earlier on gamedev that talked about this, but it didn't seem to resolve my issue and the post was quite old.


So how can I get better information about debugging these memory leaks?