Rick Posted December 16, 2011 Share Posted December 16, 2011 I'm using CopyEntity() for a cube. I want to paint different mats on this cube but since I'm using CopyEntity() it creates an instance so painting a mat on one does it for all. My needs with this are very basic. My texture would just be white, blue, or red. Ideally I would be able to make a 512x512 where I have 4 256x256 inside of it where each section is a color. Then I always paint the same material on the cubes, but just adjust the texture mappings on the ones I want to show different colors. I know that one nio guy created something like this but for shader. I wonder how would one go about doing this in LE code instead? Shader isn't an option as I don't want other people to have to modify their shader.pak file if they use this Thingoid. Any code or point me in the right direction would be great. Thanks! Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 16, 2011 Share Posted December 16, 2011 why would they have to modify their shader pak? just create a separate shader file instead of modifying the mesh.frag Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted December 16, 2011 Share Posted December 16, 2011 If your texture really only needs to be white, blue, or red, the entity color will work for that. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted December 16, 2011 Author Share Posted December 16, 2011 @ macklebee, good point. Guess I was thinking it had to be in the pak file but I guess it makes sense it doesn't have to be if everything just uses the abstract idea. @Josh, I was trying EntityColor() on these but no matter what I used for Vec4() parameter it was turning the cube black. EntityColor(pick.entity, Vec4(1, 0, 0, 1) would result in a black cube. So just figured it doesn't work since on the wiki under that command it mentions something about not working on Meshs. Quote Link to comment Share on other sites More sharing options...
macklebee Posted December 17, 2011 Share Posted December 17, 2011 for lua: entity:SetColor( color:TVec4, recursive ) granted EntityColor() should still work but it doesn't for whatever reason... and while it does say that it doesn't work on meshes in the command description in the wiki... the very same page also says "This will only have an effect on meshes, lights, emitters and coronas.", which of course it does... as can be seen in a multitude of examples here in this forum. The best bet is to use the Entities page that was created after lua was introduced into LE. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Rick Posted December 17, 2011 Author Share Posted December 17, 2011 thanks 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.