New finding about material system

Help and Tips on how IMVU's Create Mode Works
Post Reply
DimitriX89
Sage Pixel
Posts: 42
Joined: Fri Mar 10, 2017 4:01 am

New finding about material system

Post by DimitriX89 » Mon Feb 19, 2018 6:07 am

Not sure if it was known before, but I data mined one new keyword. You all probably know "Skin Composite" flag of the material; it lets you mix your material with "skin" (material index 7 by default) using opacity map. The thing is that the "skin" index can be configured individually for each material! Using "BasecoatMaterialIndex" keyword in Debug tab:
https://gyazo.com/7ec6e57be1bcb9c459abcdca63136c09
https://gyazo.com/eac1af65a9a1a22febc2973945dc58ba
https://gyazo.com/b026397634fcb7791056a052bfd7dfcb

The most evident use is adding animated effects to derivable meshes that do not have extra layers for animation (both "skin" ans "composite" materials can have their animation settings configured individually), and creating new kinds of "anyskin" products (which have something overlayed over eye textures, for example)

DimitriX89
Sage Pixel
Posts: 42
Joined: Fri Mar 10, 2017 4:01 am

Re: New finding about material system

Post by DimitriX89 » Mon Feb 19, 2018 6:21 am

My previous research in the Skin Composite capabilities, from the old forum: http://www.imvu.com/catalog/modules.php ... w=previous (Back then,I did not know about specifying the "skin" material index, so I had to put the "skin" (neon) material in the slot 7 no matter what)

Edit: the info on the old forum is lost. Look further in this thread
Last edited by DimitriX89 on Thu May 09, 2019 7:43 am, edited 1 time in total.

DimitriX89
Sage Pixel
Posts: 42
Joined: Fri Mar 10, 2017 4:01 am

Repost of my Skin Composite Override tutorial

Post by DimitriX89 » Thu May 09, 2019 7:42 am

Since IMVU deleted lot of info from their forums, I have to back up the Skin Composite exploit topic here

Skin Composite override: way to expand your derivation capabilities.

[Lots of text ahead]

Skin Composite feature of IMVU material system is most often used for drawing underwear or
otherwise painting over MCG red parts of clothing products. However, it is not limited to
single task. In the following tutorial, I'll show you how to use Skin Composite to combine
any two materials together. The main benefit of the technique is the ability to combine
animated texture with the static one, or two textures with different animation parameters,
without the need of deriving from a special two-layer mesh.

As an example of effect that needs to be combined with static texture, I'll use "neon"
(gradual change of color over time). The technique will work with most derivable meshes
(later, I'll discuss its limitations); for this example, I chose the furry ears accessory
from Nishi (PID 27004979)

To add extra material slot to the product, we'll need to edit some parameters in Debug02
tab. But first, it is adviced to create the custom *.xrf material file. You can copy and
paste the following text in the notepad:

<HEADER MAGIC="XRF" VERSION="919" />
<MATERIAL NUMMAPS="2">
<AMBIENT>149 149 149 0</AMBIENT>
<DIFFUSE>255 255 255 255</DIFFUSE>
<SPECULAR>229 229 229 0</SPECULAR>
<SHININESS>0</SHININESS>
<MAP TYPE="Diffuse Color">gradient.png</MAP>
<MAP TYPE="Opacity">opacity.jpg</MAP>
</MATERIAL>

,change the map names to whatever you like, or leave them be, and finally save as *.xrf
file. Make sure that the material name editing is enabled in your client's Advanced
properties. In Create mode, derive from mesh you plan to use, open its Project folder and
put your custom *.xrf into it.

Open the Debug-Debug02 tab in Create mode and scroll down to Material entry. Select it,
expand it (if it is collapsed), and press Add Key button at the bottom of Debug window. In
the following "Add new dictionary key" prompt, type "TextureMap#", where # is the number
following an existing TextureMap keys. In my example, it will be "TextureMap2".
Select the newly added key. Add two new Data entries (by pressing the "Add Data" button).
In the first, enter "Asset" in the left field and the name of your custom *.xrf file in the
right field ("neon mat.xrf" in my example), all without quotes. In the second - "Index" and
"7". Apply changes. If everything is done correctly, the empty material slot 7 will appear
after you switch to Meshes tab.

Now, we'll need to create a neon material in the slot 7. It is accomplished by using
horisontal gradient as texture and Cycling as texture animation mode. In my example, I made
a 256x64 rainbow gradient, loaded it as color texture, and entered the following animation
parameters:

Mode: Cycling
Cell Width: 1
Cell Height:64 (your image height; can be any power of 2)
Frames/Cell: 3 (speed of color change)
Start Cell: 1
Number of frames: 256 (X size of your gradient)
Image

The next step will be to create a static material (in my example, in slot 0), which will serve as "upper layer" in Skin Composite. I made a dark brown base texture for ear and an opacity map with a decorative pattern drawn in black.
(Transparent parts of opacity will turn to "neon" when Skin Composite is enabled).
Image
Load the color and opacity textures into your "base" material slot and press "Apply changes" If everything is done right, you'll see a "neon" effect. Congratulations! You can see my result at PID 28107465. I could not leave this mesh as derivable for you, in order to study it in editor, but you can do this with another product of mine: PID 25402062

Now, a couple of words about the technique's drawbacks (compared to actual two-layered or "animated" mesh).

1) No individual material settings except of animation properties. Most material properties (like Self-Illumination and Blending modes) are ignored for "composite" material (that uses Skin Composite). If they are set for "skin" material, they will propagate to "composite" material as well.
2) Since there is a single mesh layer, both materials will share the same UV coordinates. No tiling for one of the layers or other texture coordinate optimizations that can help using texture animation.
3) If the mesh already makes use of material slot 7, technique can not be used. This is true for most clothing items that contain anyskin body parts. However, there are exceptions. If the anyskin parts use material ID number other than 7 (anyskin properties are determined by material *.xrf file, not ID number), you can use this exploit, but you'll absolutely have to put a custom *.xrf into slot 7. Because if you'll tamper with actual "naked skin" material, the mesh will lose its anyskin properties.

Addenum: the method isn't limited to making "neon" effects. Scrolling animation can also be used. It can require a little more work though. To add moving stars above the base texture of the tail (PID 28108947), I had to move the *xrf containing the tail texture from ID 0 to ID 7. This is especially important if the product in question has some sort of opacity map you want to re-use, like fur. In this case, you'll want the opacity-enabled material to be the "skin". If it'd been a "composite" material, the holes made by opacity would be filled with "skin"
Image

Post Reply