Good Graphics in DirectDraw

Started by
8 comments, last by PigHeaded 24 years, 1 month ago
Hello, I have a problem and I''m not sure if I should ask it here or in the DirectX forum. I have a small demo program that just displays bitmaps(BMPs). This program is a DirectDraw program set for 800x600x16bit. I created my images in PhotoShop 5.0 and saved them as 24bit bitmaps. As an example I created a small sky image using a simple gradient image from blue to white. When I try to display this image in my program it "bands" the colors. If I set my program to 32bit, it works fine. The problem I have is I need good looking graphics in 16bit mode, No paint program I know of can create 16bit images. How do others create good looking art work for a 16bit game? Is there a way I can set the palette in PhotoShop for 16bit 5-5-5 colors? Thanks in advance, PigHeaded
Advertisement
There is no 16-bit BMP format, your kinda stuck that way. But there is a 16-bit Targa format (.tga) that photoshop can work with, you would have to write your own Targa file loader though.

One person said that the games industry is "a transfer of funds from the rich to the lucky"
Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
If I''m not mistaken d3d rm has a tga loader, review you sdk.
I was influenced by the Ghetto you ruined.
Try to copy your bmp - image to a surface by using the GDI. The GDI converts it to 5-5-5 or wathever is used. Afterwards use blt or bltfast to bring it to the screen!
Thank You all for your suggestions, but nothing has worked. I have tried a TGA file Loaded, a PSD file loader, a GDI BitBlt copy, and the ddutil. but I still get the same "bars across the images when I display them. I am at a loss now. I can go back to 32 bit where everything works fine but that''s realy not an option in the long run. Could some one try to create a simple ddraw app that displays a single 640x220x16 bit bitmap. Create the bitmap using Photoshop and make it a gradient fill. And then let me know if you also get the same color bars across your screen? I''ve tried this on two different computers using different programs to display the bitmaps, but they allways turn out the same way in 16bit mode. Any more ideas?

Thanks,

PigHeaded
I''m wondering if this''ll help you? I''m not exactly sure of what you mean, but it sounds almost the same.


http://www.flipcode.com/cgi-bin/knowledge.cgi?showunit=65


A polar bear is a rectangular bear after a coordinate transform.
A polar bear is a rectangular bear after a coordinate transform.
quote:Original post by PigHeaded

I can go back to 32 bit where everything works fine but that''s realy not an option in the long run. Could some one try to create a simple ddraw app that displays a single 640x220x16 bit bitmap. Create the bitmap using Photoshop and make it a gradient fill. And then let me know if you also get the same color bars across your screen



How about changing your display to 16bpp and viewing that gradient in Photoshop, taking out the ''middleman'' of DirectDraw? If you see the bands appearing in Photoshop when you''re in 16 bit colour, you know it''s a limitation of the colour depth of the display and not the programming. In which case, it can''t be helped. You might want to look into dithering the graphics or something like that.
For 16 bit conversion there''s a freeware program cslled UltraPaint. Search on the Web for "upaint1b.zip"
It says it''s a full paint program but it''s just basic.
But it does convert.

ZoomBoy
A 2D RPG with skills, weapons, and adventure.
See my character editor, Tile editor and diary at
my Web-site
hello again,

Armitage:

That question is exacly what my problem is. The only problem with the response is that he did not give a code example of how to fix the problem. I spent some time looking for a dithering function, but just came up with bits and pieces of very useful information that should allow me to create my own function. I just can''t see any other way around this problem. Does any one else have this problem working with a 16 bit DDraw program?

Kylotan:
I have set the display to 16bpp but Photoshop shows the image correctly, but I opened the image in MS Paint and Paint Shop Pro and the image has the bands. Now one of the problems appears to be the video card. It is a 555 card, the card I have at home is a 565 card. My home system has less banding. So I am assuming that 555 cards are part of the problem. I am currently working on a dithering function. So when I load my images I will check to see if the card is a 555 card and if it is, I will run the image through the dithering function. I have no idea why PhotoShop shows the image correctly and I can''t though.

ZoomBoy:
I looked at the site for Ultra Paint and I am in the process of downloading it now. I noticed it can create a 16 bit image. I will try to create a radiant image with the program and see how well it can display the image. Thanks for the idea.
I believe there are some articles on Gamasutra on dithering, you might wan''t to take a look at them...


"I think, therefore I am...I think"

This topic is closed to new replies.

Advertisement