Aller au contenu

Photo

Transparent textures on placeables


  • Veuillez vous connecter pour répondre
45 réponses à ce sujet

#26
Rekov

Rekov
  • Members
  • 75 messages

At the risk (well no, guarantee) of committing some thread necromancy here, with half of the links in here dead, I'm having a little trouble figuring out what I need to do to get translucency of the kind that, for example Temple {Evil Rural} has on its windows.

 

I gather that I need to have the Alpha Blend tag set to 1 and that I can't have a normal map on that packet. I don't understand where the alpha channel comes into play, though. Looking at the model for the above mentioned temple, PLC_BR_TEMPLEE01, the part with the transparency is assigned a texture (PLC_BR_TEMPLEE01Win.dds) that doesn't even have an alpha channel, so I really have no idea how they managed what they did.



#27
Tchos

Tchos
  • Members
  • 5 042 messages

That temple and others like it use the illumination map for those windows.



#28
Rekov

Rekov
  • Members
  • 75 messages

That temple and others like it use the illumination map for those windows.

I guess I still don't see where the translucency comes from. There is only one texture mapped to that rigd, and it doesn't appear to be set to emit. Are they using the glow tag? And if so, how is it only kept to the windows part of the model.

FfoNvZ.png



#29
rjshae

rjshae
  • Members
  • 4 485 messages

The windows in the Evil Temple have their material texture flags set to 0x20, which is the Glow setting. To get that flag on export from Blender, set the 'Emit' value (under Shading in the material properties) to 1.00.



#30
Tchos

Tchos
  • Members
  • 5 042 messages

I don't use Blender, so I don't know that method, but I've used this method for many transparent surfaces, and I do it by making the intended transparent area have a section set to completely transparent with the alpha map, but to have a glow map in that same spot.  I use Gmax for the main work, and then use MDB Cloner to set the texture associations and glow property.  That's how I did these and this, for example.



#31
PJ156

PJ156
  • Members
  • 2 982 messages

I don't use Blender, so I don't know that method, but I've used this method for many transparent surfaces, and I do it by making the intended transparent area have a section set to completely transparent with the alpha map, but to have a glow map in that same spot.  I use Gmax for the main work, and then use MDB Cloner to set the texture associations and glow property.  That's how I did these and this, for example.

 

Have those light been released yet? I don't recognize them ...

 

PJ



#32
Tchos

Tchos
  • Members
  • 5 042 messages

They're back in the Witcher pack v0.388, showcased in the area interior5.



#33
Rekov

Rekov
  • Members
  • 75 messages

For whatever reason I still can't get this to work at all. No matter what I do, I either end up with a glowing but completely opaque thing, or an entirely invisible thing.

 

Do I need to have just an illumination map, or diffuse and normal as well? Do I need to have alpha test/alpha blend on? Or do I set the one map to do both illumination and diffuse color?



#34
Tchos

Tchos
  • Members
  • 5 042 messages

The way I do it is with a single object with a single material for the whole thing, transparent and non-transparent parts alike.  The material is set to use both the alpha map and the glow map, in addition to the standard diffuse, normal, and tint maps.  The alpha map defines which parts will be transparent, and the glow map puts a glow over that same spot in the appearance of a window.



#35
Rekov

Rekov
  • Members
  • 75 messages

Thanks! I finally got this figured out, even though I'm not entirely sure how. It's a shame that there isn't a better way to do transparency (i.e. non glowing).



#36
Tchos

Tchos
  • Members
  • 5 042 messages

There is a non-glowing way, but it can't be done on selected parts of an object -- only on the entire object.  You would have to have the house as one object, and the windows as a separate one.

 

There's also the dither method, but the automatic antialiasing makes it very difficult to get anything that looks passable out of it.



#37
kamal_

kamal_
  • Members
  • 5 240 messages

There is a way to make non-glowy objects with transparency? The waterfall placeables could really use that so they don't remain lit at night.



#38
Tchos

Tchos
  • Members
  • 5 042 messages

I'll demonstrate in a few minutes.



#39
Rekov

Rekov
  • Members
  • 75 messages

https://web.archive....d-translucency/ Found an archive to that DragonLance blog that went down a little less than a year ago. It definitely seems to be doable (only as an SEF maybe?). I have to echo you, kamal. It would be fantastic to replace those water falls.



#40
rjshae

rjshae
  • Members
  • 4 485 messages

You can make 8-bit alpha transparencies as SEF billboards, but they are non-rotatable and don't include a normal map. I used those for part of the decals set.



#41
Tchos

Tchos
  • Members
  • 5 042 messages

I'm not using those methods mentioned.  These are transparency effects applied to normal placeables, not placed effects.  They can be any shape, and of course are rotatable as any placeables are.  See here, where I've used it to make one of the standard crystal placeables and an altar transparent, and also incidentally a character in the background.

 

Here you see it being used for windows.  I may need to use a higher transparency for a better effect.  A disadvantage is that the specularity is also partially transparent, where in reality it would be full strength.  It supports normals, though, as any placeable does, unlike the SEF billboard method.

 

 

Yes, this could be used for the waterfall placeables.


  • rjshae et kamal_ aiment ceci

#42
Rekov

Rekov
  • Members
  • 75 messages

So is that effect achieved with the glow technique, or by some other means?



#43
Tchos

Tchos
  • Members
  • 5 042 messages

No, I said it is not, and I explained how the two techniques differ.  This one as I said is a transparency visual effect applied to an entire placeable.  The placeable has no transparency setting on the model.  It is applied via an effect.



#44
Tchos

Tchos
  • Members
  • 5 042 messages

To explain more fully, at the risk of some repetition, I've written a list of advantages and disadvantages of the methods, 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:

  1. Individual models can have both transparent and opaque parts.  No need to group separate models for opaque and transparent parts.
  2. 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.
  3. Transparency is visible in the toolset as well as in the game.
  4. Since this is not a placed effect, there's no restriction on rotation or movement in any way.

Disadvantages:

  1. 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.
  2. 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.
  3. 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:

  1. 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).
  2. 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.
  3. 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.
  4. 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.
  5. Open your area in the toolset, place the model, and enjoy.

 

Model effect alpha method:

 

Advantages:

  1. Can be applied to any placeable.  Does not require new 2DA entries or anything special to be done to the placeable.
  2. Visual effects are visible behind the transparencies with this method.  You can have flames inside a glass lantern, unlike with the other method.
  3. 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.
  4. Since this is not a placed effect, there's no restriction on rotation, normal maps, specular maps, etc.

Disadvantages:

  1. 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.
  2. 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.
  3. You can't see the transparency effect in the toolset.  Only in the game.

Creation steps:

  1. 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.
  2. Save the effect in your module folder or your campaign, or wherever you prefer to keep your assets.
  3. 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.
  4. Check it in the game, since you can't see it in the toolset.

  • ArtemisJ, GCoyote et 4760 aiment ceci

#45
4760

4760
  • Members
  • 1 204 messages

Glow method:

 

Creation steps:

  1. 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).

Actually, the _i or _g suffix is just a convention (it will still work without it, provided the texture exists).



#46
Tchos

Tchos
  • Members
  • 5 042 messages

I know.  I didn't say otherwise.  I'm instructing people to follow the convention.