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.

Author
Message
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2010 15:37 Edited at: 24th Sep 2010 15:37
I had never tried to make a small oasis of palm trees.The issue I have is that doing multiple plain objects,the transparency goes wrong in some cases.I have tried with tga bmp jpg png, and all of them have the same problem. Is there a way to correct that, or should I use 3d objects ??.



cheers.

I'm not a grumpy grandpa
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 24th Sep 2010 16:55 Edited at: 24th Sep 2010 16:56
You could try using disable object zread obj. It makes pixels render, whether they're behind another pixel or not.

Cheers!
Sven B

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 24th Sep 2010 18:33
What's the difference between ZWRITE and ZREAD?

I've been using zwrite for these kinda 'errors', should i use the other one?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Sep 2010 18:38
What transparency mode are you using?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2010 19:35 Edited at: 24th Sep 2010 19:38
Quote: "You could try using disable object zread obj. It makes pixels render, whether they're behind another pixel or not"


I tried that and it let me see even palm tree behine the hill




Quote: "What transparency mode are you using? "




This is the bucle I use to put palm trees



cheers.

I'm not a grumpy grandpa
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 24th Sep 2010 20:01
It may be that the image contains artifacts (having perhaps been converted to a lossy format at some point). Perhaps you could post it here so we could take a look?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Sep 2010 20:07 Edited at: 24th Sep 2010 20:09
Are you relying on a single transparent colour such as the default in set image colorkey?

If so, you might have more success using one of the transparency modes in set object transparency such as mode 6.

Edit But you'll need an alpha layer for that. It would help if you posted a typical image as Benjamin said.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2010 20:50 Edited at: 24th Sep 2010 20:52
Ok friends .
@Benjamin
I will add the image in a rar file.

@Green Gandalf
I did what you suggested me, and the quality of the TGA file goes down to much



edited-
what is the best image format for this purpose?

I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2010 21:20 Edited at: 24th Sep 2010 21:27
I`v got it !!...


Quote: "0 - draw first no alpha
1 - draw first with alpha masking
2 and 3 - draw second which overlaps solid geometry
4 - draw second alpha test (only render beyond 0x000000CF alpha values)
5 - water line object (seperates depth sort automatically)
6 - combination of 3 and 4 (second phase render with alpha blend AND alpha test, used for fading LOD leaves)"


What I used this time was second option, and works pretty good

set object transparency i,2




cheers.

I'm not a grumpy grandpa
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Sep 2010 13:38
Quote: "Edit But you'll need an alpha layer for that."


I thought DBP converts most loaded images to an A8R8G8B8-format. DBP searches at the start of the program for the first supported format, which is pretty much always A8R8G8B8, afterwards it uses this type for the rest of the program. When it loads volume textures or cube textures, the format can change though.

I'm glad you found a solution .

Cheers!
Sven B

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2010 14:47
@Sven B
Thanks. Also I have to say that to achieve this, I had to use TGA files because other formats gave me the same unpleasant result.


Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Sep 2010 18:38
Weird. Could you post or email an example image? PNG files always work fine for me.

Sven B

Quote: " thought DBP converts most loaded images to an A8R8G8B8-format."


I meant an alpha layer with information in it of course.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2010 19:43
l have sent the image I used. Then I converted to png with photofiltre,perhaps this was my error. I could save directly from 3Dmax to png to make sure. The png nearly works fine,but sometimes I saw this issue. Thankyou Green Gandalf, as you suggested me the transparensy, and finally it works fine.

Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Sep 2010 21:04
Quote: "l have sent the image I used. "


I haven't received it yet.

Could you re-send it? I've just done a Spam cleanup and it's possible I deleted your message by mistake.

Quote: "Then I converted to png with photofiltre,perhaps this was my error."


Possibly. Some image editing software uses a PNG format that loses information.

You could just use DBPro of course:



chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2010 23:17
Quote: "I haven't received it yet"



I thought it was just me who was getting old ...
The image is in my third post where I make the comparison of the two images... where it says download...any way here you go !!

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Sep 2010 00:47
Quote: "I thought it was just me who was getting old"


Apparently not.

I assumed you meant you'd sent an email when you said "sent" - I didn't bother to check the earlier posts.

Thanks. I'll have a look.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Sep 2010 01:12
I don't know whether I'm missing something but I can't see a difference between the two images.

Here's the code I used. The objects on the left use the TGA file, the ones on the right the PNG file. I tried modes 2 and 6.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Sep 2010 01:15
oHG!! sorry you are right !! ...I had better to say I had posted.... english isn“t my mother lenguage


cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Sep 2010 01:33
No problem.

What about the images?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Sep 2010 01:53 Edited at: 26th Sep 2010 02:35
Re-edited

Your example looks ok...and in my example works too, but sometimes, png looks wrong.

Looking and looking around, I found the error again, and now I`m not sure if it is my laptop or if it is png problem....





I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 26th Sep 2010 03:21 Edited at: 26th Sep 2010 03:22
I think after breaking my head thinking where could be the problem ,I have come to the conclusion that the problem occurs when the palms are touching each other when facing the camera.All palm trees face continuosly camera position so...sooner or later they touch each other when they are so close. At least I can now sleep peacefully



Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Sep 2010 12:43
Yes. I agree. It's probably a z-fighting or render order issue. I expect it's the same whether you use PNG or TGA image files. I usually initialize the random number generator to a fixed value to investigate this sort of thing - it makes it easier to reproduce the symptoms.

Quote: "At least I can now sleep peacefully"


Not too peacefully I hope.
dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 26th Sep 2010 13:59
Yes it's quite clearly a draw order issue, there's not much you can do as you have no direct control over the way DBPro sorts objects. That said, if this is a truly serious problem for you then you can fool DBPro into rendering objects in a different order; objects that have non 1-bit transparency set are drawn from far to near, so you just need to move objects closer to the camera if you want them to be drawn later, and obviously also scale it down by the same ratio so it doesn't get larger.

In my current game the camera is high on the Y axis facing down on the 2D game world so obviously the standard draw order handling is completely useless, so each object has a 'draw priority' variable which pretty much sets its camera distance to 1/priority. But for ensuring trees render in the right order like this is pretty much overkill, you'd be better off just making it so the trees are never that close together.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Sep 2010 14:10
Quote: "objects that have non 1-bit transparency set are drawn from far to near"


I didn't realise it was as exact as that. Thanks.

Quote: "But for ensuring trees render in the right order like this is pretty much overkill, you'd be better off just making it so the trees are never that close together."


Good advice,

Login to post a reply

Server time is: 2026-07-23 15:49:35
Your offset time is: 2026-07-23 15:49:35