Well, I was going to do screen fading by having a load of rotating stars expand out from random points on the screen, spinning and growing until the screen was all black, but to be honest, I don't really like the way it looks.
However, just in case anyone ever needs to create a symmetrical five-pointed star out of triangles for some reason, here's the co-ordinates in local space of a five-sided star two units across built from three overlapping triangles:
Triangle 1: [0,-1],[0.38,0.18],[-0.62,0.9]Triangle 2: [-1,-0.28],[1,-0.28],[0,0.46]Triangle 3: [0,-1],[0.62,0.9],[-0.38,0.18]
Took ages to figure that out. I basically drew a star in PaintShop using a preset shape on an image 101x101 pixels, then hovered over the relevant points and wrote down the co-ordinates.
I then deducted 50 from each co-ordinate and divided the result by 50 to get the co-ordinates, then built three triangles from the relevant points.
Hopefully it will be useful to someone, somewhere. [smile]
[LATER]
For my own fading in and out for Pod, I've decided to use a standard fade to black, but combine it with a zoom into the screen as it fades out and a zoom out as it fades in.
This was actually very simple to implement. Because I am using the virtual backbuffer method that I outlined here, all I needed to do was modify the size of the source rectangle for StrectRect().
So basically, there is a FadeAlpha member of engine which, if non-zero, renders a textureless black quad over the entire screen with the relevant alpha value. This is a lot easier to deal with than my previous method of having a global diffuse value that all rendered values were modified by, and while less efficient in some respects, moves the work off the CPU onto the GPU.
Currently, my GraphicsDevice::End() method handles copying the virtual backbuffer onto the actual backbuffer with IDirect3DDevice9::StretchRect(). So all I have done is added a float Zoom parameter to End(), into which I pass FadeAlpha each turn (FadeAlpha being from 0: no fade to 1: all black). End then looks like this:
void GraphicsDevice::End(float Zoom){ Device->EndScene(); RECT SourceRect; if(!Zoom) SourceRect=CreateSimpleRect(1024,768); else { float Across=1024.0f-(512.0f*Zoom); float Down=768.0f-(384.0f*Zoom); SourceRect.left=int((1024.0f-Across)/2.0f); SourceRect.top=int((768.0f-Down)/2.0f); SourceRect.right=SourceRect.left+int(Across); SourceRect.bottom=SourceRect.top+int(Down); } Device->SetRenderTarget(0,BackSurface); BackSurface->Release(); Device->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0,0,0),0,0); Device->StretchRect(DrawSurface,&SourceRect,BackSurface,&DestRect,D3DTEXF_NONE); Device->Present(NULL,NULL,NULL,NULL);}
It's not a brilliant design - End() should probably not really be responsible for the zooming, there should probably be a GraphicsDevice::SetZoom(float) method and maybe when I've finished typing this I'll go back and modify it, but it still works nicely without having to worry any of the other rendering code.
Technically while the fade in is happening, the wrong mouse co-ordinates will get returned by the translator, but I haven't been able to find a situation where this is noticeable, so I'm going to ignore that unless I notice any problems.
Really need to go and redesign this zooming system though - current design sucks. Looks pretty cool on the screen though.
Lately I try not to worry overly about design, unless I figure it will get in the way later on. I find I otherwise spend a lot of time trying to find the right way to do something, only later on having to change everything due to the next part I add. There is a balance somewhere between a great design and a program you make progress with.