anchor.diff:                  )
                   |> List.toArray
   
  -        let w = ceil (sqrt (float combinations.Length)) |> int
  +        let print (name : string) (l : list<FShade.Effect>) =
  +            let badForComposition =
  +                FShade.Effect.compose l
  +
  +            printfn "%s:" name
  +            printfn "  vertices:   %A" badForComposition.GeometryShader.Value.shaderOutputVertices
  +            printfn "  primitives: %A" badForComposition.GeometryShader.Value.shaderOutputPrimitives.Value
  +  
  +        let w = 1 + (ceil (sqrt (float combinations.Length)) |> int)
           let h = ceil (float combinations.Length / float w) |> int
   
           let font = Font("Consolas")
   
           win.RenderTask <-
               Sg.ofList [
  -                for i in 0 .. w - 1 do
  -                    for j in 0 .. h - 1 do
  -                        let id = i * h + j
  +                for j in 0 .. h - 1 do
  +                    for i in 0 .. w - 1 do
  +                        let id = i + w * j
                           if id < combinations.Length then
                               let (name, effect) = combinations.[id]
        
                               let label = 
                                   Sg.text font C4b.White (Mod.constant name)
                                       |> Sg.transform (Trafo3d.FromBasis(V3d.IOO, V3d.OOI, V3d.OIO, V3d.Zero) * Trafo3d.Scale(0.1))
  -                                    |> Sg.translate 0.0 0.0 1.5
  +                                    |> Sg.translate 0.0 0.0 1.0
  +
  +                            let mutable blend = BlendMode(true)
  +                            blend.SourceFactor <- BlendFactor.One
  +                            blend.DestinationFactor <- BlendFactor.One
  +                            blend.Operation <- BlendOperation.Add
  +                            blend.SourceAlphaFactor <- BlendFactor.One
  +                            blend.DestinationAlphaFactor <- BlendFactor.One
  +                            blend.AlphaOperation <- BlendOperation.Add
   
                               let inner = 
  -                                Sg.box' C4b.Red Box3d.Unit
  +                                Sg.ofList [
  +                                    Sg.sphere' 3 C4b.Red 0.5
  +                                        |> Sg.translate 0.5 0.5 0.5
  +                                        |> Sg.uniform "Color" (Mod.constant V4d.IOOI)
  +
  +                                    Sg.box' C4b.Blue Box3d.Unit
  +                                        |> Sg.uniform "Color" (Mod.constant V4d.IIOI)
  +                                        |> Sg.translate 1.6 0.0 0.0
  +                                ]   
  +                                    |> Sg.scale 0.5
                                       |> Sg.shader {
                                           do! DefaultSurfaces.trafo
  +//                                        do! fun (v : Effects.Vertex) ->
  +//                                            vertex {
  +//                                                return (uniform?Color : V4d)
  +//                                            }
                                           do! effect
                                           do! Shader.withLightDir
  -                                        do! DefaultSurfaces.constantColor C4f.Red
  +                                        //do! DefaultSurfaces.constantColor C4f.Red
  +
  +
                                           do! DefaultSurfaces.stableHeadlight
  -                                        //do! DefaultSurfaces.simpleLighting
                                       }
  -
  +                                    //|> Sg.fillMode (Mod.constant FillMode.Line)
  +//                                    |> Sg.cullMode (Mod.constant CullMode.Clockwise)
                               yield 
                                   Sg.ofList [
                                       inner
  -                                        |> Sg.cullMode (Mod.constant CullMode.Clockwise)
  -
                                       label
                                   ]
  -                                |> Sg.translate (2.0 * float i) 0.0 (-2.0 * float j)
  +                                //|> Sg.depthTest (Mod.constant DepthTestMode.None)
  +                                |> Sg.translate (2.0 * float i) 0.0 (-1.5 * float j)
   
               ]
               //|> Sg.fillMode (Mod.constant FillMode.Line)
  
positive.code: 
          let extrude (v : Triangle<Vertex>) =
              triangle {
                  let p0 = v.P0.wp.XYZ
                  let p1 = v.P1.wp.XYZ
                  let p2 = v.P2.wp.XYZ
  
                  let c = (p0 + p1 + p2) / 3.0
                  
                  let n = Vec.cross (p1 - p0) (p2 - p1)
                  let ln = Vec.length n
                  let area = 0.5 * ln
                  let n = n / ln
  
                  let ph = c + n * area
  
                  let c = v.P0.c
  
                  let w0 = V4d(p0, 1.0)
                  let w1 = V4d(p1, 1.0)
                  let w2 = V4d(p2, 1.0)
                  let wh = V4d(ph, 1.0)
  
  
  
  //                yield { wp = w0; p = uniform.ViewProjTrafo * w0; n = n; c = c }
  //                yield { wp = w1; p = uniform.ViewProjTrafo * w1; n = n; c = c }
  //                yield { wp = w2; p = uniform.ViewProjTrafo * w2; n = n; c = c }
  //                restartStrip()
  
                  let n = computeNormal w0 w1 wh
                  yield { wp = w0; p = uniform.ViewProjTrafo * w0; n = n; c = c; ldir = V3d.Zero }
                  yield { wp = w1; p = uniform.ViewProjTrafo * w1; n = n; c = c; ldir = V3d.Zero }
                  yield { wp = wh; p = uniform.ViewProjTrafo * wh; n = n; c = c; ldir = V3d.Zero }
                  restartStrip()
  
                  let n = computeNormal w1 w2 wh
                  yield { wp = w1; p = uniform.ViewProjTrafo * w1; n = n; c = c; ldir = V3d.Zero }
                  yield { wp = w2; p = uniform.ViewProjTrafo * w2; n = n; c = c; ldir = V3d.Zero }
                  yield { wp = wh; p = uniform.ViewProjTrafo * wh; n = n; c = c; ldir = V3d.Zero }
                  restartStrip()
  
                  let n = computeNormal w2 w0 wh
                  yield { wp = w2; p = uniform.ViewProjTrafo * w2; n = n; c = c; ldir = V3d.Zero }
                  yield { wp = w0; p = uniform.ViewProjTrafo * w0; n = n; c = c; ldir = V3d.Zero }
                  yield { wp = wh; p = uniform.ViewProjTrafo * wh; n = n; c = c; ldir = V3d.Zero }
                  restartStrip()
  
  
  
negative.code:                 return { v with ldir = V3d.Zero - (uniform.ViewTrafo * v.wp).XYZ |> Vec.normalize; n = (uniform.ViewTrafo * V4d(v.n, 0.0)).XYZ }
              }
  
      open FShade
  
      let run() =
          use app = new VulkanApplication(false)
          let win = app.CreateSimpleRenderWindow(8)
  
  
  