Jump to content


Photo

pr_trianglelist vs pr_trianglestrip! performance difference?!


  • This topic is locked This topic is locked
3 replies to this topic

#1 xDGameStudios

xDGameStudios

    GMC Member

  • GMC Member
  • 71 posts

Posted 08 March 2016 - 01:08 PM

I'm drawing a frame for a window system (rpg style) I only want to draw the frame 9patch style but only the frame so it's really 8patch :P...
The two ways for this I'm looking at are:

 

draw_sprite_ext

Is there a big performance difference between using draw_sprite_ext... or creating a or drawing a primitive texture?!?
 

draw_primitive_begin_texture

I may be wrong but I think the draw_primitive... may be faster... so the problem resides in another question.
for drawing a frame I need to set 22 points using 
pr_trianglestrip or 48 points using pr_trianglelist ((4 corners + 4sides)*3points).
What is best performance wise?!
Thank you for the help

 


  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 08 March 2016 - 07:52 PM

triangle lists are faster (because strip is converted to list internally.... you can make a 3d model (once) if the shape does not change... or a locked vertex buffer (same result as a 3d model for speed).
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#3 xDGameStudios

xDGameStudios

    GMC Member

  • GMC Member
  • 71 posts

Posted 08 March 2016 - 08:23 PM

triangle lists are faster (because strip is converted to list internally.... you can make a 3d model (once) if the shape does not change... or a locked vertex buffer (same result as a 3d model for speed).

The shape doesn't change, but the size does.... it is resizable! how can I make a 3d model?! sorry is there some tutorial or documentation you can point me to?


  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 08 March 2016 - 09:47 PM

in the create:
model = d3d_model_create()
d3d_model_primitive_begin(model,pr_trianglelist)
do your
d3d_model_vertex_*(model,...) calls like you would your draw_vertex_*(...) in the draw
end with
d3d_model_primitive_end(model)


use d3d_model_draw() to draw
you can resize with the d3d_transform_add_scaling()

in the draw:
d3d_transform_add_scaling(1,1,0);
d3d_transform_add_translation(x,y,0);
d3d_model_draw(model,0,0,0,texture);
d3d_transform_set_identity();

Edited by icuurd12b42, 08 March 2016 - 09:48 PM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button