joachim Posted December 9, 2012 Share Posted December 9, 2012 Hi all, when I create a number of cubes throu an array, and I use CopyEntity(cube) in the constructor, will the cubes all have the same material ? If yes , how do I get arround it ? cheers Quote Link to comment Share on other sites More sharing options...
ChrisMAN Posted December 9, 2012 Share Posted December 9, 2012 You should be able to use PaintEntity http://www.leadwerks.com/wiki/index.php?title=PaintEntity Quote Link to comment Share on other sites More sharing options...
joachim Posted December 9, 2012 Author Share Posted December 9, 2012 when I use : PaintEntity( boxArray[7].cubeInClass, materialred); for example, all my cubes in boxArray are red ! Quote Link to comment Share on other sites More sharing options...
Aily Posted December 9, 2012 Share Posted December 9, 2012 You need to fill your array not by CopyEntity(), create each cube separate by CreateCube(). It loose instaces, but make different materials. Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Canardia Posted December 9, 2012 Share Posted December 9, 2012 You can use EntityColor() to color cubes of the same instance differently. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
joachim Posted December 9, 2012 Author Share Posted December 9, 2012 Thanks Guys, EntityColor() works, but what is when I use Texture maps ? I need to use a Texture atlas and change textures (UV coordinates) in run time. Are there any easy solutions arround ? regards Quote Link to comment Share on other sites More sharing options...
Canardia Posted December 9, 2012 Share Posted December 9, 2012 Someone just posted a custom shader for UV scaling and scrolling (=offset), so theoretically it could be possible to use different UV offsets for cubes of the same material/shader, by telling the shader to use different offsets based on some value which different for each cube. The EntityColor could be one such value, so it could be used as a mapping value for a UV offset. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
joachim Posted December 10, 2012 Author Share Posted December 10, 2012 Sounds like a "NO" as an answer to my question ; ) A Skybox with the usual format in extended form would work. Would there be a problem to change the UV coords in run time ? 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.