Aller au contenu

Photo

Transparency on model textures.


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

#1
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

Hi, since there are several of you busy at work on placeables I thought asking this question here would give me the best answer as it relates to nwn2

 

I was in 3ds max creating sort of a coiled vine that would wrap around a tower. As I started drawing out the leafs as a spline to be converted to a 2d flat plane, I youtubed some plant tutorials.

 

The tutorial does the leaves by simply making rectangular planes with a few faces, then applying a transparent graphic file with a picture of a real world leaf. They were using PNG files.  Has anyone done this in NWN2? Can we do it with DDS? Any info relative to GIMP and DDS, and lastly if there is anything I need to do in 3ds, would be much needed. I figure if I have the graphic file properly set to transparent, the 3ds part should be no different, but correct me if I am wrong.

 

Thank you. :bandit: 



#2
kamal_

kamal_
  • Members
  • 5 250 messages

You can have planes in a model that have textures with transparency in them. The treant does this for it's leaves for instance.



#3
Tchos

Tchos
  • Members
  • 5 054 messages

If you recall the paper placeable we collaborated on some time ago, Eguintir, and if you saw the result I produced with ragged/torn edges, that was done with a DDS with transparency, as would also be done with a leaf.  I also produced some hanging vines on transparencies with that method, and numerous other things.  The transparency is the alpha channel of the diffuse map, and the game only uses absolute black and white (1-bit), though you can put an 8-bit one in there if you want.  It just changes it to 1-bit when it applies it.



#4
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

Ya I figured it had to be possible since I've seen clearly transparent planar models in game. Just didn't know if there was any way to trigger this. Absolute black works. I'll throw up the fruits of this labour once it's done. Thanks folks.



#5
4760

4760
  • Members
  • 1 207 messages

But don't forget to set the transparency flag, or the black will show as, well, black...



#6
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

how



#7
4760

4760
  • Members
  • 1 207 messages

I was in 3ds max 

 

how

 

For the selected object, right-click and choose properties: in the User Defined tab, put the following lines

trans = 1
alphablend = 0
addblend = 0

Or set it afterwards using MDBCloner (check box at the bottom of the details of the opened mdb).


  • Eguintir Eligard aime ceci

#8
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

I take it this will not actually show up in 3ds max as transparent though right?



#9
rjshae

rjshae
  • Members
  • 4 491 messages

 

For the selected object, right-click and choose properties: in the User Defined tab, put the following lines

trans = 1
alphablend = 0
addblend = 0

Or set it afterwards using MDBCloner (check box at the bottom of the details of the opened mdb).

 

The setting above is twiddling the bit flag on the Alpha Test field of the MDB texture flags, which implements single-bit (<50% gray scale) transparency. I've tried the other alpha flags, but they don't seem to do much for placeables.

 

I believe it's possible to turn a model into an SEF, which then supports 8-bit transparency. But you lose the collision detection and tinting. Probably a mix would be best--placeables with dedicated SEFs.

 

 

I take it this will not actually show up in 3ds max as transparent though right?

 

The current blender import/export scripts use the transparency setting to set the Alpha Test field of individual packets. Can't speak for 3DS.



#10
Tchos

Tchos
  • Members
  • 5 054 messages

Originally, I only did it using MDB Cloner, but when I started using multi-part models such as in the Witcher conversion, there are some models in there that use transparency for some of the parts, such as objects that have chains attached.

 

For the jars and other glass objects, I experimented with using a dedicated SEF to use alongside the object, which works but is inconvenient.  You could do as Bob suggests and as Dann has done, and combine two models as model effects in the visual effect editor, one of which being affected by the FX version of transparency, which is 8-bit, and put the whole thing down as a placed effect.  That would work fine for anything that doesn't need to act as a normal placeable.

 

For more convenience, I switched to using the illumination map for my transparencies, since placeables support 24-bit illumination maps without extra effort.



#11
-Semper-

-Semper-
  • Members
  • 2 256 messages

I take it this will not actually show up in 3ds max as transparent though right?

 

this tutorial should help. before exporting you should deactivate the opacity channel though. opacity maps are stored in the alpha channel of the diffuse texture.


  • Eguintir Eligard aime ceci

#12
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

See I am kind of stuck between a rock and a hard place here.

 

I managed to find a leaf and just use it with it's black background showing on a planar object. But Then I realized that 2d planes and vertex welding to 3d planes doesn't jive.

 

I can't attach them together. So I went back to my self made leaf but it to was a planar, and would not attach. I added a shell to the back half (effectively making it now have a z thickness, aka 3d) and the vertexes still won't weld. So I don't know what to think anymore.

Is it possible, that since I am using only 5 or so large, detailed leafs, that I could use this all as a 3d model? I am of course going to optimize it when done. Consider this an object

that would wrap around a tower. What is a fair poly count? 500 to 1000?

coil+plant01.jpg



#13
rjshae

rjshae
  • Members
  • 4 491 messages

500-1000 isn't a lot; the MDB file limits vertices per RIGD packet to unsigned 16-bit int (65535), so its whatever faces you can fit into those. (At least a third of the total: 21,845 faces.) Typically the models I've worked with have 500-2500 faces.



#14
4760

4760
  • Members
  • 1 207 messages

My tests show that 6,000 faces still works (at least on a Win7 Intel i7 @2.40 GHz 8.0 GB RAM system), and that 13,000 faces placeables take a time to appear in the toolset (but once in the toolset, it can be moved as easily as other objects).

I didn't test in game (yet) though, I try to keep around 2,500 faces maximum.



#15
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Not going near that for some ambient foliage but thanks

#16
Tchos

Tchos
  • Members
  • 5 054 messages

For ambient foliage, I would advise against actually modeling it.  A transparency should be sufficient, and I would expect it to look better.  You can "go wild" with the detail when doing so with geometry would be excessive.



#17
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

It needs to be a model because it will be an add on. It will add itself to any cylindrical shape... a smaller one to wrap around marble pillars supporting a balcony as well as a scaled up one to wrap around various towers. There will be a lot of vines and giant beanstalks in this land I intend it for.



#18
Tchos

Tchos
  • Members
  • 5 054 messages

As you wish, but detailed foliage transparencies with an illusion of depth can be on cylindrical surfaces too, not just flat planes.



#19
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
The problem there is that I have no 2d skills. I can project my 3d plant as a texture but no idea how I'd cover all the angles required. I really have too much on my plate to learn 2d in detail

#20
Tchos

Tchos
  • Members
  • 5 054 messages

You just take a seamless image and wrap it around a cylinder.  Example.



#21
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
I am thinking how I could set this up as a cylinder map of the actual vine I'm modelling and reverting to the planar leaves to give it the requisite third dimension. That will be useful even if I do need a small number of true modelled beanstalks

#22
Dann-J

Dann-J
  • Members
  • 3 161 messages

One quick-and-dirty method to add vines to vertical columns or trunks is to use the tall vine speedtrees that came with one of the expansions (SoZ I think). They don't really wrap around, and they tend to sway back and forth (if you don't hack the wind settings ini), but they can look effective.

 

14589784504_771f90857a.jpg

 

Full sized image here.



#23
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
That river looks fantastic. The issue is I am looking for a specific plant style as it creates the whole vibe of the place. I'll try adding some concept art here soon