Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a parallax effect in MonoGame consisting of multiple semi-transparent layers of textures. The effect is simple, but rendering multiple transparent layers on top of each other is rather slow. This effect doesn't need to be "accurate". How can I optimize this effect or fake it with shaders to make it more efficient?

The main premise is multiple full screen size semi-transparent layers drawn on top of each other from back to front. There are currently 3 layers + the actual game layer that also has some transparency.

I used a stencil buffer to render the game layer, already eliminating some of the parallax layers' pixels from rendering, but it's still inefficient.

share|improve this question
1  
add comment

1 Answer 1

It really depends on what you're trying to render. For example, if you're rendering layers of clouds that are transparent to the background but not necessarily to each other, one useful trick is to draw the background, then non-transparent cloud layers, then draw the background again at 50% transparency over the other layers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.