Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lots of transparent models in XNA?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 gchewood   Members   -  Reputation: 236

Like
0Likes
Like

Posted 23 April 2013 - 08:50 PM

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.



Sponsor:

#2 VladR   Members   -  Reputation: 722

Like
0Likes
Like

Posted 24 April 2013 - 09:43 AM

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 ?


VladR    My 3rd person action RPG on GreenLight:    http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

 


#3 Norman Barrows   Crossbones+   -  Reputation: 1966

Like
0Likes
Like

Posted 24 April 2013 - 11:46 AM

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?


Norm Barrows

Rockland Software Productions

"Building PC games since 1988"

 

rocklandsoftware.net

 


#4 imoogiBG   Members   -  Reputation: 1056

Like
0Likes
Like

Posted 24 April 2013 - 12:00 PM

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






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS