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 / [SOLVED] Transparency is driving me nuts i tell ya!

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Oct 2018 21:38 Edited at: 25th Oct 2018 21:40
Ok i have these little ducks on a pond. I want to tilt the camera so i can see what's left and right (Use left/right arrow keys in example)



When i do this my little duckies pop right outta the water.



How can i fix this?

Thanks for your help

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

puzzler2018
User Banned
Posted: 25th Oct 2018 21:42
cant think straight at moment but look at the sprite depth commands

water been the nearest depth and the ducks been the furthest ones

like
SetSpriteDepth(water, 0)
SetSpriteDepth(ducks,1)

Or something along those lines

Or is this 3D?

Same idea anyway - depths

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Oct 2018 21:48
It's 3D matey and it's driving me bonkers!
puzzler2018
User Banned
Posted: 25th Oct 2018 21:53 Edited at: 25th Oct 2018 21:55
If you want the You will need to move the water in accordance to the ducks too instead of leaving the water position the same

Those ducks looks getting bigger the nearer they are too or is that optical illusion.

Try fixobjecttoobject ducks to the water so they will always be fixed to one object (the water plane)
basicFanatic
7
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 25th Oct 2018 21:56 Edited at: 25th Oct 2018 22:00
I have noticed this too. Objects that should logically be behind other objects just pop to the front when you move the camera. Way annoying! My solution is to increase the distance.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 25th Oct 2018 22:00
It's a bit of a hack, but you can pretend the water is a lot further forward using:

which fixes the rendering issue.

puzzler2018
User Banned
Posted: 25th Oct 2018 22:02
If you like a quick example of fixobjecttoobject to correct this theory, then please let me know - if you corrected it then well done.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 25th Oct 2018 22:03 Edited at: 25th Oct 2018 22:03
This post has been marked by the post author as the answer.
Hey BlinkOK,

Pretty simple fix. Use SetObjectAlphaMask(water, 1) instead of SetObjectTransparency(water, 1).
puzzler2018
User Banned
Posted: 25th Oct 2018 22:04
If that works too - Good man!!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Oct 2018 22:10
Thanks. I'll try that fixobject thingo too puzzler
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Oct 2018 22:11
Thanks. I'll try that fixobject thingo too puzzler
puzzler2018
User Banned
Posted: 25th Oct 2018 22:16 Edited at: 25th Oct 2018 22:17
Mine is probably more code than its worth trying to fix - Golehorn found it and is enlightened us all with the fix. Thank Golehorn.

To Golehorn, Was it yourself querying shattering objects at all? - I worked out how to shatter loading OBJ objects on another thread. I knew you was asking.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 25th Oct 2018 22:32
Aye, it was me. I will check it out next week. I've been working on a few other things that have bogged me down.
PHeMoX
6
Years of Service
Recently Online
Joined: 9th Jan 2018
Location:
Posted: 26th Oct 2018 00:08
Quote: "Pretty simple fix. Use SetObjectAlphaMask(water, 1) instead of SetObjectTransparency(water, 1)."


Thanks Golegorn, just chiming in that fix solved an issue in one of my games as well. Apparently rendering two planes that are in close range, even with using fixobjecttoobject, can cause the issue the OP mentions.

Login to post a reply

Server time is: 2024-11-23 12:33:24
Your offset time is: 2024-11-23 12:33:24