Jump to content


Photo

Model Overdraw


  • Please log in to reply
4 replies to this topic

#1 kristian221

kristian221

    GMC Member

  • New Member
  • 650 posts

Posted 03 January 2009 - 06:11 PM

I have learned quickly that avoiding overdraw is a major frame rate saver. I know how to do it with seperate objects, but I have one object drawing a large model and I was wondering if there was a way to avoid overdraw with a large model. Because the level is saved as a model and by setting the alpha to .5 I can see that it is still drawing the entire level even the things behind walls. Is there any way I can keep it a model and avoid the overdraw? If not is there a way to only draw parts of a model at a time?
  • 0

#2 Tepi

Tepi

    GMC Member

  • Global Moderators
  • 4200 posts
  • Version:GM8.1

Posted 03 January 2009 - 06:16 PM

Is there any way I can keep it a model and avoid the overdraw?

Not really.

If not is there a way to only draw parts of a model at a time?

Yes, but it's unlikely to be any faster than keeping it as a model.

Of course, if you are always viewing the model from one side (which I doubt), then it might be resonable to generate the model in such order that the overdraw doesn't happen. But I don't think that avoiding the overdraw beats drawing a model once in speeding technique comparison.
  • 0

#3 biggoron

biggoron

    dura lex sed lex

  • New Member
  • 652 posts

Posted 03 January 2009 - 06:20 PM

Since when was casting fragments a bottleneck in GM's 3D rendering? What hardware are you running? For such a simple shading method, any half-decent computer should be able to cast many millions of pixels that way without breaking a sweat. The best way to speed up a GM game is to just take as much code out of it as possible, i.e. by not bothering with splitting a model up and checking whether or not to draw bits of it.

Edited by biggoron, 03 January 2009 - 06:22 PM.

  • 0

#4 kristian221

kristian221

    GMC Member

  • New Member
  • 650 posts

Posted 03 January 2009 - 07:36 PM

Since when was casting fragments a bottleneck in GM's 3D rendering? What hardware are you running? For such a simple shading method, any half-decent computer should be able to cast many millions of pixels that way without breaking a sweat. The best way to speed up a GM game is to just take as much code out of it as possible, i.e. by not bothering with splitting a model up and checking whether or not to draw bits of it.

Well picture this: in one level the floor model is 2560x2560 pixels, plus the floor beneath that, the cealing model, and not to mention all the wall models throughout the level that reach up to the cealing. I would think that a small bit of code would be much faster than having to draw all that at once. The technique I use to run this is to deactivate all the floor and wall instances except the ones 32 pixels from the player, that way the instance count will be kept VERY low, and at the start of a level all the floor and walls add onto a global level model that is drawn by the camera. So everything is always drawn, but only the ones near the player are active. But even with that drawing a large model will still cause lag. It will run at 30 fps but every few seconds it will lag to 15-20 fps, and I've got a rather good computer too!
  • 0

#5 biggoron

biggoron

    dura lex sed lex

  • New Member
  • 652 posts

Posted 03 January 2009 - 09:03 PM

Pixels are the points of colour on your screen, not the units you use to place things in the world. We're talking about different things. But I think I misunderstood the OP's point anyway.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users