Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

I looked into how the vertex buffer system works (I try to avoid everything that has a scary name :P) and it seems to not be super difficult to convert the game to use it. Sorry about the delay with the code fixes, it took some time to research it. Based on the example code on the GMS2 manual page on building primitives...

1) Define a vertex format (you'll need position data, texture data, and normal data - you should add them in the same order they're provided as arguments in the d3d_model_vertex/.../ functions)

2) Find the compatibility scripts for the various d3d_model scripts. If you've done any changes to the project, make a backup now, because we'll hack the compatibility scripts.

3) Change d3d_model_create() so it will create a vertex buffer and start a primitive using your custom format:

v_buff = vertex_create_buffer();
vertex_begin(v_buff, global.my_format);
return v_buff;

4) Change d3d_model_vertex_normal_texture() so that it will add vertex data. It's important you add this data in the same order you defined the different data in the vertex format.

vertex_position_3d(v_buff, xx, yy, zz);
vertex_texcoord(v_buff, tx, ty);

5) Change d3d_model_draw() so it will submit the vertex buffer to the pipeline (using a texture):

var tex = background_get_texture(selected_background);
shader_set(shader_prim);
vertex_submit(v_buff, pr_trianglelist, tex);
shader_reset();
6) d3d_model_primitive_begin() now would have no effect, so delete all code in that script.

7) d3d_model_primitive_end() could be emptied, or just use vertex_freeze() to make the vertex buffer read-only (which speeds up drawing it)


Hope this helps! Let me know if there's any problems.