Jump to content

Save Reflection Probes as 6 images


renjianfeng
 Share

Recommended Posts

HI,I have a scene where I need to create a lot of environment maps, so I used Reflection Probes, and after the mesh and material are ready, do the following:

probe.refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE;

This works especially well.

My question is, I have much more special mesh in the scene, if every time I go to use reflection probes, will extend its load time, so, I want to keep reflected probe the face of the six cubes into images.:)
 

xiaoguo.jpg

Link to comment
Share on other sites

Hello!

You can add this code to the probe texture:

probe.cubeTexture.onAfterRenderObservable.add(() => {

BABYLON.Tools.DumpFramebuffer(width, height, engine, null, "image/png", fileName);

});

Instead of null (4th parameter), you can specify a function which takes a string as parameter. The string is the content of the image capture (png in this case)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...