This project is read-only.

Setting TextureAddressMode in Silversprite

Apr 10, 2010 at 2:43 PM

Hi everybody,

I'm converting my old school sidescrolling game into silverlight.

I'm having some troubles in the performances but the biggest problem now is the unability to set TextureAddressMode to Wrap.

Obviously i can create a workaround for this, but it will cost a lot performance-wise. Is there any way to draw repeated textures in Silversprite?


Statics.spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Immediate, SaveStateMode.None);
            Statics.device.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
            Statics.device.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
            currentSkyRect.X = (int)(Statics.camX/20f);
            Statics.spriteBatch.Draw(sky, baseSkyRect, currentSkyRect, Color.White);

This is the incriminated part...

Thank you!

Apr 11, 2010 at 11:16 PM

Silverlight doesn't support tiling so it would be hard to do this, but it may be possible with a pixel shader. Pixel shaders in Silverlight run on the CPU but it would probably still be faster than doing it with a bunch of sprites. I haven't heard any other requests for this yet, please post a request here:

I'm using the votes on that list to determine what's most important to work on next.