jacquesr Posted March 8, 2016 Share Posted March 8, 2016 Hi guys, I am trying to get a dynamic text texture on my mesh. The texture including dynamic sizing works pretty well, yet each face draws the texture in a different direction. Regarding front,left,right and back sides, I don't really understand why. I don't want to use submeshes/submaterials for performance reasons (i am going to have a lot of meshes in my scene probably) if I can avoid it. Also, I read that updatable meshes are more expensive, too, so if I can, updating the UVMaps afterwards is also something I would like to avoid. Any ideas? http://www.babylonjs-playground.com/#YDO1F#0 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 8, 2016 Share Posted March 8, 2016 hi you can do it with shader because the box is special mesh and have special normal you can set 6 textures and use a simple condition like this if(normal.x > 0) { gl_FragColor = texture2D(txt1 ,uv ); } if(normal.x < 0) { gl_FragColor = texture2D(txt2 ,uv ); } if(normal.z > 0) { gl_FragColor = texture2D(txt3 ,uv ); } if(normal.z < 0) { gl_FragColor = texture2D(txt4 ,uv ); } if(normal.y > 0) { gl_FragColor = texture2D(txt5 ,uv ); } if(normal.y < 0) { gl_FragColor = texture2D(txt6 ,uv ); } and it possible with one texture too but have some more code Quote Link to comment Share on other sites More sharing options...
jacquesr Posted March 8, 2016 Author Share Posted March 8, 2016 Hi, thanks for the suggestion. Meanwhile, I experimented and did that: http://www.babylonjs-playground.com/#YDO1F#1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted March 8, 2016 Share Posted March 8, 2016 oh i get mistake i think you have 6 dynamic texture 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.