Sign in to follow this  
Followers 0
gchewood

Lots of transparent models in XNA?

3 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

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 ?

0

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?

0

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

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0