Lots of transparent models in XNA?

Started by
2 comments, last by ongamex92 10 years, 12 months ago

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.

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 ?

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

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 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

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

This topic is closed to new replies.

Advertisement