iamnick Posted December 4, 2018 Share Posted December 4, 2018 I've been trying to combine two cameras together using a scissor rect function for Unity that I tried to repurpose for Babylon, but I can't seem to get it working. Could someone look at it and tell me what I'm doing wrong? Perhaps there's a better way of doing this inside of Babylon that I'm unaware of? The working Unity script: https://answers.unity.com/questions/1112309/screen-is-2-cameras-with-each-different-properties.html#answer-1112586 The not working playground: https://playground.babylonjs.com/#JJYFI8 The implementation inside of Unity. The cameras both have different clear colors. Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 4, 2018 Share Posted December 4, 2018 In this PG https://www.babylonjs-playground.com/#MXCRPS#4 there are two different scenes in two different viewports. If you need to share some meshes with different properties in each scene there is still plenty of work to do. Not entirely clear about your use case. Multi-scenes documentation Quote Link to comment Share on other sites More sharing options...
iamnick Posted December 4, 2018 Author Share Posted December 4, 2018 @JohnK I still want to use the same scene between both cameras. What i need is have 2 cameras that basically halve the view frustrum. So when using a viewport rect, it resizes the camera view to fill the rect whereas i need to use a scissor rect to instead crop the viewport so that it's like im still seeing it in the regular viewport size but only the area I defined in the rect. The scissor rect is jist cropping the viewport. The included screenshot is a working version of a scissor rect that I'd like to port to Babylon. Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 4, 2018 Share Posted December 4, 2018 Sorry I still do not understand need to wait until someone more skilled or experienced comes along. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2018 Share Posted December 4, 2018 Let me show you how to use scissor testing for that NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2018 Share Posted December 4, 2018 Here we are: https://playground.babylonjs.com/#JJYFI8#1 iamnick, NasimiAsl, jerome and 1 other 3 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 4, 2018 Share Posted December 4, 2018 sorry for ask i don't understand where that used Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 4, 2018 Share Posted December 4, 2018 13 minutes ago, NasimiAsl said: sorry for ask i don't understand where that used Nor do I ! Well done to @Deltakosh for doing what was wanted but other than two different colors where would you use it? Quote Link to comment Share on other sites More sharing options...
iamnick Posted December 4, 2018 Author Share Posted December 4, 2018 @Deltakosh I love it!!! With scissor tests implemented, I think we can officially say Babylon is finally complete? GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
iamnick Posted December 4, 2018 Author Share Posted December 4, 2018 @Deltakosh Would you happen to know why shadows appear broken when using this feature? https://playground.babylonjs.com/#JJYFI8#2 Just noticed that if you change the shadowGenerator texture size to 256, the black box goes away completely. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 5, 2018 Share Posted December 5, 2018 Here is your fix: https://playground.babylonjs.com/#JJYFI8#3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.