Starfield (in the background)
Posted: Mon Mar 03, 2014 6:57 pm
Hi everybody !
Today I was playing with particles to make a good old starfield, like the windows 95 screensaver.
In order to keep it fixed even if I move the camera around, I'm using two RenderPasses. One with a fixed camera where I only render the stars, and a second with a moving camera and flying 3D blocks.
But I have one main problem:
Why are the stars of the first renderpass are showing above the blocks of the second rendepass? I thought that renderpass was determining the order of the things to render.
Next, is that a good idea to use it like that? In my example, I'm testing the number of App.CurrentRenderPass on each models (starfield and cube) before rendering them. Do I have to do that for each and every models of the game? Or is there another method?
And last, I'm playing around with the camera position in the OnBeginRenderPass of the App. Is that how I should do it? Because I'm not sure about that for when I'll have several AppStates, or camera attached to models...
Thanks for your help !
Today I was playing with particles to make a good old starfield, like the windows 95 screensaver.
In order to keep it fixed even if I move the camera around, I'm using two RenderPasses. One with a fixed camera where I only render the stars, and a second with a moving camera and flying 3D blocks.
But I have one main problem:
Why are the stars of the first renderpass are showing above the blocks of the second rendepass? I thought that renderpass was determining the order of the things to render.
Next, is that a good idea to use it like that? In my example, I'm testing the number of App.CurrentRenderPass on each models (starfield and cube) before rendering them. Do I have to do that for each and every models of the game? Or is there another method?
And last, I'm playing around with the camera position in the OnBeginRenderPass of the App. Is that how I should do it? Because I'm not sure about that for when I'll have several AppStates, or camera attached to models...
Thanks for your help !