Aller au contenu

Photo

Creating Transparent (Glass) Meshes


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

#1
drechner

drechner
  • Members
  • 300 messages

I'm trying (and failing) to create a transparent glass placeable. From my understanding transparent meshes need to be created by doing the following:

 

  1. Setting the mesh to "Glow" (Glow (nolight) in the expotron utility settings)
  2. Setting the material to use a Self-Illumination map
  3. Making a self-illumination map that's black

 

Doing this makes the mesh opaque and glow. Changing the glow map to use transparency doesn't appear to affect it at all. I'm sure I'm missing something or doing something stupid. Does anyone know how to create a transparent mesh?

 

Thanks in advance!



#2
4760

4760
  • Members
  • 1 207 messages

Making a self-illumination map that's black

This is why the mesh is opaque. The parts that will glow are the ones for which the texture is not black.

I guess you'll have to use a fully transparent (100% alpha) texture, although I'm not too sure about it.



#3
rjshae

rjshae
  • Members
  • 4 491 messages

Kalister looked to have success with his lab jars, so you could examine those to see what he did.

 

What seems to be the case with a VFX is that a mesh can't use 8-bit alpha transparency if it has a normal map.



#4
Tchos

Tchos
  • Members
  • 5 054 messages

His lab jars were inspired by my experiments in transparent glass in the Witcher lab tanks.  Yes, the texture map must have 100% alpha transparency in the intended glass area, so that there's a mesh there, but it's not showing anything.  Then use an illumination map where everything is black except for your glass.  Adjust the strength as needed for your environment's lighting conditions.



#5
drechner

drechner
  • Members
  • 300 messages

Thanks for all the help! I'll give it a shot and see if I can get it working :)



#6
drechner

drechner
  • Members
  • 300 messages

Hmmm... it's still glowing no matter what I seem to do. I have three maps:

  1. Diffuse (texture with no transparency)
  2. Normal (texture with no transparency)
  3. Glow (completely transparent)

I'm guessing I'm still missing something?



#7
Tchos

Tchos
  • Members
  • 5 054 messages

It's going to glow.  We're using the glow as a stand-in for the lack of semi-transparency.  Therefore, you need to adjust the strength of the glow so that it matches the lighting of your area, such that it looks like a transparent object and not something that's glowing.  See here, where I have a lantern with glass.  The glowing could be reduced a little, but at the current strength it could just be "catching the light".

 

BTW, transparency != alpha channel.  I'm going to interpret your list as meaning 1 has no alpha channel (bad -- you need an alpha channel for the "glass" parts), 2 has no alpha channel (bad -- you want an alpha channel for the specular map for the non-glass parts), and 3 has an alpha channel (you don't need one for the glow map -- just darken the image if it's too bright).



#8
drechner

drechner
  • Members
  • 300 messages

It's going to glow.  We're using the glow as a stand-in for the lack of semi-transparency.  Therefore, you need to adjust the strength of the glow so that it matches the lighting of your area, such that it looks like a transparent object and not something that's glowing.  See here, where I have a lantern with glass.  The glowing could be reduced a little, but at the current strength it could just be "catching the light".

 

BTW, transparency != alpha channel.  I'm going to interpret your list as meaning 1 has no alpha channel (bad -- you need an alpha channel for the "glass" parts), 2 has no alpha channel (bad -- you want an alpha channel for the specular map for the non-glass parts), and 3 has an alpha channel (you don't need one for the glow map -- just darken the image if it's too bright).

Ah, okay; so if I understand this correctly, the *diffuse* transparency is the part that matters? 

 

BTW, the entire mesh is glass, so there's no opaque parts of the model. BTW#2, the glass in your lantern is exactly what I'm going for; yours looks great!



#9
Tchos

Tchos
  • Members
  • 5 054 messages

Yes, you're going to want the diffuse map to have an alpha channel that's completely black for your transparent areas, which in your case is the entire map.  It will not matter what's in the RGB channels of the diffuse map in your case, since it's entirely transparent.  As for the glow map, anything in the RGB channels will appear as a glow, and the brighter it is, the stronger the glow.  Thus, use a fairly dark image for your glow map -- mostly black, with some dim grey to represent smudges, scratches, imperfections, or frosted bits.  You can ignore my earlier comments about the normal map needing an alpha channel in this case, since your model is entirely glass with no opaque parts.



#10
drechner

