Split-Screen
Moderator: Moderators
Split-Screen
Proper split-screen using opengl32 ( no shader tricks ). Two things to pay attention to ..
- Only clear the screen before the first pass.
- Adjust the Viewport Ratio each pass to match your view.
Example is build for 640x360 resolution.
K
- Attachments
-
- Split-Screen.zip
- (32.48 KiB) Downloaded 1316 times
Judging from your code, please confirm -
The default App.RenderPasses is obviously one (1), in the app component, and you have (3) specified. Yet you have
if(App.CurrentRenderPass)
if(App.CurrentRenderPass == 1)
if(App.CurrentRenderPass == 2)
This signifies the need to offset the index by -1? But then, that would imply the first if(...) has a value of 0. I admit I don't have a full understanding of the render passes.
The default App.RenderPasses is obviously one (1), in the app component, and you have (3) specified. Yet you have
if(App.CurrentRenderPass)
if(App.CurrentRenderPass == 1)
if(App.CurrentRenderPass == 2)
This signifies the need to offset the index by -1? But then, that would imply the first if(...) has a value of 0. I admit I don't have a full understanding of the render passes.
"great expectations"
Correct, the first render pass is 0. Just like when you have a Array with a length of 1, you still need to access it by Array[0] = "Value";
All that renderpasses does / means is how many times the OnBeginRenderPass + OnRender events occur per frame.
+ Screenshot of the example
K
- Attachments
-
- Split-Screen.jpg (136.94 KiB) Viewed 33531 times
Hi everyone, I'm back for some new little games.
Today I was playing with the split-screen method described in this topic, but I have a little problem with your exemple, Kjell.
In the application properties I changed the number of RenderPasses to 4.
In the OnBeginRenderPass, I commented what comes after "Just some camera debugging" so the cameras won't move.
And I changed the Array View like that:
0,180,320,180
320,180,640,180
0,0,320,180
320,0,640,180
Now I have four split screens. The problem is that the ones one the right (P2 and P4) have a shift in their camera position. How can I fix that ?
I provided the modified zgeproj.
Thanks for your help.
Today I was playing with the split-screen method described in this topic, but I have a little problem with your exemple, Kjell.
In the application properties I changed the number of RenderPasses to 4.
In the OnBeginRenderPass, I commented what comes after "Just some camera debugging" so the cameras won't move.
And I changed the Array View like that:
0,180,320,180
320,180,640,180
0,0,320,180
320,0,640,180
Now I have four split screens. The problem is that the ones one the right (P2 and P4) have a shift in their camera position. How can I fix that ?
I provided the modified zgeproj.
Thanks for your help.
- Attachments
-
- Split-Screen.zgeproj
- 4 viewports, bug with a camera shift for the ports 2 and 4 :(
- (4.1 KiB) Downloaded 1080 times
Ooooh. I though it was the coordinates of the little viewports inside the big one
Thanks for your quick response !
-
Edit:
So this morning I started playing with ZGameEditor on Android. Thanks to ZGEAndroid-debug.apk it took mere seconds to watch my stuff working on my phone, then on my Ouya. Splendid!
But the splitscreen is not working at all... I do beleive it's because of opengl32?
Is there a way to bypass that, or is it a dead end?
Thanks
Thanks for your quick response !
-
Edit:
So this morning I started playing with ZGameEditor on Android. Thanks to ZGEAndroid-debug.apk it took mere seconds to watch my stuff working on my phone, then on my Ouya. Splendid!
But the splitscreen is not working at all... I do beleive it's because of opengl32?
Is there a way to bypass that, or is it a dead end?
Thanks
Hi Ats,
K
Does your ZExternalLibrary component have the following in the BeforeInitExp property?Ats wrote:But the splitscreen is not working at all... I do believe it's because of opengl32?
Code: Select all
if(ANDROID)
{
this.ModuleName = "libGLESv1_CM.so";
}
Sorry I'm quite a noob when it comes to that... So I've read through http://www.zgameeditor.org/index.php/Co ... nalLibrary
And added it like that:
http://tinypic.com/r/24gn77m/5
But the app keeps opening and closing.
And added it like that:
http://tinypic.com/r/24gn77m/5
But the app keeps opening and closing.
Hmm,
Not exactly sure what's causing the problem, but attached is a demo / version that does work properly on Android ( using a Nexus 7 at least ).
K
Not exactly sure what's causing the problem, but attached is a demo / version that does work properly on Android ( using a Nexus 7 at least ).
K
- Attachments
-
- Demo.zgeproj
- (2.23 KiB) Downloaded 1075 times
-
- Demo.jpg (71.34 KiB) Viewed 32011 times
Ok... So after A LOT of tries, I finaly discovered that the dat file with a ZExternalLibrary can only be exported using Windows.
I was on linux, running ZGE with Wine. That method can compile exe file without problems, and exporting dat file too. But with the addition of ZExternalLibrary opengl32, the exported dat don't work at all.
Anyway, thanks for your help Kjell, I discovered new ways to add components by watching your example.
Edit: Now, no dat file exported from ZGE under linux/wine are working. Weird but never mind...
Edit 2: I was working with ZGE 3.1b but had ZGEAndroid-debug.apk 3.0 installed on my Android... Now everything is good.
Thanks Kjell !
I was on linux, running ZGE with Wine. That method can compile exe file without problems, and exporting dat file too. But with the addition of ZExternalLibrary opengl32, the exported dat don't work at all.
Anyway, thanks for your help Kjell, I discovered new ways to add components by watching your example.
Edit: Now, no dat file exported from ZGE under linux/wine are working. Weird but never mind...
Edit 2: I was working with ZGE 3.1b but had ZGEAndroid-debug.apk 3.0 installed on my Android... Now everything is good.
Thanks Kjell !