Pryme8 Posted December 29, 2017 Share Posted December 29, 2017 https://www.babylonjs-playground.com/#QJE3YB#6 I want to have a false camera that moves around with the standard controls for that camera type and then set it to the uniforms of my shader. The thing is it seems that if the camera is not active the controls do not effect it. Any ideas on how to do this besides manually? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 2, 2018 Share Posted January 2, 2018 Hi p8, happy new year. https://www.babylonjs-playground.com/#14RS6Z#1 Would this help? Camera1 view... is not attached to canvas, so it is frozen. Yet camera controls in ITS view port... can control the other 3 cameras. I'm not exactly sure what you are trying to do, but perhaps with the help of scene.activeCameras ... more options. You probably knew about scene.activeCameras array already, though. Perhaps there are some options with layerMasks and renderingGroups, too... where only certain mesh/cams... get the shader/post-process applied to them. One camera would see all the mesh WITH the post-process, and the other... wouldn't. *shrug* Just speculating. Sometimes when people strive to accomplish a task, they get stuck in a one-way-to-do-it rut. It is easy to forget about sneaking-around in the dirty back-alleys. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2018 Author Share Posted January 3, 2018 Basically I want to not display the camera but hyjack its controls and transform matrices to be input into my ray marching shader. I was attaching the false camera on line 160, but from what your saying though because its not actively rendering to a view its not calculating anything then? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 3, 2018 Share Posted January 3, 2018 you can force the fake camera to be updated like this: https://www.babylonjs-playground.com/#QJE3YB#8 Check line #210 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2018 Author Share Posted January 3, 2018 https://www.babylonjs-playground.com/#QJE3YB#9 that line effectively does nothing that I can see. What I am trying to achieve is have the false camera have the controls still attached to the canvas, even though it is effectively not rendering anything. the main Camera will never move, and does not need controls attached it is just there to render the two triangles with a shader that is raymarching a scene, but I would like to take advantage of all the cool camera controls we have without having to do a bunch of scripting. So the false camera can be moved and manipulated just for the purpose of hijacking its position, target and up vector. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2018 Author Share Posted January 3, 2018 Awww, just did not understand I guess way to be right @Wingnuthttps://www.babylonjs-playground.com/#QJE3YB#12 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 3, 2018 Share Posted January 3, 2018 that? https://www.babylonjs-playground.com/#QJE3YB#13 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2018 Author Share Posted January 3, 2018 https://www.babylonjs-playground.com/#QJE3YB#14 More like this, but its glitchy still which would have to do with my Math... but at least the controls transferred! Now to do a way more robust raymarcher. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 3, 2018 Share Posted January 3, 2018 You should not add the camera to the activeCameras or it will trigger a complete render Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2018 Author Share Posted January 3, 2018 If I dont though, it seems like its ignoring the controls. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 3, 2018 Share Posted January 3, 2018 It works for me here: https://www.babylonjs-playground.com/#QJE3YB#13 You can use keyboard and the camera moves.. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 3, 2018 Author Share Posted January 3, 2018 https://www.babylonjs-playground.com/#QJE3YB#15 Awesome Thank you! Now to implement a cone tracer. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 4, 2018 Author Share Posted January 4, 2018 Kinda unrelated, but do you have any idea why it gets distorted if you move the camera around and get the raymarched object near the edge of the plane. Seems like something screwy is going on and I'm not sure what so I am assuming it has to do with something I am doing, was just hoping someone might know why. 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.