Tchos Posted August 21, 2016 Share Posted August 21, 2016 (edited) This is my guide to the two best methods of creating transparencies and glass effects on placeables in Neverwinter Nights 2, with a list of their advantages and disadvantages, and how to create them. If I've left out anything important that I stated elsewhere, I'll update the steps later. Note that neither method is truly glass-like, which would require full-strength specularity on a normal-mapped object of varying alpha transparency, and of course to really look like glass it would have to distort objects behind it, but these are the best methods as far as I know: Glow method: Advantages:Individual models can have both transparent and opaque parts. No need to group separate models for opaque and transparent parts. Transparency level can vary in the same object, determined by the glow map. You can have a smudged or dirt-caked glass that's barely transparent near the edges, but very clear toward the middle, for instance. Transparency is visible in the toolset as well as in the game. Since this is not a placed effect, there's no restriction on rotation or movement in any way.Disadvantages:Always the same illumination regardless of area light settings (glows in the dark). To mitigate this, you need to adjust the strength of your glow in the texture itself, tailoring it to the lighting of your area, which may require creating multiple versions for different lighting conditions. Visual effects are not visible behind the transparencies with this method. This means that you can't put a flame inside a glass lantern, for example. You can't have a normal map or specular map on this kind of transparency. (In fact, the glow map is being used to simulate specularity on a transparent object, but it does not move with the light as true specularity does.)Creation steps:Make a copy of your diffuse texture map, and add a "_i" to the file name for "illumination" (or "_g" for "glow" if you prefer). In your preferred image editor, open this glow map, and black out the parts of the texture that are not supposed to be transparent. You should probably also darken the image a bit, so the glow isn't too strong. Experiment to see how strong it should be in your area, depending on your area's lighting. In the alpha channel of the diffuse map (if there wasn't one already, create one), black out the areas on the texture that are supposed to be transparent, leaving the rest white. Activate the glow property and the alpha transparency property on the model. I use MDB Cloner for this, by specifying the glow map and ticking the box for alpha transparency, and saving the file. Open your area in the toolset, place the model, and enjoy.Examples:A lamp with the glass represented with the glow effect. A flame would not show behind this one.Jars with brains floating in them, showing two different colours for the glass on the same surface. Model effect alpha method: Advantages:Can be applied to any placeable. Does not require new 2DA entries or anything special to be done to the placeable. Visual effects are visible behind the transparencies with this method. You can have flames inside a glass lantern, unlike with the other method. A single effect can be used for different placeables. You don't need to make a new map when you want a new placeable to be transparent. However, you need to make a different effect if you want a different alpha level (more or less transparent). If you make 9 effects, ranging from 10% to 90%, that should cover all your needs. Since this is not a placed effect, there's no restriction on rotation, normal maps, specular maps, etc.Disadvantages:Can only be applied to an entire object, not parts of one. For objects that require some parts transparent and others opaque such as a window and its frame, you need to create one object to serve as the window and another for its frame. This is not to say you'd need to make a house and put individual windows in each frame -- make a house as one object, and all of its windows as the second object. Same goes for any other kind of object with some transparent parts. One object for all of the opaque parts, and one object for all of the transparent ones. Transparency cannot vary on an object. The whole object is whatever alpha value you set. So you can't create a window with increasing grime around the edges that make it harder to see through at the edges than in the middle. You can create as many effects as you need, with alpha values representing any level of transparency, but only one can be applied to a single object at a time. You can't see the transparency effect in the toolset. Only in the game.Creation steps:Create a visual effect in the toolset's visual effect editor (under the plugins menu). In the Add Event menu, choose GameModelEffect. Under that event's behaviour, set GameModelEffectType to "Change alpha". Set Alpha to a value between 0 and 1. For instance, 0.5 for 50% transparent. Save the effect in your module folder or your campaign, or wherever you prefer to keep your assets. Apply this effect to a non-static placeable. As is typical for this kind of operation, you will need to view it in-game to see it in action. The toolset will not show the transparency. You can apply it in the object's properties, under "Appearance: Special effect", or you can add it through a script. It's possible that the placeable must also have hit points for the effect to work. Make the placeable unusable so it doesn't highlight when you mouse over it. Check it in the game, since you can't see it in the toolset.Examples: Two placeables with the effect applied, with a creature in the far background with the effect applied, showing the transparent crystals slightly overlapping with the transparent creature, showing that multiple overlapping layers of transparencies can be visible. Edited August 21, 2016 by Tchos Link to comment Share on other sites More sharing options...
Sabranic Posted August 22, 2016 Share Posted August 22, 2016 That's pretty wicked. Link to comment Share on other sites More sharing options...
Recommended Posts