Multi Layered Shader

Got problems with your models? Struggling with textures? Get help with your custom assets.

Multi Layered Shader

Postby oti2 on Sat Jan 20, 2007 2:08 am

As willing as I am to burn my copy of Half Life 2 right now, I would be more satisfied with multiple layered shader. Now this has been angering me for some time now. So you understand what I am talking about; I'm looking to create a shader that can support more than two base textures, or alternatively, combine more than 2 vtfs while maintaining support for proxies however sharing the same vmt. Basically I wondering if its possible to have say,
Code: Select all
"UnlitThreeTexture"
   "$basetexture" ilike/boobs
   "$texture2" iALSOlike/boobs
   "$texture3" butilike/mangina   

The "$texture3" and up are not supported as far as i can tell. Is there an alternate way about blending more than 2 materials and possibly defining order and/or transparency, preferably without rewriting a shader. Any help would be greatly appreciated, its seems knowledge about writing shaders on the internet is scarce and not very friendly. Thanks.
Did you know 72% of all statistics are completely made up?
User avatar
oti2
Regular
Regular
 
Joined: Sat Apr 01, 2006 9:02 pm

Postby slayera on Sat Jan 20, 2007 6:47 am

ONLY can be done for displacements and when setup correctly. You are not writing an shader, unless you have broke out the c++.

If you really want to write a shader use this.

http://developer.valvesoftware.com/wiki ... _Authoring

Here are some proxy commands, you might be able to do something here. But there is a total lack of info on how to really use them.

http://developer.valvesoftware.com/wiki ... al_Proxies

And some shader types.

http://developer.valvesoftware.com/wiki ... Parameters

If you tell us want your trying to do then maybe we can offer another solution.

Without anyway to control the alpha in Hammer I am afraid what you want is near impossible.
Image


"When one person suffers from a delusion it is called insanity. When many people suffer from a delusion it is called religion." -Robert Pirsig
User avatar
slayera
Veteran
Veteran
 
Joined: Wed Dec 08, 2004 3:15 am
Location: Near the world's only super volcano.

Postby oti2 on Sat Jan 20, 2007 7:16 am

Haha, all of those articles I've read at least 10 times before posting here but thanks.

It seems I was a little misunderstood. I'm looking for away to create an extended "UnlitTwoTexture" which blends the "$basetexture" and "$texture2" 50/50 into a single texture - not a displacement blend - while being able to assign proxies to modify each base texture. What my question is: Is there a way to create say an "UnlitFourTexture" without going to the trouble of, like you said, busting out the c++ and laboring for a day to create 1 texture.

What could I possibly need this for? It's a bit of a big project but I'll keep it simple. In a sense I'm building a computer screen shader with attatched scripts. My question relates to this in that is it possible to (without a new shader) add mulitple layers of masks, proxied textures, and transparents? Take for example the Unreal Engine. The shader builder interface included in UED3 allows for tons layers of textures for a single shader/texture. Is the source engine really limited to two bases per texture?

Example: 3 vmts. 1 solid texture, 2 30%transparent textures. Instead of putting 3 brushes really close together so it looks like one texture, is there a way to just compile it all into one texture/vmt?
Hope that clarifies this up a little.

Also If you check the VMTs for the huge breencast monitor texture you can see it blends 50/50 the _rt_camera and a noise texture using "UnlitTwoTexture" or "LightmappedTwoTexture". Is it possible to add a third texture like a glass overlay?

Wow. That was alot. :shock:
Did you know 72% of all statistics are completely made up?
User avatar
oti2
Regular
Regular
 
Joined: Sat Apr 01, 2006 9:02 pm

Postby slayera on Sat Jan 20, 2007 7:43 am

Ah, I see what your getting at. I wish I had noticed those before. You can try the two texture blend, I have never tried it before. I don't see any 3 or 4 layer blends. As for the 3rd or 4th you can place it over the top, like an overlay, since it would have an alpha layer you can still see it though whether or not it's a world brush or model. Layer like you would a glass window with main texture on one sheet, then next and so on.

As for the monitor effect, they use a camera and texture and may not work for two regular textures.

Edit:
From what I can see unless you animate the one more the textures, you just might as well use photoshop an do a 50/50 and merge the two.
Image


"When one person suffers from a delusion it is called insanity. When many people suffer from a delusion it is called religion." -Robert Pirsig
User avatar
slayera
Veteran
Veteran
 
