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 / How to DRAW all 2d Sprites /Text above 3d objects ?

Author
Message
haliop_New
User Banned
Posted: 27th Oct 2015 16:23
I'm trying to find out how to do ...
cause if the sprite Alpha is set to 255 then it will draw it above the 3d objects...
but if the alpha is lower then it wont draw it right... and all 2d are behind the 3d...

so can someone please explain how it works ?
am I missing something ?

there is probably some kind of one command that will change this from happening .. please share... maybe something with 3d / 2d depth properties ...


thank you for your time.
haliop.
Phat
10
Years of Service
User Offline
Joined: 20th May 2014
Location:
Posted: 27th Oct 2015 16:31
Are you in T1 or T2 ? Have you tried to play with Render2DBack() or Render2DFront() ? This is include on the Sync() command.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Oct 2015 16:38
Also take a look at SetGlobal3DDepth
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
haliop_New
User Banned
Posted: 27th Oct 2015 16:50
I'm using RenderToImage... so its Render and Swap...

how will I use Render2dBack and Front with it ?
and SetGlobal3dDepth dosent seems to have any difference..

Tier 1.
haliop_New
User Banned
Posted: 27th Oct 2015 16:59
once the alpha is lower then 255 the sprites are behind the 3d.. that's just weird..
haliop_New
User Banned
Posted: 27th Oct 2015 17:05
Render2dFront/Back... seems to have also no difference...
haliop_New
User Banned
Posted: 27th Oct 2015 17:27 Edited at: 27th Oct 2015 17:27
ok so I have found the problem...

since I'm using render to image to do some drawings every loop...

its something like this:



and what happens is .. that for some unreasonable reason... the 3d objects are in front of those sprites that use the visible + draw visible - while the other sprites which are always on no matter what does take difference from the SetGlobal3dDepth ..

can someone explain why this is happening ? cause using this system the game run faster... about 100 FPS more.. which is most important when you use RenderToImage.. cause you can manage to draw a lot more..

FIXED FIXED FIXED FIXED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!


ok so as I was writing here I realized something...

when I use to Reshow the 3d objects (again cause of renderToImage...) I did


to fix it



and it is fixed..
so the problem was in my coding.. and I wonder now how I did not noticed it before....
running solid now , everything is good.

thank you.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 27th Oct 2015 18:51
Glad you got it fixed!
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Oct 2015 11:10
..and thanks for sharing the solution!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-09-29 07:26:26
Your offset time is: 2024-09-29 07:26:26