Adding material controllers to objects in Nifskope
Posted by Ghogiel on 15:18, 29 June 2010
Adding Material Controllers to Objects in Nifskope with Ghogiel
Adding a NiMaterialColorController to any object in game is very quick and easy. A NiMaterialColorController in Fallout3 can be used to target and modify the emissive or specular material properties of any mesh object over a time frame. For example you could make an objects self illumination(it does not cast light on other objects) to change and go through any specified rainbow of colors over any specified time frame. you can stack them, ie have both specular and emissive controllers on the same object. And also still have the option of using a glow map to mask the glow effect from areas on the object you don't want to be affected.
I will demonstrate with a simple clutter object, this could be any weapon, architecture, even particle systems. I have not tested on hair, eyes, or any FaceGen enabled objects, nor anything with a special shader set up, but it is confirmed to work on rigged meshes such as armor and creatures.
These work and are set up very similar to Texture Transforms and Alpha Controllers.
Nifskope- use the latest release
Here I have a brain model that I made and have exported it to a nif, it's all setup and ready for game, collision is there, etc. To set up a working NiMaterialColorController you only need to add 3 nodes and link them up and correctly set their values in Nifskope. A relatively simple procedure that even a nifskope novice will be able to accomplish.
Add a NiMaterialColorController. Rightclick the Scene Root Node, Block>insert>NiM...>NiMaterialColorController
In the objects NiMaterialProperty set that block as the Controller.
In the Block Details of the NiMaterialColorController set its Target as the NiMaterialProperty. Now those blocks are linked up.
OK The NiMaterialColorController, For this object I want Target Color as TC_Self_Illum, so I edit the Flags(click the flag icon), enable Active, Loop mode = cycle and Target Color = Emissive. To target the specular property I would obviously target specular.
note: AFAIK Specular color is overridden if a specular map is present for the model, these are stored in the normal maps alpha channel.
note: Fallout ignores ambient and diffuse material properties altogether, Though they are editable in Oblivion nifs, AFAIK it is also ignored by the game, and the ambient color is determined by the lighting and the diffuse color is detrimined by the diffuse map and/or vertex colors.
I also set the Frequency to 1, so that the animation plays fully once during my specified time frame. And I set my specified time frame up as well, start time = 0, and end time = 3
Nifskope displays the time frame in seconds. These games use a 30fps standard. so in 3 seconds you have 90 frames that you can add keys to.
Now you need to add keys to that animation block so it knows what happens and when. Add a NiPoint3Interpolator and a NiPosData. If you were doing NiAlphaControllers or NiTextureTransformControllers use a NiFloatInterpolator and NiFloatData. Either way Rightclick the Scene Root node Block>insert>NiP...> ....
You have to link these up. In the block details of the NiMaterialColorController, set the Interpolator as the NiPoint3Interpolator. The NiMateriColorController is now fully set up.
In the Block Details of the NiPoint3Interpolator, set its 3 point 3 values all to 1. and set the Data as the NiPosData block.
Time to make some animations keys. In the Block Details of the NiPosData, change interpolation to QUADRATIC_KEY.
set Num Keys to 3 (or however many you want). and add time and value. Here the XYZ correspond to RGB values. I used these setting for yellowy greeny pulsing effect. I didn't really give them much thought and it looked alright first time so I left them without further tweaking.
Save the nif.
Move all the textures and the nif to the fallout3 data folder. Right click the nif>open with>GECK to preview the animation. If it doesn't crash then you probably did everything right
To inspect the final nif I ended up with, you can find it in this resource Final Nif Download