hw3web Posted July 30, 2015 Share Posted July 30, 2015 Hi there is that normal when I switch to : camera.setCameraRigMode(BABYLON.Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH, rigParams); all postprocess effect is missing ! and I realize background is black if do not have any skybox - is there any chance to change it ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 31, 2015 Share Posted July 31, 2015 It works when I call:camera.setCameraRigMode(10,{interaxialDistance: 0.0637}); // 10 is anaglyphWhat camera are you using? Clear color is set by:scene.clearColor = new BABYLON.Color3(1,1,1); // for whiteI am not even sure what you are asking to change. Can you do a playground? Quote Link to comment Share on other sites More sharing options...
hw3web Posted July 31, 2015 Author Share Posted July 31, 2015 So in playgroundhttp://playground.babylonjs.com/#BHX7Q#20 that simple version: http://playground.babylonjs.com/#BHX7Q#21 last 2 lines add postprocess and 3d camera You right about camera you can use clearColor , but can it be Color4 - with transparency as I will like to keep background picture ???? and is look like post process make problem with background - is look like this same ignore Color4 - so mask transparency ??? - IS there chance to keep clearColor in Color4 - so we can keep picture in background with postprocess and real 3d view??? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 31, 2015 Share Posted July 31, 2015 Ah you want your own post process AND a 3D rig at the same time. Maybe. I am on an iPad which is tough for playground (actually drunk is the real problem). try switching the order of two lines. Color4, ask deltakosh Quote Link to comment Share on other sites More sharing options...
hw3web Posted July 31, 2015 Author Share Posted July 31, 2015 and the other thing : BABYLON.Camera.RIG_MODE_VR - 20 ???when I do it is completely wrong : say something about vrMetrics Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 31, 2015 Share Posted July 31, 2015 Did double check gl.clearColor does take an alpha value, so ok at an OpenGL level. SetCameraRigMode clears all post processes. Could be smarter about it & only clear its own. the Oculus thing with vrmetrics I mentioned did not work on github . DK could not reproduce on 2.2If you want, you can make changes if you know typescript. then PR. Quote Link to comment Share on other sites More sharing options...
hw3web Posted July 31, 2015 Author Share Posted July 31, 2015 yes it dose alpha but not when you apply postprocess or SetCameraRigMode , then go down to Color3 ! Quote Link to comment Share on other sites More sharing options...
hw3web Posted August 19, 2015 Author Share Posted August 19, 2015 so anyone know how to make clearColor. with alpha for SetCameraRigMode = 10 ???? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 20, 2015 Share Posted August 20, 2015 Unfortunately we hit a limitation of WebGL here where render texture cannot convey alpha to the canvas Quote Link to comment Share on other sites More sharing options...
hw3web Posted August 20, 2015 Author Share Posted August 20, 2015 clearColor -> color4( 0,0,0,0.00000001) - make a trick but not with 3d camera !? - is fine with rig = 0 for normal camera why with rig = 10,11,12,13 don't work ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 21, 2015 Share Posted August 21, 2015 yep because in this case the rendering is done inside a texture and not directly into the canvas Quote Link to comment Share on other sites More sharing options...
hw3web Posted August 21, 2015 Author Share Posted August 21, 2015 So is any chance to set some picture as background not just single colour when 3d camera is set - rig > 0 ??? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 22, 2015 Share Posted August 22, 2015 I do not know if the answer yes. I know that the shader that combines the 2 camera pieces, always write 1.0 in the alpha channel, forcing no alpha. Here is anaglyph.fragment.fx:#ifdef GL_ESprecision highp float;#endif// Samplersvarying vec2 vUV;uniform sampler2D textureSampler;uniform sampler2D leftSampler;void main(void){ vec4 leftFrag = texture2D(leftSampler, vUV); leftFrag = vec4(1.0, leftFrag.g, leftFrag.b, 1.0); vec4 rightFrag = texture2D(textureSampler, vUV); rightFrag = vec4(rightFrag.r, 1.0, 1.0, 1.0); gl_FragColor = vec4(rightFrag.rgb * leftFrag.rgb, 1.0);}I am not sure what you would change it to. Multiplying the leftFrag alpha with the rightFrags is definitely wrong. To see if anything other than 1.0 did anything, you could just arbitrarily change to 0.2 in the last line. If you did not want to bother setting up to do your own builds, you could probably do a text editor replace against the debug .js file and get away with it. Assuming it works, & does not look bad, you might think about forking the repository to put in a more formal change for your needs. Personally, I suspect it will look bad, & make it harder to visualize a 3D image. 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.