-
Notifications
You must be signed in to change notification settings - Fork 12
/
Program.fs
54 lines (43 loc) · 1.23 KB
/
Program.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
open Aardvark.Base
open Aardvark.Rendering
open Aardvark.SceneGraph
open Aardvark.Application
module Config =
let Backend = Backend.Vulkan
let Debug : IDebugConfig =
match Backend with
| Backend.GL -> DebugLevel.Normal
| Backend.Vulkan ->
{ Vulkan.DebugConfig.Normal with
ValidationLayer = Some Vulkan.ValidationLayerConfig.DebugPrint
PrintRenderTaskRecompile = false
VerifyShaderCacheIntegrity = true }
module Shader =
open FShade
let printPosition (v : Effects.Vertex) =
vertex {
Debug.Printfn("P = %v4f", v.pos)
return v
}
[<EntryPoint>]
let main argv =
Aardvark.Init()
let win =
window {
backend Config.Backend
display Display.Mono
debug Config.Debug
samples 8
}
let sg =
Sg.quad
|> Sg.shader {
do! DefaultSurfaces.trafo
if Config.Backend = Backend.Vulkan then
do! Shader.printPosition
do! DefaultSurfaces.constantColor C4f.IndianRed
do! DefaultSurfaces.simpleLighting
}
win.Scene <- sg
win.Run()
0