Im doing it on the Geometry shader (4) I can create the quad based on a topleft and the width and height, this all works good.
Now I want to put a border around the rectangle, so as google is my friend I hit, hit it hard for 3 days so many pages of crap(lol). I was searching for bordes around quads, not many things came up at all(google hates me)so I sort of remembered doing a toon shader(good old frank, Thumbs up)many years a go and they where using edge detection so of I go looking for shit on silhouette edges and thing related, theres a few thing about it. found a open gl and a dx10 tut(the gl one was written 10 times better then the dx10, shame that. cant understand gl me)any how I ended up finding a post on here about some one wanting to do edge detection and that(http://www.gamedev.net/topic/434729-silhouette-drawing/). In that post was when I desided to go with 4 quads for the border line.
So I create my first quad in the geometry shader of the first pass works ok.
I then create a new geometry shader for pass2 using 16 returned vertices, this here is where it went all wrong(one of the border lines renders over the whole quad),
if I create 12 vertices this = 3 quads they render fine works great but its only 3 border lines, So I thought I had the quads dimensions wrong.
but when I commented out quad 2 and put quad 4(bottom border) back it worked with 3 border lines.
so back to google find here talks about RestartStrip so now I define the top and bottom quads in the geometry shader then I call RestartStrip I then repeat for the left and right side borders and put a nother RestartStrip after the last quad. Now it works fine .
My question is how should I be using RestartStrip and in my code snipit below how could I improve the code any help would be appreciated.
//--------------------------------------------------------------------------------------
// GEOMETRY SHADER for pas 2 it creates 4 quads around the main rectangle
//of thickness 0.002f// looks about a pixel wide line
//--------------------------------------------------------------------------------------
[maxvertexcount(16)]
void GSPass2( point SPRITE_INPUT sprite[1], inout TriangleStream<PS_INPUT> triStream )
{
PS_INPUT v;
v.opacity = sprite[0].opacity;
//create sprite quad
//--------------------------------------------
//Top quad
//bottom left
v.p = float4(sprite[0].topLeft[0],sprite[0].topLeft[1]-gvThickness,0,1);
v.t = float2(0,1);
triStream.Append(v);
//top left
v.p = float4(sprite[0].topLeft[0],sprite[0].topLeft[1],0,1);
v.t = float2(0,0);
triStream.Append(v);
//bottom right
v.p = float4(sprite[0].topLeft[0]+sprite[0].dimensions[0],sprite[0].topLeft[1]-gvThickness,0,1);
v.t = float2(1,1);
triStream.Append(v);
//top right
v.p = float4(sprite[0].topLeft[0]+sprite[0].dimensions[0],sprite[0].topLeft[1],0,1);
v.t = float2(1,0);
triStream.Append(v);
//triStream.RestartStrip();
//////////end quad top
//quad Bottom
//bottom left
v.p = float4(sprite[0].topLeft[0],sprite[0].topLeft[1]-sprite[0].dimensions[1],0,1);
v.t = float2(0,1);
triStream.Append(v);
//top left
v.p = float4(sprite[0].topLeft[0],sprite[0].topLeft[1]-sprite[0].dimensions[1] + gvThickness,0,1);
v.t = float2(0,0);
triStream.Append(v);
//bottom right
v.p = float4(sprite[0].topLeft[0]+sprite[0].dimensions[0],sprite[0].topLeft[1]-sprite[0].dimensions[1],0,1);
v.t = float2(1,1);
triStream.Append(v);
//top right
v.p = float4(sprite[0].topLeft[0]+sprite[0].dimensions[0],sprite[0].topLeft[1]-sprite[0].dimensions[1] +gvThickness,0,1);
v.t = float2(1,0);
triStream.Append(v);
triStream.RestartStrip();
//////////end quad Bottom
//quad Left side
//bottom left
v.p = float4(sprite[0].topLeft[0],sprite[0].topLeft[1]-sprite[0].dimensions[1],0,1);
v.t = float2(0,1);
triStream.Append(v);
//top left
v.p = float4(sprite[0].topLeft[0],sprite[0].topLeft[1],0,1);
v.t = float2(0,0);
triStream.Append(v);
//bottom right
v.p = float4(sprite[0].topLeft[0]+ghThickness,sprite[0].topLeft[1]-sprite[0].dimensions[1],0,1);
v.t = float2(1,1);
triStream.Append(v);
//top right
v.p = float4(sprite[0].topLeft[0]+ghThickness,sprite[0].topLeft[1],0,1);
v.t = float2(1,0);
triStream.Append(v);
triStream.RestartStrip();
//////////end quad Left
//quad Right side
//bottom left
v.p = float4(sprite[0].topLeft[0] + sprite[0].dimensions[0]- ghThickness ,sprite[0].topLeft[1]-sprite[0].dimensions[1],0,1);
v.t = float2(0,1);
triStream.Append(v);
//top left
v.p = float4(sprite[0].topLeft[0] + sprite[0].dimensions[0] - ghThickness,sprite[0].topLeft[1],0,1);
v.t = float2(0,0);
triStream.Append(v);
//bottom right
v.p = float4(sprite[0].topLeft[0]+sprite[0].dimensions[0],sprite[0].topLeft[1]-sprite[0].dimensions[1],0,1);
v.t = float2(1,1);
triStream.Append(v);
//top right
v.p = float4(sprite[0].topLeft[0]+sprite[0].dimensions[0],sprite[0].topLeft[1],0,1);
v.t = float2(1,0);
triStream.Append(v);
triStream.RestartStrip();
//////////end quad Right
}//end
///////////////////////////////////////////////////////////////////////////////////////////////////////////