• Advertisement
Sign in to follow this  

Lots of transparent models in XNA?

This topic is 1733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using a billboard-type system for creating the illusion of an outer-glow on some spherical objects in my game.

These are just single models rendered with the basic effect (which seems to handle transparency just fine). However, as soon as I start rendering about 10+ of them, this seems to create a huge lag in my game speed.

Anyone got any ideas/solutions? Wasn't sure what further info I should provide, it doesn't seem to be dependent on the rest of my code at all.

 

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement

When this happens, there are usually two issues:

 

1. Fillrate - reduce the resolution of the texture. Make sure it has mipmaps.

2. Batching of draw calls. Make sure you render as many as possible in a single draw call (e.g. do not render 500 quad with 500 draw calls)

 

What platform / HW are testing it on ?

Share this post


Link to post
Share on other sites

I'm using a billboard-type system for creating the illusion of an outer-glow on some spherical objects in my game.

 

are your "billboards" spheres around the objects, or quads in front of the object?

 

if spheres, do they have a large number of faces? or are they low poly, like 8 faces around a circle?

 

are they alpha tested, or alpha blended?

 

whats your texture size?

Share this post


Link to post
Share on other sites

Draw your alpha blended objects at the end of the frame, I don't forget to turn off alpha bleding when you're drawing non alpha-blended objects!

 

Tip : 

- Try to use clip() function in the pixel shader

- Check the num of triangles in your meshes

- check your texture dimensions (and mip levels)

- batch the scene : Try to bind each texture only once(or something near that) per frame. If you are binding textures very often you WILL slow the whole process down!

- Try to bind each vertex/index buffer only once(well it not that possible)

- The try to use IMMUTABLE BUFFERS

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement