Putting backdrops on Direct3D
What's the best way to put big (screen sized) backdrops on 2D games with Direct3D? I'm used to just blitting large images with DirectDraw but read somewhere that some 3D cards won't support textures bigger than 256x256.
Mapping a 640x480 texture to a quad works okay on my machine but I'm worried it might fail on other cards. Also seems to massively reduce the number of small sprites I can display in a frame which didn't seem such an issue with DirectDraw.
Thanks.
Quote:Original post by EasilyConfusedI would personally go with the "Screen Aligned Quad" approach. Create a vertex with D3DFVF_XYZRHW and D3DFVF_TEX1 and render it immediately after the Clear() call with no Z-Test/Z-Write.
What's the best way to put big (screen sized) backdrops on 2D games with Direct3D?
Quote:Original post by EasilyConfusedSome very old cards won't - the last popular generation that had such a limit was the Voodoo 3's iirc. Pretty much all decent hardware for the last few years will handle 2048x2048 or larger. Still, it's best to check the device capabilities than to assume anything [smile]
I'm used to just blitting large images with DirectDraw but read somewhere that some 3D cards won't support textures bigger than 256x256.
Quote:Original post by EasilyConfusedWrite a few fallback methods then - most cards can handle screen-sized textures, some will require 2N dimensions and others just won't handle it full stop. You could just go for a "create it as big as the hardware can" and then scale it up on-the-fly - it'll be blurry/low quality - but it'll work.
Mapping a 640x480 texture to a quad works okay on my machine but I'm worried it might fail on other cards.
Quote:Original post by EasilyConfusedWithout any more details about how you're rendering the background it's difficult to say why this might be. You'll get a performance hit for rendering a large texture (just due to the guaranteed number of frame buffer writes) but it shouldn't hurt too badly.
Also seems to massively reduce the number of small sprites I can display in a frame which didn't seem such an issue with DirectDraw.
hth
Jack
Quote:I would personally go with the "Screen Aligned Quad" approach. Create a vertex with D3DFVF_XYZRHW and D3DFVF_TEX1 and render it immediately after the Clear() call with no Z-Test/Z-Write.
Lost me a bit there - bit new to Direct3D and doing everything by messing around with other people's example code I'm afraid. Any good links for some more information on this?
Thanks
Split the image into multiple smaller ones, like:
1024x768 -> 512x512 + 512x512 + 512x256 + 512x256
Then render each one where it should be on the screen (topleft, top right etc...)
1024x768 -> 512x512 + 512x512 + 512x256 + 512x256
Then render each one where it should be on the screen (topleft, top right etc...)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement