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.

Dark GDK / dbGhostObject not effecting objects created in TreeLife (billboard and real object)

Author
Message
Fatal Berserker
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 21st Sep 2010 14:49 Edited at: 21st Sep 2010 14:50
The other day i wanted to start implementing trees, so i did but i wanted to make the trees fade out if they were far away, and when i want to do grass i want to make them fade out into nothing so it seems abit more realistic (and that the person doesnt realise so much that the grass is only being displayed where they are).

When i do dbGhostObjectOn for objects created in TreeLife (havnt tested in plantlife but i guess itll be the same), it does nothing, the object stays at 100% opacity and you can see clearly now the rain has gone.

Is there any alternative that i can use to fade objects created in these applications?

Thanks in advance

Smoke me a kipper, ill be back for breakfast.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 21st Sep 2010 15:06
use dbAlphaMappingOn ( or dbSetAlphaMappingOn ), if i remember well, it has a parameter to control object's alpha, make far objects have low alpha, the following pseudo code would help:

if ( object closer than x )
{
if ( object farther than y )
set object alpha, you can use x-y and map it to 0-100 (the function range)
}
else
hide object

x is the far plane (where you want your objects to "disappear" after it)
y is the near plane (where you want objects closer than it to have full alpha

Fatal Berserker
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 21st Sep 2010 17:23 Edited at: 21st Sep 2010 17:39
Oh nice thanks, ill give it a shot and edit here how it goes.
Thanks.


I dont think it works how i need it to.
i set the mapping to 50, all trees were invisible.
i put it to 90, all trees were completely visible and solid
i put it to 80, all trees invisible again.

Took out dbSetObjectTransparency (499,4);, to see if it caused the problem, but now it wouldnt change visibility at all.

Finally changed it to dbSetObjectTransparency (499,2); (with other variants) It does do transparency but it leaves a distinct white outline around the leaves and trunk of the tree.

Is there any way i can fix this?

[edit]i made it dbSetObjectTransparency (499,10); it still leaves a white outline but its livable, thanks dude.

Smoke me a kipper, ill be back for breakfast.

Login to post a reply

Server time is: 2024-11-19 18:40:57
Your offset time is: 2024-11-19 18:40:57