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.

AppGameKit Classic Chat / Strange Rendering when trying to get an object to show up behind another

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Sep 2018 18:11
Hey guys,


I have my player setup with different meshes. I am wondering if that is the cause of this strange see through effect, and do I need to make the character all one mesh? Or something else? Thanks for any guidance.



GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 13th Sep 2018 18:40
Don't have an answer but my first impression was that's an awesome fx for making the character stand out when going in foliage and behind objects. Looks intentionally done.
puzzler2018
User Banned
Posted: 13th Sep 2018 18:45 Edited at: 13th Sep 2018 18:46
Maybe

SetObjectTransparency(object,0) - to turn off transparency of an object

SetObjectTransparency(object,1) - to turn on transparency of an object
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Sep 2018 18:59 Edited at: 13th Sep 2018 19:13
Gar, it is intentionally done. But, you can see through the character to the other side when he is not behind anything.

Changing the transparency only makes the silhouette darker or lighter.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 13th Sep 2018 19:12 Edited at: 13th Sep 2018 19:12
Oh yes I can see it now. Sorry about that. Before I was on my cell phone and didn't notice. Am on lunch break on my laptop now and can see it very clearly the characters arm on the other side can be seen right through his body.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 13th Sep 2018 19:35 Edited at: 13th Sep 2018 19:41
Its because you set the depth read mode to 4 then you draw your character


Mode 4 draws things that are further away on top of things that are closer (its the reverse of the normal render mode) ....so on the drawing of your character the arms are drawn on top of the torso even though they are behind the torso. Depth is reversed. This occurs whether he is behind a tree or not in the video.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Sep 2018 20:22 Edited at: 13th Sep 2018 20:23
Ah...


It was combination of of what you said Bengismo and what Puzzler said about transparency. Still can see his arms when he is in the trees, but for now I can live with that. Thank you!



puzzler2018
User Banned
Posted: 13th Sep 2018 20:51 Edited at: 13th Sep 2018 20:54
In reality - should you be able to see objects that are walking behind other objects. There must be a reason for this behaviour - still its worth looking deeply at instead of brushing it off
as it would help others if anyone else get this

You need your character to just not be displayed if walking behind an object then maybe look at culling techniques too maybe
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Sep 2018 22:16
I wanted it to be displayed. Like in most games when the character walks behind a tree. I want a silhouette to appear.
puzzler2018
User Banned
Posted: 13th Sep 2018 22:48
ok - i can work with that
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 16th Sep 2018 21:24
Interesting side effect.

If an object uses SetObjectTransparency( obj, 1) then the player will always be in front of the object. However, if you use SetObjectAlphaMask( obj, 1) then the player's silhouette will be behind the object.

Login to post a reply

Server time is: 2024-03-28 22:53:18
Your offset time is: 2024-03-28 22:53:18