DiV Posted February 11, 2018 Share Posted February 11, 2018 I'm using a compressed PNG for refraction postprocess, but it's just black and white noise, so I'd like to generate the texture instead. Is it possible though? I tried procedural textures from the library, but it only resulted in default checkerboard texture appearing. What am I doing wrong? And if procedural textures can't be used this way can I use my texture as a tile, so it wouldn't stretch across the screen changing the scale of the noise? var roadmaterialpt = new BABYLON.RoadProceduralTexture("customtext", 512, scene); var postProcess2 = new BABYLON.RefractionPostProcess("Refraction", roadmaterialpt, new BABYLON.Color3(1.0, 1.0, 1.0), 0.3, 2.0, 1.0, camera); Quote Link to comment Share on other sites More sharing options...
DiV Posted February 11, 2018 Author Share Posted February 11, 2018 I partially solved this problem by using base64-encoded fractal noise from the SVG file, it's the same dataURI now, but I don't need it exactly procedural, I just want some moving ripples, so I'll either stick to updating the depth with Math.sin(looks like the character is breathing) or try to somehow shuffle the part of the string that won't cause major glitches. Here's the new version: https://www.babylonjs-playground.com/#FBW4N#2 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2018 Share Posted February 12, 2018 Hello! As you have found, the RoadProceduralTexture expects an URL and not a texture directly but you can use this hack : https://www.babylonjs-playground.com/#FBW4N#3 DiV 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 12, 2018 Share Posted February 12, 2018 I've just pushed a version where you can call postProcess2.refractionTexture = roadmaterialpt DiV 1 Quote Link to comment Share on other sites More sharing options...
DiV Posted February 12, 2018 Author Share Posted February 12, 2018 I didn't know about "_refRexture" parameter, thank you! Works perfectly and with engine.getRenderHeight()/2 set as texture resolution I think I can finally stop worrying about the screen sizes. GameMonetize 1 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.