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 / how can i make transparent tree???

Author
Message
G T R
19
Years of Service
User Offline
Joined: 26th Apr 2005
Location: Dubai, UAE
Posted: 13th Apr 2006 18:18
i want to a make trees in my game
how can i make a color of the textures transparent
or deos the texture must have transparency layer????
i tried: [set object transparency] and set object
and they didn't work!!!!
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 13th Apr 2006 22:58
have you put a "set image colorkey" in the code to specify which color you want transparent?

Insanity is just a state of mind
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 13th Apr 2006 23:20
I assume you are billboarding

draw the tree with a PURE black background red=0,blue=0,green=0
load it as an image with the extension 1, eg:

load image "tree.bmp",1,1 <<< this extra 1 stops the image being blurred

texture your plain object with it, eg

texture object 1,1

then just make the object use transparency

set object transparency objnum,1 <<< the one turns on the transparency

Daemons set image colorkey is a more advanced command when you want to use some colour other than black for the transparent part of the texture.



Dr Frankenstiens mum told him to make some new friends, not knowing where this was going to lead.
G T R
19
Years of Service
User Offline
Joined: 26th Apr 2005
Location: Dubai, UAE
Posted: 14th Apr 2006 02:01
i tried every thing but still get black areas!
while its a pure black and iam using set object colorkey
G T R
19
Years of Service
User Offline
Joined: 26th Apr 2005
Location: Dubai, UAE
Posted: 14th Apr 2006 02:07 Edited at: 14th Apr 2006 02:31
This is the whole code
and the tree mesh iam using
and an image too




Attachments

Login to view attachments
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 14th Apr 2006 12:43


works here as long as you use .bmp, the .png image doesn`t work, so don`t use it, once the image is loaded a .png takes as much memory as a .bmp, so you don`t save memory using a .png anyway, just load it into paint and save it back out as .bmp , the texture doesn`t quite fit properly though, you can see some cropping around the edges, but other than that it is transparent, in your code you don`t set the transparency as far as I can see, try this and use it as a template if it works, like I said, if you are using black as a transparent color then don`t use the colorkey command.



Dr Frankenstiens mum told him to make some new friends, not knowing where this was going to lead.
G T R
19
Years of Service
User Offline
Joined: 26th Apr 2005
Location: Dubai, UAE
Posted: 14th Apr 2006 15:27
YESSSSSSSSSSS

it worked

really thx man this was going to ruin my project

Login to post a reply

Server time is: 2024-09-24 21:34:45
Your offset time is: 2024-09-24 21:34:45