Jump to content
  • Advertisement
Sign in to follow this  
BigBeginner

Direct3D in 256 color

This topic is 4847 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to use Direct3D8 in 256 colour mode, but I cant initialize: Windowed:= TRUE BackBufferWidth:= 640; BackBufferHeight:= 480; BackBufferCount:= 1; BackBufferFormat:= D3DFMT_P8; SwapEffect:= D3DSWAPEFFECT_DISCARD; Doesnt works. Idea?

Share this post


Link to post
Share on other sites
Advertisement
Newer D3D versions simply don't support palettized framebuffers, P8 is a texture format only and still not widely supported as such.

Share this post


Link to post
Share on other sites
Quote:
Original post by BigBeginner
Ehh... are you telling that? :) then how to use 256 color mode? (DirectDraw is in the waste-basket...)
GDI or D3D7 then perhaps? Not that I see why you'd want to avoid DirectDraw in this context..
I wrote a small tech demo myself which uses pixel shaders to emulate a palettized mode in Direct3D, not that it's very useful in practice.

Why and for what do you want to use a 256-color mode for?

Share this post


Link to post
Share on other sites
Why do you want to use 256 color mode? It has been deprecated by superior color modes. I can see two possible reasons to use a paletized color mode: 1) Performance on older hardware - you area better off using an older version of DX with DirectDraw. and 2) To enable stuff like pallet morphing for 2d games that have night and day cycles and such -- which can be implemented quite easily with alpha blending, pixel shaders, and other modern techniques

Share this post


Link to post
Share on other sites
3) if you just what it to look "classic". If so, then use 16/32 bit mode and just save all the textures in 8 bit color.

Share this post


Link to post
Share on other sites
I want to re-write an old DOS game (re-make). Yes, the first reason is reduce the hardware-demand. 32 bites video card for an 8 bites game? Gahhh... terrible. The second is more dramatic: the game consist some effect, for example fading, lighting, palette-animation... Ok, these effect are implementable, because the surfaces/textures are lockable (but not always), unlockable, etc, but these are EXPENSIVE things... So, an simple palette-index manipulation is more faster. OK, I dont want to run my game at 486, BUT dont want to use at 1,5 GHz AMD, ATI card either...

Share this post


Link to post
Share on other sites
Quote:
Original post by BigBeginner
I want to re-write an old DOS game (re-make). Yes, the first reason is reduce the hardware-demand. 32 bites video card for an 8 bites game? Gahhh... terrible. The second is more dramatic: the game consist some effect, for example fading, lighting, palette-animation... Ok, these effect are implementable, because the surfaces/textures are lockable (but not always), unlockable, etc, but these are EXPENSIVE things... So, an simple palette-index manipulation is more faster. OK, I dont want to run my game at 486, BUT dont want to use at 1,5 GHz AMD, ATI card either...


Use DirectDraw then. DirectX 7 SDK is the last one to include documentations for it, but the newer SDK:s do still contain the headers and libraries needed.

By the way: except true palette animation, the other effects you mention are easily achievable using modern 3d hardware, and orders of magnitude faster than equivalent software implementations as a bonus. Palette animation could also be replaced with true color transformations, such as hue/brightness/saturation shifts and rotations. Just something to think about...

Share this post


Link to post
Share on other sites
Then use DirectDraw, this was the kind of thing it was made for in the first place. Or perhaps DIB sections if you want to handle windowed mode easily.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!