EDIT: here’s a better benchmark. I’m getting 3 million tris at 60 FPS. EDIT it’s 2 million textured with alpha testing
This is a 75px triangle (running at 1280×720 default window) benchmark to see how your system compares to PS2 running BooBoo. You should probably texture the triangle to get a more accurate result. I get about 900,000 textured and 1.2 million untextured per frame.
EDIT: PlayStation 2 claims max 16 million per second, that’s 266,000 per frame.
var tris
= tris 3000000
var font
= font (font_load "font.ttf" 32 1)
var vertex_buffer
call load_vb
set_projection (identity 4) (ortho 0 640 360 0)
function load_vb
{
var verts faces colours normals texcoords
var i
for i 0 (< i tris) 1 next
var x y
= x (rand 0 1280)
= y (rand 0 720)
vector_add verts x y 0
vector_add verts (+ x 6) y 0
vector_add verts x (+ y 6) 0
vector_add faces (+ (* i 3) 0) (+ (* i 3) 1) (+ (* i 3) 2)
:next
= vertex_buffer (create_vertex_buffer (@ verts) (@ faces) (@ colours) (@ normals) (@ texcoords) tris TRUE)
vector_clear verts
vector_clear faces
}
function draw
{
enable_depth_test TRUE
enable_depth_write TRUE
draw_vertex_buffer vertex_buffer
enable_depth_test FALSE
enable_depth_write FALSE
font_draw font 255 255 0 255 (string_format "%(.0f)" tris) 5 50
}
function event type a b c d
{
if (== type EVENT_KEY_DOWN) key
if (== a KEY_UP) up (== a KEY_DOWN) down
= tris (+ tris 100000)
destroy_vertex_buffer vertex_buffer
call load_vb
:up
if (> tris 100000) go
= tris (- tris 100000)
destroy_vertex_buffer vertex_buffer
call load_vb
:go
:down
:key
}

Leave a Reply