drechner
  • Members
  • 300 messages

Thank you so much for your help! I got it working, though oddly enough, I'm not entirely sure why it's working. I'm going to not question it any further for the moment and just be happy that it actually is :P



#11
Tchos

Tchos
  • Members
  • 5 054 messages

I'll be interested to see a screenshot of it whenever you're ready to show something.  :)



#12
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I made glass display cases in islander. All I did was apply a visual effect that granted 60% or so transparency. Easy

#13
Tchos

Tchos
  • Members
  • 5 054 messages

Yes, that is a way to do it if you want a smooth, unblemished surface with unvarying levels of transparency.



#14
-Semper-

-Semper-
  • Members
  • 2 256 messages

You can ignore my earlier comments about the normal map needing an alpha channel in this case, since your model is entirely glass with no opaque parts.

 

would it not be better to have a bright grey to almost white (in some parts) spec map? glass is reflecting light, at least the clean parts not coated with dust and scratches :D



#15
Tchos

Tchos
  • Members
  • 5 054 messages

It would be, but I don't think it will work.  I could be wrong, but I don't think the specular map is applied to areas that are marked as transparent in the diffuse map.



#16
Dann-J

Dann-J
  • Members
  • 3 161 messages

It would be, but I don't think it will work.  I could be wrong, but I don't think the specular map is applied to areas that are marked as transparent in the diffuse map.

 

That's correct. Normal maps are only applied to polygons that have the diffuse texture visible. If you clip out the entire texture of a model (so only the glow map is showing), then you might as well not have a normal map at all.

 

I suspect all models need a normal map in this game, so one of the token 'blank' normal maps that are just a couple of pixels square would suffice. You could also reuse the diffuse texture used by the collision ball/box models, which would mean the only custom texture you'd need to include would be for the glow map.



#17
drechner

drechner
  • Members
  • 300 messages

I'll be interested to see a screenshot of it whenever you're ready to show something.  :)

Well, don't get your hopes up too high ;)

 

PsMt5pp.png

 

I'm not entirely sure yet what I'll put in it. The BG2 Redux team (DAO) put in a Beholder which I thought was kind of cool. Eh, we'll see.


  • PJ156, kamal_, andysks et 1 autre aiment ceci

#18
Tchos

Tchos
  • Members
  • 5 054 messages

Yikes!  Hope that's beholder-gaze-proof glass!  One caveat is that you can't put special effects inside the glass, because the game doesn't handle multiple overlapping transparencies of this sort.  It just won't render the effect behind the foremost one.  At least not in the toolset.  I didn't test in-game lately.

 

I'd probably have the lighter parts follow around the edges, myself, and put in some obvious scratches or chip marks, but good that you got it working.  :)

 

If you ever want a generic "blank" normal map that'll always be available, "ts_n" is a stock resource, and the one I use.


  • drechner aime ceci

#19
kamal_

kamal_
  • Members
  • 5 250 messages

Not sure the wizards that run Athkatla would be approving of a beholder under glass, but it's definitely amusing. :)



#20
-Semper-

-Semper-
  • Members
  • 2 256 messages

That's correct. Normal maps are only applied to polygons that have the diffuse texture visible.

 

thx tchos and dann-j. didn' know about that part.

@drechner: right now the glass looks a bit like a fish tank. still looking good ;)



#21
drechner

drechner
  • Members
  • 300 messages

@drechner: right now the glass looks a bit like a fish tank. still looking good ;)

I think it actually *is* a fish tank in BGII. I'm not quite sure if it'll be a fish tank or not yet. Either way, I probably need to make some tweaks :)



#22
rjshae

rjshae
  • Members
  • 4 491 messages
I'm not entirely sure yet what I'll put in it. The BG2 Redux team (DAO) put in a Beholder which I thought was kind of cool. Eh, we'll see.

 

We do have some sharks available. For example.


  • drechner aime ceci

#23
Dann-J

Dann-J
  • Members
  • 3 161 messages

We do have some sharks available. For example.

 

As well as the RWS hammerhead and mako sharks:

http://neverwinterva...version-project

 

We've also got crabs. :)

http://neverwinterva...kpak/crab-crabe


  • drechner aime ceci

#24
kamal_

kamal_
  • Members
  • 5 250 messages

There's fish and jellyfish vfx in pain's pack, as well as bubbles and such in RWS vfx.


  • drechner aime ceci