   Pixel Drawing and Performance
  I'm working on a isometric game.  All of things calculate and then tile and sprites draw on screen. Drawing on screen is pixel by pixel. In development mode (When I create Direct3D with D3DDEVTYPE_REF) all of things are OK. But when I make a release version (D3DDEVTYPE_HAL) Performance is sucks and there are lot of problems. What is solution for cope over performance when we need pixel by pixel drawing?best wishes   
  Why do you need to draw your sprites pixel by pixel? Why not use D3DX sprites or textured quads? But if you realy need to draw pixels the fastest method should be to draw to a byte array and use a fullscreen texture thats updated every frame.   ;  The most performant way is to lock a texture, and manipulate the pixels of that texture, then render a screen sized quad using that texture. You can double buffer the textures (Display the texture from the last frame while updating another texture) to give a bit of a performance boost at the expense of some lag.   ;  The REF driver is a software engine which renders using the CPU; the HAL driver uses the 3D hardware. If REF looks good and HAL is bad this usually means you have weak (very old) or bad 3D hardware or are using some rendering methods that don't work with your hardware. Or it could mean you have a buggy or bad driver.First make sure your hardware supports the D3D version you use. Then make sure you have all the latest drivers; both the latest DirectX and the latest drivers for your video card.   ;Quote:Original post by sebbitWhy do you need to draw your sprites pixel by pixel? Why not use D3DX sprites or textured quads? But if you realy need to draw pixels the fastest method should be to draw to a byte array and use a fullscreen texture thats updated every frame.Because it is an isometric scene. I calculate place of each tile(Lozenge) and place of sprites over them. Finally pixel of tiles and sprites draw on screen pixel by pixel. I don't know how can make an isometric environment if we don't use pixel by pixel method? anybody have idea or knows sample?thank you sebbit;Quote:Original post by Matt AufderheideThe REF driver is a software engine which renders using the CPU; the HAL driver uses the 3D hardware. If REF looks good and HAL is bad this usually means you have weak (very old) or bad 3D hardware or are using some rendering methods that don't work with your hardware. Or it could mean you have a buggy or bad driver.First make sure your hardware supports the D3D version you use. Then make sure you have all the latest drivers; both the latest DirectX and the latest drivers for your video card.Yes, I know. but this a simple 2D game. I think problem is my method but I don't know better method for draw tiles and sprites in a isometric scene.best;Quote:Original post by shahabBecause it is an isometric scene. I calculate place of each tile(Lozenge) and place of sprites over them. Finally pixel of tiles and sprites draw on screen pixel by pixel. I don't know how can make an isometric environment if we don't use pixel by pixel method? anybody have idea or knows sample?The usual way to do this is to render semitransparent quads, where each quad is a tile. Every second row will then be staggered half a tile in X, so they line up correctly.   ;  You can absolutely do isometric rendering with 'pure' 3D geometry and I actually found it to be both faster and easier to code than the 'old school' 2D methods.Using transformed and lit geometry gives you all the control you need to plot diamond-shaped regions with appropriate texture mapping or, as Steve said, simply render normal square tiles overlapped with transparent regions.Alternatively, just create a proper 3D representation out of boxes/tiles and set up an orthogonal camera. Then you can use all the usual 3D transformation trickery...Basically - coding D3D in a DirectDraw style is just A Bad Thing™ [smile]hthJack   ;Quote:Original post by jollyjeffersYou can absolutely do isometric rendering with 'pure' 3D geometry and I actually found it to be both faster and easier to code than the 'old school' 2D methods.Using transformed and lit geometry gives you all the control you need to plot diamond-shaped regions with appropriate texture mapping or, as Steve said, simply render normal square tiles overlapped with transparent regions.Alternatively, just create a proper 3D representation out of boxes/tiles and set up an orthogonal camera. Then you can use all the usual 3D transformation trickery...Basically - coding D3D in a DirectDraw style is just A Bad Thing™ [smile]hthJackYes , I agree. I think I must use DirectDraw7 or shift in your method. do u have any sample or article about this method?thank you very much;  i'm not quite sure how you want to make detailled floor tiles by drawing them pixel per pixel?have a look at this: http://www.gamedev.net/reference/articles/article738.aspalso the method evil steve suggests (rendering to two textures of your screen size (backbuffering) and not directly to the screen) is very common i think...for the performance point of view it's surely a bit sick to program 2D in Direct3D, but on nowadays' machines we're still talking about 400 to 800 frames (unoptimised and estimated :-))   