Jump to content
Sign in to follow this  
DIFTOW

Source engine - MDL - UV channel 2

Recommended Posts

This is just an inquiry I have.

How many UV channels can be stored in an .MDL in Source engine?

Regardless of that answer, how do I use 2 UV channels in Source?

Is it automatic based on my settings in Max when I export?

Do I have to specify anything in the QC file when compiling SMD?

Do I have to specify anything in the VMT file for the VTF textures? (Thinking this most likely is where I would have to do anything)

In case you're wondering why. I'm using lighting from 3D Studio Max mental ray, to generate light-maps for the MDLs in my scene.

This creates both high quality direct shading, as well as G.I.; indirect shading, and color bleeding.

For shading of dynamic MDLs (NPCs, vehicles, players) that may interact with any of the lightmapped MDLs... I will be relying on Env_projectedtexture.

Unfortunately, the UVs made for the lightmaps, will not work well with surfaces where it is ideal to tile instead of have a packed texture map for.

Some surfaces can reuse the same UV coordinates for both lightmap and diffuse detail, but others it is more ideal for tiling to be used with the diffuse detail.

The tiling can not be done in VMT, because the UVs for the lightmap are minor-stretched, rotated, flipped, and separated to get the most out of the resolution.

I need to have 2 UV channels thus for this to work out with the best quality.

Share this post


Link to post
Share on other sites

One thing you could try (if this is a small scene) is to use the coordinates in UV Channel 02, bake diffuse map/spec/normal maps, combine that with the vray solution in a single texture and move the UV coordinates in Channel 02 to 01. Perhpas that could work but it would be one hell of a bad workflow if you are working on a larger map.

Share this post


Link to post
Share on other sites

Thankfully that is this coming April, but I have to hope that it doesn't require Portal 2 to get the update.

One thing you could try (if this is a small scene) is to use the coordinates in UV Channel 02, bake diffuse map/spec/normal maps, combine that with the vray solution in a single texture and move the UV coordinates in Channel 02 to 01. Perhpas that could work but it would be one hell of a bad workflow if you are working on a larger map.

That is what I do so far, and for a surface where a diffuse detail would normally tile, now yields blurry low res results.

Share this post


Link to post
Share on other sites

Sorry to burst your bubble, but Portal 2 being released in April does not automatically imply that we will get an SDK update in April.

This is a pretty neat idea. Despite the obvious heavy workload overhead, it could lead to really great results if it worked. That being said, I don't think that the MDL format supports a 2nd UV channel at all. I'd imagine that kind of feature is not possible to add without Valve's help, as it would involve changing the model compiler itself.

Share this post


Link to post
Share on other sites

Sorry to burst your bubble, but Portal 2 being released in April does not automatically imply that we will get an SDK update in April.

This is a pretty neat idea. Despite the obvious heavy workload overhead, it could lead to really great results if it worked. That being said, I don't think that the MDL format supports a 2nd UV channel at all. I'd imagine that kind of feature is not possible to add without Valve's help, as it would involve changing the model compiler itself.

Well what about me using just 1 UV, and getting this to work?

"UnLitGeneric"

{

	"$baseTexture"			"models/NYC/WTC_Column_Lightmap"

	"$detail" "models/NYC/WTC_Column_Diffuse"

	"$detailscale" 1

	"$model" 1

}

in CSS, I use that, and only the "baseTexture" displays. I can't see "detail". But it is supposed to work. It worked in a map called dod_kolsch for Day of Defeat.

Share this post


Link to post
Share on other sites

i am sick of getting asked the same questions about this lightmap hack over and over, so here is a "tutorial" on how this shit works. though it was warby's idea, but i think he didnt write it down somewhere. feel free to hotlink this image or reference it when needed:

lightmaphack.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...