[Constants] global $value = 0.0 global $left = -0.1 global $top = 0.05 global $right = 0.1 global $bottom = 0.0 global $background = 0.0 [ResourceFont] filename = shared/slump.png [CommandListRenderFloat] local $backupX0 = x0 local $backupY0 = y0 local $backupZ0 = z0 local $backupW0 = z0 local $backupX1 = x1 local $backupY1 = y1 local $backupZ1 = x1 local $backupW1 = y1 x0 = window_width y0 = window_height z0 = $value w0 = $background x1 = $left y1 = $top z1 = $right w1 = $bottom run = CustomShaderDrawFloat x0 = $backupX0 y0 = $backupY0 z0 = $backupZ0 w0 = $backupW0 x1 = $backupX1 y1 = $backupY1 z1 = $backupZ1 w1 = $backupW1 [CustomShaderDrawFloat] ; The vertex shader passes constant buffer indexes to the geometry shader: vs = draw_ini.hlsl ; The geometry shader generates the text for a given draw index: gs = draw_ini.hlsl ; The pixel shader draws the font: ps = draw_ini.hlsl ; Allows us to use SV_Position.z to pack a texcoord, increasing the character ; limit per geometry shader invocation: depth_clip_enable = false cull = none ; Enable alpha blending. To change the text colour, edit the pixel shader: blend = add one inv_src_alpha ; Use points as the primitive from the vertex shader to the geometry shader: topology = point_list run = BuiltInCommandListUnbindAllRenderTargets o0 = set_viewport no_view_cache bb ; Font is passed into the pixel shader (to draw it) *and* the geometry shader ; (as the character sizes are encoded in the final character of the font): gs-t100 = ResourceFont ps-t100 = ResourceFont ; Change this number to set how many entries are drawn: draw = 2, 0 post gs-t100 = null post ps-t100 = null