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 / Which manual Render call actually draws the 2D particles on screen?? This is in combination with a full screen Depth of Field shader

Author
Message
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 28th Mar 2018 19:05
I've noticed Render2DFront draws the Print texts and text using fonts stuff. However, when I draw particles (2D, not 3D), those will disappear when I manually control the rendering.

I had guessed Render2DBack and Render2DFront would allow me to display those 2D particles in combination with a Depth of Field full screen shader. However... it's not ever rendered??

I previously had the issue with shadows not rendering without the separate rendershadowmap() call. Which one am I missing now?

This doesn't seem to work;

Render2DBack()
ClearDepthBuffer()
// Depth of Field rendering calls in between
ClearDepthBuffer()
Render2DFront()

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th Mar 2018 20:34 Edited at: 28th Mar 2018 20:37
Its Render2DFront() unless you have used SetGlobal3DDepth() then it will be Render2DBack()

If your particle emitters depth is in front of the 3D depth then its Render2DFront()
if your particle emitters depth is behind the 3D depth then its Render2DBack()

It doesnt look like your doing much wrong with your code but I doubt particles write anything to the depth buffer so depth of feild shader may by be messing with them is my guess.


EDIT: Yes, the RenderShadowMap() is missing from the documentation in Render() and caused me a few headaches too!! Shadows just dissapear when you manually render...grrr
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 28th Mar 2018 21:21
Thanks, yeah I've done a bit of experimenting with Render2DBack (which should be the one I need) and Render2DFront. The Render2DFront does render the Print and text stuff. So one would assume that would be the correct one here.
But I think the transparency blend mode of the particles is complicating things. I'm using additive blending for them, something I forgot to mention. Not sure if that can work in combination with a Depth of Field shader.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Mar 2018 21:40
PHeMoX not sure if this will help

A particle fireworks that leaves a trail
fubar
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 29th Mar 2018 22:42
Thanks, your code did cause me to investigate a few other commands. Apparently I was calling Update3D() but forgot to also call Update2D(). The particles are rendered through Update2D() I guess, because now they do show up.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th Mar 2018 10:46 Edited at: 30th Mar 2018 10:54
They dont get rendered in Update2D() but they do get their positions updated so they wont have even spawned from the particle emitter unless Update() or Update2D() was called



So, If you dont call sync() then you may have to remember to call all 10 different functions depending on what functionality your using in your game. (or at least one of the sub functions like render() )

Ive also found it wierd how Step3DPhysicsWorld () wasnt included by default in Sync() or Update() but I guess it was a later addition. That needs addign right at the start if your using 3d physics
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 30th Mar 2018 12:16 Edited at: 30th Mar 2018 14:10
Thanks, yeah I guess Step3DPhysicsWorld was not included because there is a slight hit in performance? So when you don't need it, it would save some extra fps I think.

Anyway, yeah, I guess Render2DFront should render them, but without Update2D or Update() nothing is updated in terms of positions on top of the Depth of Field shader. I have to admit the order of things matters a lot. But I think I've got it working now, without unnecessary render calls (any of the 10 or so functions we need to call manually).

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Mar 2018 14:58
Looks good PHeMoX
fubar

Login to post a reply

Server time is: 2024-04-18 20:42:17
Your offset time is: 2024-04-18 20:42:17