reddozen Posted August 4, 2014 Share Posted August 4, 2014 Is there a way to render a scene to a texture built into babylon? Kinda like this:http://learningwebgl.com/blog/?p=1786 Quote Link to comment Share on other sites More sharing options...
burbonvagin Posted August 5, 2014 Share Posted August 5, 2014 maybe a mirror texture? i don't think the mirror plane has to be the same as the mesh that the texture is applied to. This might be nonsense because I don't completely understand mirror textures. Tutorial link: https://github.com/BabylonJS/Babylon.js/wiki/14-Advanced-Texturing Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted August 5, 2014 Share Posted August 5, 2014 For the moment I had no need for render to texture in babylon, so I'm not able to answer you precisely, but I know renderTargetTexture exists, I'm pretty sure this could do the job. http://doc.babylonjs.com/page.php?p=24711 (you can easily find related post in the forum) Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted August 5, 2014 Share Posted August 5, 2014 BTW, mirror texture would'n be a good solution, it doesn't do exactly what needed, and it's a lot CPU consuming Quote Link to comment Share on other sites More sharing options...
reddozen Posted August 5, 2014 Author Share Posted August 5, 2014 I guess the better question is can I push things just to the renderbuffer for preprocessing things like depth and visible color mapping, or does this have to be completely done outside of Babylon? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 6, 2014 Share Posted August 6, 2014 You can do that easily with a renderTexture:var renderTexture = new BABYLON.RenderTargetTexture("render", 512, scene, true);scene.customRenderTargets.push(renderTexture); Quote Link to comment Share on other sites More sharing options...
reddozen Posted August 6, 2014 Author Share Posted August 6, 2014 Awesome, I'll play with this tonight. I'll let you know if I run into anything weird. Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 6, 2014 Share Posted August 6, 2014 Here is a playground sample with it : http://www.babylonjs.com/playground/#QOO0F The magic happens when you move the camera ! Cheers, Dad72 1 Quote Link to comment Share on other sites More sharing options...
reddozen Posted August 6, 2014 Author Share Posted August 6, 2014 very cool. I wont be displaying the texture though. I'm going to use it to limit what renders in the scene. Even with octrees on etc, it's still loading models that aren't actually visible to the camera. Like stuff that is inside buildings etc. That being the case, I give up on the octree stuff, and am going to try another route. I'll post my results as this will also be used for level of detail through depth mapping. 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.