Joined: Wed Dec 08, 2004 3:15 am
Location: Near the world's only super volcano.

Postby oti2 on Sat Jan 20, 2007 8:08 am

Thats my problem though, all of the layers are animated...

Is it possible to animate an overlay?

I could possibly create my screen by setting priorities of animated overlays.
Did you know 72% of all statistics are completely made up?
User avatar
oti2
Regular
Regular
 
Joined: Sat Apr 01, 2006 9:02 pm

Postby slayera on Sat Jan 20, 2007 8:21 am

I have not animated a overlay, but there is nothing that says it will not work. I don't see any reason why it will not. Just have to try it.
Image


"When one person suffers from a delusion it is called insanity. When many people suffer from a delusion it is called religion." -Robert Pirsig
User avatar
slayera
Veteran
Veteran
 
Joined: Wed Dec 08, 2004 3:15 am
Location: Near the world's only super volcano.

Re: Multi Layered Shader

Postby Thinge on Sun Sep 02, 2012 5:59 pm

Bumping this because this is exactly what I'm trying to do. We want to overlay a name and number on the back of our characters shirts (football players). The reason for this is that if we saved every individual shirt with a name and number, we'd then have to use 10 times the amount of disk space for the shirts.

Cheers
Thinge
Dumpling
Dumpling
 
Joined: Wed Jul 08, 2009 10:32 pm

Re: Multi Layered Shader

Postby kraid on Sun Sep 02, 2012 9:33 pm

@Thinge
AFAIK, the only possibility to use two textures combined in a single material on a model is the "UnlitTwoTexture" Shader. But this would make your model not affected by light, which is not an option at all for a character.

A few possibilities:
You could try to create a workarround by adding a 2nd material with only the number & alphachannel and apply it to a seperated polygon layer of a few polygons on front and back with a slight offset and exactly the same weightmap as the underlaying polygons.

or
create a selection of the few polygons on the shirt front & back, apply a own material to them and
create your numbers with the part of the shirt in the background.
That way each number will only need a small texture not a huge one.
Might be hard to get it right without seams though, there are many things that could cause them, e.g.differences in material parameters, different texel density, etc.

or
you model the numbers and apply them via submodels to the player.
would be hard to rig so many numbers though.

A last possibility that might be worth looking into, is the shader editor that has been posted here a while ago.
I'm not sure if it works to write a mulltilayer shader for source at all, but it won't hurt to look into it.
Goldeneye Source v4.2.3
get it now and play for FREE!!!
http://www.goldeneyesource.net
kraid
Been Here A While
Been Here A While
 
Joined: Thu Jan 22, 2009 12:09 pm

Re: Multi Layered Shader

Postby Thinge on Sun Sep 02, 2012 10:45 pm

Cheers for the reply Kraid.

Yeah, it doesn't look as if there is an appropriate shader. The closest thing I can see is "detail", but it's greyscale, translucent and wouldn't render at far away distances.

We had a freelancer create the model, and I doubt he'd be able to do the extra work involve in that for free unfortunately, so I don't think we could do that. The coder is looking into shaders, but it's not something he's done before. We're looking into that app you mention, I'm not sure if we really know where to start though with what we want to do!
Thinge
Dumpling
Dumpling
 
Joined: Wed Jul 08, 2009 10:32 pm

Re: Multi Layered Shader

Postby cra0kalo on Sun Sep 23, 2012 4:06 am

Thinge wrote:Cheers for the reply Kraid.

Yeah, it doesn't look as if there is an appropriate shader. The closest thing I can see is "detail", but it's greyscale, translucent and wouldn't render at far away distances.

We had a freelancer create the model, and I doubt he'd be able to do the extra work involve in that for free unfortunately, so I don't think we could do that. The coder is looking into shaders, but it's not something he's done before. We're looking into that app you mention, I'm not sure if we really know where to start though with what we want to do!

what are you making?
Cra0kalo
CG Artist/3D Animator
http://cra0kalo.com

Lead of Operation Reaper
http://projectreaper.com

Lead of the "Dark Alley" Project
http://alleyproject.net
User avatar
cra0kalo
Regular
Regular
 
Joined: Thu Apr 28, 2011 2:35 am

Return to Custom Asset Help

Who is online

Users browsing this forum: No registered users