Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.

addSkinModifier(U32 slot, string skinLocation, string skinName, string maskName, ColorI color1 [,color2,3,4=''])

removeSkinModifier(U32 slot)


The engine code now supports up to 30 slots of masked skin modifiers on anything descended from ShapeBase objects. This means all properly skinned models will now be totally dynamically colorable. not-properly-skinned-models can probably be hacked in a hex editor to be dynamically colorable.

Actually, anything that's based on TSShapeInstance's in the engine can do it, but the ConsoleMethods and networked skinning have only been set up in ShapeBase and it's descendants.
This is starting to lead itself quickly to awesomeness.

Now, how do we use it? Razz
%obj.addSkinModifier(0, "p", "base", "mask", "255 255 255 255", "255 0 0 255");

"p" is the texture you want changed, base and mask are skins for that texture. This allows you, for example, to color the top and bottom of an object differently if they have different textures.

For example if you have a model textured with "base.blank.jpg" then you would pick the modifier slot you want (0 - 30), lets call it %n, and call %modelvar.addSkinModifier(%n, "blank", "base", "mask", "255 255 255 255") to apply white over it via mask. Each color channel in mask is treated as an "opacity" for the same channel in the color you are applying.

The slight limitation is that right now the blending routine for the textures is *only* additive, but that's easy enough to turn into an alpha-weighted average.
now make the textures procedural
pretty pretty please
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum