Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / transparency on object textures

Author
Message
Hepy
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location: United Kingdom
Posted: 27th Jul 2004 03:31 Edited at: 27th Jul 2004 03:57
hi, in cartography shop you know you can get a certain color to be transparent in a 3d objects texture, how would you do this in darkbasic pro. I have tried the set image color key command but i can't get it working, the bit which should be transparent then becomes black.

p.s i did set the image color key before i loaded the images, and the rgb values are correct.

thanks for any help,
hepy

Hepy
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 27th Jul 2004 03:56 Edited at: 27th Jul 2004 03:57
you can just use black on the object and set the objects transparency on, that works ok, or you can set a rgb value with the
set image colorkey command, then make an image with that rgb value for the transparent bits, it should work, I can only assume you either have saved the image at a different bitdepth (eg 16 bit) OR you saved the image as JPG, JPG is a lossy compression system that creates something that LOOKS like the image you had, but that section of colour will be messed up and may be quite a way off from what it was saved as, the rule is DONT USE JPG FOR TEXTURES, all you do is save a little disk space since they get converted back to bitmaps internaly anyway when they are loaded, except that a converted JPG is a corrupted bitmap and will bear little relation to the original (on a detailed level that is), and that would mess up the colourkey.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.
Hepy
20
Years of Service
User Offline
Joined: 16th Apr 2004
Location: United Kingdom
Posted: 27th Jul 2004 03:59
Thanks, i learnt alot from your explanation and you solved my problem in one go thanks again!
Hepy

Hepy
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jul 2004 07:30
You could also use a texture format that contains an alpha layer too, such as PNG and TGA - both are non-lossy formats.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-11-27 02:20:06
Your offset time is: 2024-11-27 02:20:06