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 / White borders in alpha textures (how to get rid of them?)

Author
Message
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 2nd Sep 2008 18:50 Edited at: 2nd Sep 2008 19:00
Using method 1





or two





Everything look's ok in 3d max, no white borders...
Does anybody know why the borders show up in DBP ?

edit: sorry for the topic title, of course I ment "borders" ^^'
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Sep 2008 20:21
Quote: "sorry for the topic title, of course I ment "borders""

No problem, I guessed that was what you meant and fixed it.

Try using one of the other transparency modes too - try modes 4 and 6 to see if it's better.

Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 2nd Sep 2008 20:49
4 and 6 work theoretically but they both look poorly :/ :/





3d max...

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Sep 2008 23:28
Now try disabling culling on them - SET OBJECT CULL objectno, 0

Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 3rd Sep 2008 16:32
Visually there's no diffrence, only much less FPS.

Maybe it has something to do with the png image format? What format do you use for your textures (with alpha) ?
Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 3rd Sep 2008 23:25 Edited at: 3rd Sep 2008 23:34
This is definitely how you rendered your image. I used to get this all the time when using transparent images. You need to clean up the edge of the alpha channel. If you use Photoshop at any point, it's as simple as selecting the black parts of the alpha channel and expanding the selection by 1 pixel, and painting the selection black.

You can use shades of gray in alpha channels to get varied transparency, but only if the gray alpha area has color information. If part of the image has no color information (the background grid shows in Photoshop) but has a non-black alpha value, DBPro renders that area as white.
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 4th Sep 2008 19:39 Edited at: 4th Sep 2008 23:50
Oh, I see. Thank you

edit: except, this is weird...
The white borders are only showing in places where BEHIND the alpha textured mesh is another part of the same mesh.

Or I had another one: the white borders went transparent BUT the transparent parts 'cut out' part's of the mesh behind them.. that's very very weird.

like here



or even diffrent


sick!
Deego
16
Years of Service
User Offline
Joined: 21st May 2008
Location:
Posted: 6th Sep 2008 01:44
That's wild. I don't know what's causing the textures to not be transparent.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 6th Sep 2008 04:31
That happened to me as well, and I never quite fixed it...

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Sep 2008 11:48
Garion have you tryed loading the images with

LOAD IMAGE "GraphicsNatureTreeSeq.png", 1,0

Dark Physics makes any hot drink go cold.
Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 6th Sep 2008 12:00
Quote: "Garion have you tryed loading the images with

LOAD IMAGE "GraphicsNatureTreeSeq.png", 1,0"

No change...

Quote: "That's wild"

Isn't it
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 6th Sep 2008 12:21
have you also tryed the disable zwrite and z depth commands ?
as its always alot of manipulation with some commands together.
commands to try together
object filter
object transparency
object z depth
object zwrite
i always use tga files for alpha transparency created in paintshop pro 7.
i know how do is on the right track with how you load the image to as after 6.9 will you always have to state LOAD IMAGE "GraphicsNatureTreeSeq.png", 1,0 in versions before you didt have to use the full line only LOAD IMAGE "GraphicsNatureTreeSeq.png", 1
cheers
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2008 16:25
Can you upload the model, texture and code you use to load it - then we can maybe tinker ourselves.

dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 6th Sep 2008 17:46
In this image:

You see the two trees at the right, let's call them tree A(lower right) and tree B(top right). The issue is that tree A is being drawn before tree B, but I presume tree A is in front of tree B. This is possibly because DBPro uses a reverse painter's algorithm, but you can't fix this so it doesn't matter. The problem is caused by the Z-Depth of all pixels of tree A whose alpha is greater than 0 being written to the Z-Buffer, but because tree B hasn't been drawn to the frame buffer, when the final colour is written whilst rendering tree A, tree B is never present. In this case the background is the sky, so the alpha is blended between tree A and the sky, when tree B comes to get rendered all its Z-Depth tests against where tree A is will fail(because it's behind it), thus nothing will be drawn. Hence why all parts of where tree A are, tree B gets occluded, you can stop tree A writing to the Z-Buffer to prevent such occlusion taking place, but this isn't an ideal solution; Any objects drawn after it will be drawn before it(unless they fail against something else). If only we had control over the draw order

Garion
16
Years of Service
User Offline
Joined: 7th Dec 2007
Location: Poland
Posted: 6th Sep 2008 19:09
That seems complicated to me, thanks for explaining.

IanM, I've attached the files if anyone would like to play, the code is in first post.

For now I'll use mode 4, better than nothing

Attachments

Login to view attachments
BlobVanDam
16
Years of Service
User Offline
Joined: 26th Jul 2008
Location: one of Cybertrons moons
Posted: 6th Sep 2008 19:41
There is no fix. It's not that you're doing anything wrong. Isn't it just a sorting problem in the DB 3D engine?
Try
20
Years of Service
User Offline
Joined: 16th Aug 2004
Location:
Posted: 6th Sep 2008 23:49 Edited at: 6th Sep 2008 23:53
Quote: "There is no fix. It's not that you're doing anything wrong. Isn't it just a sorting problem in the DB 3D engine?"

Yeah, solid objects are better to be rendered in front-to-back order, while transparent objects shall be rendered in back-to-front order(Painter's Algorithm) or we'll get such weird problems!!!

Cheers,
-Try
Mr Bigger
19
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 6th Sep 2008 23:58 Edited at: 7th Sep 2008 10:58
I agree with most of what the others have said but there is one other way.

Try this.


Might cost a few extra frames though.

And screen shot.
http://myweb.cebridge.net/mrbigger/images/no-lines.jpg

AMD 2600+/1GB ram/GeForce 6600oc 256MB/W2KPro/DBPro 6.6.b
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 7th Sep 2008 12:31
This was mentioned in post 2 by IanM, and no, Alpha Test is much faster than alpha blending. Though it doesn't always give a nice effect for branches.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th Sep 2008 14:30 Edited at: 7th Sep 2008 14:35
have you tryed the old fashioned rgb colour transparency with an bmp file as it usually solves it for me?
and then test various transparency settings.
it was the only thing that worked for me in the rolfenstein code that is in the newsletter.
i used it for the door as it all are built around cubes and i had the same problem as you until i did this.
cheers

the lines you get is pretty much about the texture smoothing as its also done on the alpha level.
had this problem when doing the uv mapped cube within dbp snippet in the snippets section.
as the closest face texture got partially pasted on closest other one.

Login to post a reply

Server time is: 2024-09-27 20:25:32
Your offset time is: 2024-09-27 20:25:32