MackeyK24 Posted February 22, 2017 Share Posted February 22, 2017 We use material.effect.setFloat and setTexture so on an so forth... Is there a way to GET a rule from a shader... Unless i am just stupid and don't see it, again How do or can we event getFloat on a value that we can calculate in the shader... or even some present GLSL output property we can read ??? Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted February 22, 2017 Share Posted February 22, 2017 There is not, only the color output at the fragment shader. However there is a trick: you can use pixel color values to encode float output. You can access the pixel output with engine.readPixels after the rendering. This is how the HDR shader works by calculating luminance:https://github.com/BabylonJS/Babylon.js/blob/master/src/PostProcess/babylon.hdrRenderingPipeline.ts#L373 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.