MinZe Posted July 29, 2018 Share Posted July 29, 2018 Hi, I want to use a samplerCube on my shader created through BABYLON.RenderTargetTexture but I cannot find anything to bind renderTargetTexture to my shader's samplerCube. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 30, 2018 Share Posted July 30, 2018 Hello, just call setTexture on your material, Babylon.js will detect the type and do the binding for you Quote Link to comment Share on other sites More sharing options...
MinZe Posted July 30, 2018 Author Share Posted July 30, 2018 1 hour ago, Deltakosh said: Hello, just call setTexture on your material, Babylon.js will detect the type and do the binding for you Hi, can you tell me what I did wrong here? http://www.babylonjs-playground.com/#UU7RQ#133 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 30, 2018 Share Posted July 30, 2018 Well the texture is not cube but 2d and it was not added to customRenderTargets: http://www.babylonjs-playground.com/#UU7RQ#135 Quote Link to comment Share on other sites More sharing options...
MinZe Posted July 30, 2018 Author Share Posted July 30, 2018 3 hours ago, Deltakosh said: Well the texture is not cube but 2d and it was not added to customRenderTargets: http://www.babylonjs-playground.com/#UU7RQ#135 Oh wow, thanks! And is there a way to render a cubeMap in realtime? or at least, generate it from the things that are on the scene once? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 31, 2018 Share Posted July 31, 2018 But this is the case here, you are rendering to a cubeMap in realtime (the RenderTargetTexture is a cube now because of the last constructor's parameter) Quote Link to comment Share on other sites More sharing options...
MinZe Posted August 1, 2018 Author Share Posted August 1, 2018 Im rendering to a cubeMap, but is not forming a cubemap isn'it? It's just a 2D texture repeated to form a cubeMap right? I want a cubemap of the whole scene, is there a way? Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 1, 2018 Share Posted August 1, 2018 @MinZe what do you mean with it is not a cubeMap, sure it is! What you are looking for ? 2d into 3d reproject ? http://www.babylonjs-playground.com/#UU7RQ#139 Quote Link to comment Share on other sites More sharing options...
Guest Posted August 1, 2018 Share Posted August 1, 2018 It is a real cubemap with 6 different rendering on each faces. I encourage you to use http://spector.babylonjs.com/ to see what is inside each face Quote Link to comment Share on other sites More sharing options...
MinZe Posted August 1, 2018 Author Share Posted August 1, 2018 1 hour ago, Nabroski said: @MinZe what do you mean with it is not a cubeMap, sure it is! What you are looking for ? 2d into 3d reproject ? http://www.babylonjs-playground.com/#UU7RQ#139 I'm looking for a cubeMap render of the whole scene, not just what I can see on the camera, rendered at least once, and thanks for the example, but I think I have the same problem. 52 minutes ago, Deltakosh said: It is a real cubemap with 6 different rendering on each faces. I encourage you to use http://spector.babylonjs.com/ to see what is inside each face Thanks, I just did and I think that it's the same render on each face, here are the screenshots (for the sake of the screenshots, I deleted more elements in order to have only those necessary) And this for all the faces. Am I doing anything wrong? Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 1, 2018 Share Posted August 1, 2018 ok. i get it, i think or we getting closer http://www.babylonjs-playground.com/#UU7RQ#140 Quote Link to comment Share on other sites More sharing options...
MinZe Posted August 1, 2018 Author Share Posted August 1, 2018 On 8/1/2018 at 11:15 AM, Nabroski said: ok. i get it, i think or we getting closer http://www.babylonjs-playground.com/#UU7RQ#140 What you just did reminded me of the reflection probes and it turns out it seems to work: http://www.babylonjs-playground.com/#UU7RQ#141 But If I apply it to the shader like on #136 it does't work correctly http://www.babylonjs-playground.com/#UU7RQ#142 And the sphere seems a little bit bigger(it's not a real problem) 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.