hw3web Posted September 4, 2015 Share Posted September 4, 2015 Hi there , how could I load picture to shaders like pic1 : www.abc.com/pic1.jpg,pic2 : www.abc.com/pic2.jpg,pic3 : www.abc.com/pic3.jpg so then I can use uniform sampler2D pic1;uniform sampler2D pic2;uniform sampler2D pic3; vec3 color1 = texture2D(pic1, vUV).rgb;vec3 color2 = texture2D(pic3, vUV).rgb;vec3 color3 = texture2D(pic3, vUV).rgb; Quote Link to comment Share on other sites More sharing options...
MarianG Posted September 4, 2015 Share Posted September 4, 2015 Hi. In this way.var amigaMaterial = new BABYLON.ShaderMaterial("amiga", scene, {}, {}); amigaMaterial.setTexture("pic1", new BABYLON.Texture(" www.abc.com/pic1.jpg", scene));amigaMaterial.setTexture("pic2", new BABYLON.Texture(" www.abc.com/pic2.jpg", scene));amigaMaterial.setTexture("pic3", new BABYLON.Texture(" www.abc.com/pic3.jpg", scene)); Quote Link to comment Share on other sites More sharing options...
hw3web Posted September 4, 2015 Author Share Posted September 4, 2015 only problem with this is that , it will be connected to scene 'scene' , what if I would like to use this texture independent so can use for few scenes in this same time. ? Quote Link to comment Share on other sites More sharing options...
dbawel Posted September 5, 2015 Share Posted September 5, 2015 Hi bulisor, Would it be possible as was suggested in the title of this post to have a funtional dynamic texture as one of these MultiMaterials - where all 3 textures cover (are mapped to) and are rendered to the entire UV surface of an object? My specific need at this time is to draw on top of an existing image file using a dynamic texture. I've built an an app which draws directly on objects, however, I'm unable to display an image file (texture) on the object and use this function to draw on the object and on top of the image file. I've only tried using MultiMaterials thus far, as this is what I'm familiar with, and hoped this would work using MultiMaterials and a dynamic textured pushed as one of the materials. However, I'm unfamiliar with the setTexture function. Thanks for any assistance you might provide. Cheers. DB 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.