3d model code vs d3d speed

Discussion in 'Programming' started by James222, Aug 28, 2016.

Tags:
  1. James222

    James222 Member

    Joined:
    Aug 26, 2016
    Posts:
    61
    Hey guys so I wanna ask a question about 3d again, what is more efficient for game maker, especially for reasonably complex models to load the model as a .d3d file or to create it in code for example:

    model[2] = d3d_model_create();
    d3d_model_primitive_begin(model[2], pr_trianglestrip);
    d3d_model_vertex(model[2], 100, 100, 0);
    d3d_model_vertex(model[2], 100, 200, 0);
    d3d_model_vertex(model[2], 150, 150, 200);
    d3d_model_vertex(model[2], 100, 200, 0);
    d3d_model_vertex(model[2], 200, 200, 0);
    d3d_model_vertex(model[2], 150, 150, 200);
    d3d_model_vertex(model[2], 200, 200, 0);
    d3d_model_vertex(model[2], 100, 100, 0);
    d3d_model_vertex(model[2], 150, 150, 200);
    d3d_model_vertex(model[2], 100, 100, 0);
    d3d_model_vertex(model[2], 100, 200, 0);
    d3d_model_vertex(model[2], 200, 200, 0);
    d3d_model_primitive_end(model[2]);


    ^ the models im using have arround 1000 lines of d3d_model_vertex

    each room has a few (far more complex then above) model files, I am also using game maker 8.1 for reasons.... well the only reason is im trying to challenge myself and send gm 8.1 out with a bang you could say.
     
  2. Roa

    Roa Member

    Joined:
    Jun 20, 2016
    Posts:
    560
    anything native is always faster, but uhh, you shouldn't see a noticable difference really, even at a few thousand pollies. Just make sure you're not constantly reloading it. Load it once at game or room start and call on it when needed. Not reloading it for every instance or something. Model loading has never been an issue for me. I've loaded half a million polies and even dynamically created models to the count with no major hitching.
     
    KingdomOfGamez likes this.
  3. Roa

    Roa Member

    Joined:
    Jun 20, 2016
    Posts:
    560
    I'm going to hijack a question in here real quick. is it true you can only make one vertex buffer submission? Like, I swore mike said you can only store and send one vertex buffer at a time. Whats your experience on that?
     
    Lonewolff likes this.
  4. lolslayer

    lolslayer Member

    Joined:
    Jun 23, 2016
    Posts:
    689
    Buffers are amazing, but I don't have any experience with them :/
     
  5. Mike

    Mike nobody important GMC Elder

    Joined:
    Apr 12, 2016
    Posts:
    2,355
    Quickest way is to have a 3D model per-generated in a binary file, then load that in using buffer_load(). You can then convert that directly into a vertex_buffer with the single call vertex_create_buffer_from_buffer()

    d3d_models
    are horrible...
     
    Fodderbot, Lonewolff and orange451 like this.
  6. Fodderbot

    Fodderbot Guest

    Consider your art pipeline as well. you could get an artist to make models with a simple modeling program and export it to d3d, but you'll never get one to describe one in code. Not to mention the manhour expenditure to hard code them. Sounds like a complete nightmare for anything more than really basic primitives and hyper-lowpoly shapes. I think that was the reason for 3d modeling programs in the first place.
     
  7. Fodderbot

    Fodderbot Guest

    There was a post by user FredFredrickson that I ran across:
    That would be worth checking out.

    its in a thread called "
    D3D File format information
    "
     
  8. zircher

    zircher Member

    Joined:
    Jun 21, 2016
    Posts:
    379

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice