Translucent texture not rendering in-game

Started by Sir Irk, September 12, 2013, 06:57:34 AM

Previous topic - Next topic

Sir Irk

Hi, I've been messing around with wwmt for the past week and let me just say I love it so far. I'm currently having an issue with a glass panel on one of my models. I have the opacity set to 75 in 3ds max and when I view the compiled model in source's model viewer or in hammer it looks correct. However, when I load the game(CS:Global Offensive) the panel is not rendering at all. This is the case if I'm using $translucent 1. If I use $alphatest 1 instead then it again looks fine in the model viewer but in game it renders completely opaque.

Here is the vmt file for the glass:

"VertexLitGeneric"
{
    $model "1"
    $basetexturetransform "center 0.5 0.5 scale 5.0 5.0 rotate 0.0 translate 0.0 0.0"
    $envmapmasktransform "center 0.5 0.5 scale 5.0 5.0 rotate 0.0 translate 0.0 0.0"
    $basetexture "Map _29/3398"
    $envmap "env_cubemap"
    $envmapmask "Map _29/3398"
    $alpha "0.5"
    $translucent "1"
}

I also read something briefly on valve's dev wiki that certain shader settings like envmap can disable translucency. However I tried it without using any specularity and it didn't seem to make a difference in-game.

Any help is appreciated and let me know if I need to provide more info.

edit: typos

Sir Irk

Ok, I have a second noob problem that I haven't been able to solve via google. A different model that I'm trying to export seems to be getting stretched along the Z axis. In other words the compiled model is severely elongated compared to the one in 3ds max. This is the first time this has happened and I can't think of anything in particular that I've done differently. I'm assuming this is something I'm doing wrong in 3ds max and not the exporter. I tried applying an Xform modifier but it didn't seem to do anything.

wallworm

#2
Quote from: Sir Irk on September 12, 2013, 06:57:34 AM
Hi, I've been messing around with wwmt for the past week and let me just say I love it so far.

Glad you are enjoying it. I too have been messing around with it for a few years and still enjoy it! :P

Quote from: Sir Irk on September 12, 2013, 06:57:34 AM
I'm currently having an issue with a glass panel on one of my models. I have the opacity set to 75 in 3ds max and when I view the compiled model in source's model viewer or in hammer it looks correct. However, when I load the game(CS:Global Offensive) the panel is not rendering at all. This is the case if I'm using $translucent 1. If I use $alphatest 1 instead then it again looks fine in the model

...

I also read something briefly on valve's dev wiki that certain shader settings like envmap can disable translucency. However I tried it without using any specularity and it didn't seem to make a difference in-game.

Sometimes this can be tricky. I've had some random problems with materials from time to time. One thing is that sometimes alphas need to be inverted for certain scenarios, etc, and when using envmapmask this might be the case. I rarely remember which occasions call for that though.

I did find a bug in the VMT exporter after reading your thread. If your material uses the WW Source Material properties, then it will be missing the $translucent setting. I have a patch that you can test in the Dev Version of Wall Worm.

I will be unavailable for most of the next week... so if you find a major problem with that version, you may need to download the current release again from the site.

Note, that to update a material to use the newer settings, you'll need to select the object with the material and press Wall Worm > Wall Worm Materials > Make WW Materials . Then you have access to the extended properties in the Material inside the Material Editor.

Other possibilities is that the model itself has the $opaque flag; there are also some global WW settings for materials that might effect some export settings... however the VMT you've posted looks like it should have correct transparency.

Quote from: Sir Irk on September 12, 2013, 01:08:08 PM
Ok, I have a second noob problem that I haven't been able to solve via google. A different model that I'm trying to export seems to be getting stretched along the Z axis. In other words the compiled model is severely elongated compared to the one in 3ds max. This is the first time this has happened and I can't think of anything in particular that I've done differently. I'm assuming this is something I'm doing wrong in 3ds max and not the exporter. I tried applying an Xform modifier but it didn't seem to do anything.

This one is really odd. I've never seen this happen. My best guess would have been the Xform... but since you tried that already... I don't know. Is this a skinned model with bones? Maybe the scale spinner is not at 1.0 and this is having some effect?

You'd have to post the file for me to really investigate. But like I said, I will be unavailable for most of the next week so cannot promise I can figure it out. Maybe Gulli or another regular here can help if I can't in time.

Sir Irk

#3
Thanks for your response. I'm currently doing some trial and error based on what you said. I didn't know about the "make WW materials" option. That's pretty handy. However, when I did this it exported the VMTs as lightmapgeneric and had to change them in VTFedit. I don't see an option in the materials to change this so I'm not sure why it's doing that.

Edit: Scratch that. I'm just blind. I didn't notice the "for model" check box for some reason.

Sir Irk

What is the easiest way to invert the alpha? Do I need to do this in image editing software or can it be done through 3ds max? Also, I originally had no alpha channel on my glass texture. Is this something required? In the material editor I have the glass texture pumped into the diffuse and opacity slots. So far I've been tweaking the opacity using $alpha in the vmt. Is there a better way to do this?

SMF spam blocked by CleanTalk