Thursday, May 5, 2011

Cell/Outline Shader

This shader is pretty much complete. The only thing I think I'd like to add to it is an option for making the outline thicker or thinner. This should be a pretty simple addition. Here's a screenshot:

Particle Systems and Collisions: Next On The Menu

So for my particle system I've decided to go ahead and draw a back wall for them to bounce off of. I've already started digging around in some code I have and I think there's a better way for me to handle drawing floors and walls. Here's some sample code:


void DrawWalls()
{
LPDIRECT3DVERTEXBUFFER9 pWallVB = NULL, pFloorVB = NULL;
VOID* pData;

g_App->CreateVertexBuffer(sizeof(aWall),D3DUSAGE_WRITEONLY,
                                                                D3DFVF_CUSTOMVERTEX,D3DPOOL_MANAGED,
                                                                  &pWallVB,NULL);

pWallVB->Lock(0,sizeof(pData),(void**)&pData,0);
memcpy(pData,aWall,sizeof(aWall));
pWallVB->Unlock();


pFloorVB->Lock(0,sizeof(pData),(void**)&pData,0);
memcpy(pData,aFloor,sizeof(aFloor));
pFloorVB->Unlock();


g_App.GetDevice()->SetStreamSource(0,pWallVB,0,sizeof(D3DVERTEX));
g_App.GetDevice()->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,4);
}




Right now my code for drawing the floor isn't inside of a function so this is an area where I'll be doing some clean up. Not only will this clean up how the code looks but it will make it easier to compartmentalize later.






Tuesday, May 3, 2011

Shaders

So far I'm pretty happy with the first shader I have. I think next I'm going to start working on improving my edge detect shader. Here's a shot of what it might look like.




I'm really liking the fact that in that first shader I was able to get some movement. I think for this one if it comes together quickly enough I might try to emulate some "jiggle" in the lines kind of like the way that cartoon Ed, Ed, and Eddie looks.

Particle System Rigid Body Update

I swapped out the texture on the floor and on the particles. I'm thinking once everything is working I might add in a menu option for user generated textures. I also made the floor a bit bigger so the particles didn't look like they were floating out in space. Here's a screenshot.