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 / Odd alpha problem

Author
Message
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Mar 2011 14:52 Edited at: 27th Mar 2011 14:52
Hi all,

So I\'m having a weird problem with my alpha channels... Here\'s a screen shot:



As you can see, some of the \"weeds\" growing out of the ground are rendering fine, but others have a weird white outline surrounding them where they overlap adjacent tiles.

Let me outline what I\'ve got in the scene. Each square of cobblestone floor is a separate object and the weeds are a part of that. The weeds themselves are just Plain polygons that stand up perpendicular to the ground, but they are part of the floor model and they reference the same texture, which is a PNG file (for the alpha channel) and I use \"SET OBJECT TRANSPARENCY ObjNum, 1\" to make the transparency in the PNG file be applied to the model.

I\'ve attached the texture so you can see what I\'m using.

The really odd thing about this is that the weeds are only getting surrounded by the white when I\'m facing in certain directions. Other directions they render fine (this is shown in the screen shot)

Oh, I'll also note that my backdrop is coloured white and so is my fog.

So does anyone have any idea why this might be happening at all? Let me know if you need any more info and I\'ll do my best to fill you in.

Malevolence: The Sword of Ahkranox
The infinite RPG
http://www.msoa-game.com
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 27th Mar 2011 15:33 Edited at: 27th Mar 2011 15:40
In a different engine I used to use, we sometimes had the same problem.
At the time, it had to do with the fog and multiple layers of transparency getting confused.

As a test, try removing your fog to see if the problem with the weeds goes away. If it does, then you'll at least have a clue as to where to start looking.

EDIT:
You may also want to try moving your ground panels closer together. Make them overlap each other by 1 unit. See if that fixes it. I also recall an issue where we had all kinds of odd issues like that when an object had nothing as a backdrop(No sky or floor... Just open nothing space.) And sometimes, if there was a seam that wasn't properly attached/welded, and there was nothing on the other side of the seam... We'd have the same issues with things overlapping the seam.
It was a different engine, but they were both working off of the same DX9 tech.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2011 15:57
It's happening because your weed polys are being drawn before the rest of the tile. If there was anything under/behind the tile, that would bleed through too.

I have 4 suggestions that you can try (not necessarily in any order):
1. Redesign the tile so that the weeds have better defined polys and so that they don't need transparency.
2. Redesign the tile so that the weeds have their own limb, and so that the limb has a higher number than the rest (that should get it drawn after the rest of the tile).
3. Try disabling zwrite for the objects.
4. Separate the weed polys out into their own separate object

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Mar 2011 16:36
I think using one of the other transparency modes such as 2, 4 or 6 should work - and turn mipmapping off for the weeds as well so they don't fade away too soon in the distance. You can turn off mipmapping using the set object texture command.
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Mar 2011 18:10
Thanks for the responses, guys. Overlapping the models didn't help, however, changing the transparency flag to 4 fixed the issue with the weeds, but now there are big lines between my floor tiles when they are far away from the camera. Still, much preferrable to the weeds, so it gives me a starting position to try and figure this out with!

Thanks again!

Malevolence: The Sword of Ahkranox
The infinite RPG
http://www.msoa-game.com

Login to post a reply

Server time is: 2026-07-16 23:19:29
Your offset time is: 2026-07-16 23:19:29