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.

DarkBASIC Professional Discussion / SET OBJECT TRANSPARENCY problem.

Author
Message
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 12th Nov 2003 22:27
In my code I want to hide the black parts of an object in this case leaves on a tree using the following commands:

SET IMAGE COLORKEY 0,0,0
SET OBJECT TRANSPARENCY tree,1

Unfortunately it is not producing the desired effect and I was wondering if anyone has encountered this problem and what is the remedy? If any.

Below is a sample of the problem. As you can see around the leaves is blue as I have highlighted in the red circles.

However if an object like the tree itself, or another leaf, then it works as highlighted in the yellow circles, but not with other objects like the ground and backdrop etc.

Now just to set people straight it is a BMP image with no antialiasing. The texture has been placed on the object plains intersecting each other something like so:
\|/
/|\ (from top)

If anyone can help please let me know,
Cheers,
Karl...


ESC_
22
Years of Service
User Offline
Joined: 29th Aug 2003
Location: Mass.
Posted: 12th Nov 2003 22:41
I'm guessing you didn't set the bg color, right? If so, that would account for the blue. I think setting the transparency with a flag of 2 rather than 1 can fix the problem, but I'm not sure

''For nonconformity, the world whips you with its displeasure''---Ralph Waldo Emerson
OzBot
23
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 12th Nov 2003 22:53
Cheers man setting the value to 2 worked a treat. I don't think the help in DB pro is the best it never mentioned a value of 2.
Oh well can't complain it is working now, once again thanks ESC_.
Regards,
Karl..
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Nov 2003 23:12
whats a value of 2 do?
if you ask me, dbp transparency is just buggy.
The Big Babou
23
Years of Service
User Offline
Joined: 10th Feb 2003
Location: Cyberspace
Posted: 13th Nov 2003 01:48
Quote: "Posted: 17th Apr 2003 23:34

--------------------------------------------------------------------------------
There is a new feature in Patch 4 which solves this problem of the blue anti-alias effect. The effect is caused by the filtered texture transparency taking background colour from the blue backdrop and not from the house. The solution is to have the transparent areas as a seperate model and use the command:

SET OBJECT TRANSPARENCY Object Number, 2

which will place the object at the end of the rendering sequence so your anti-alias draws over the house and not the blue backdrop.
"


quoted from Lee Bamber in a thread long time ago
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Nov 2003 07:38
didn't seem to help for me.
deX
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location:
Posted: 13th Nov 2003 08:30
make sure that when you load the image u set the texture flag to 1, this significantly reduces the problem, but doesnt completely kill it... if anyone knows a way to get rid of it for good please tell me


-deX
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Nov 2003 11:47
Try getting rid of mipmapping too - that has it's own filtering and can blur the black to colour - causing edges around your textures.

I usually bite the bullet and disable filtering altogether, using:

SET OBJECT TRANSPARENCY Obj,1
SET OBJECT TEXTURE Obj,1,0

I don't mind the sharper look, but my current project does'nt let the camera get too close to foliage and trees. For a FPS, I'd consider using a .PNG image with an alpha map to get the best results (Edges fade to the backdrop nicely because the alpha map is like a mask for the image).


Van-B


I laugh in the face of fate!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2003 12:51
You may want to look here for another way to get rid of blue lines:

http://www.thegamecreators.com/?m=forum_view&t=18984&b=15

Agree with Van B, if you dont get up close to the object, just turn off all filtering. It will look pixelly close up but that is the trade off.

I had a lot of success with png's as the edges fade really nice to the background.

There is still a problem when you have lots of transparent objects near each other as they tend to cull each other depending on your current view.

Boo!
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 14th Nov 2003 02:55
WOW!

Just tried that SET OBJECT TRANSPARENCY Obj,2 command and it makes transparent textures look 100 times better!. It fades the edges into the other objects instead of the background - don't disable filtering and add that command then check it out.


Van-B


I laugh in the face of fate!

Login to post a reply

Server time is: 2026-07-26 12:33:24
Your offset time is: 2026-07-26 12:33:24