Hm... using the glowmask everthing is black exept from the areas with glow.
When I made the glow map slightly brighter so nothing was completely black, then it worked which makes sense of course.
Hope you can shine some light on what I might be doing wrong, using 3ds max 2011 x64 btw.

also is there a reason for specular strength to go into "-" since it does not seem to make a difference.

Hm... using the glowmask everthing is black exept from the areas with glow.
When I made the glow map slightly brighter so nothing was completely black, then it worked which makes sense of course.
Hope you can shine some light on what I might be doing wrong, using 3ds max 2011 x64 btw.

also is there a reason for specular strength to go into "-" since it does not seem to make a difference.

Ah yes, due some complications with the compiler (I'm using a program called ShaderFX), the user it forced to have at least 1 light source in their scene.

You'll notice that there is also a lack of Ambient slot :P

If you want I can try and find a way to make it work if you need to, in the meantime, simply pop in at least one light source, set it above the character and voila, it should work.

As for the - numbers, I have no idea what happened there, I clamped them between 0 and upwards, I'll fix that ASAP and upload a new version as soon as someone can test the Maya version (if not, I will test them MUCH later on).

Hmm, this is very strange indeed. I just tested it in 2009, 2011 and 2012 x64 and they all work fine.

Did you guys enable disable Nitrous or Gamma LUT, anything like that?
Did you guys fillout all the slots, including the Ramp map with the TF2 texture that is provided?
Mind posting an image with the material next to the model?

I know that Sven has some problems (EI: The model is too dark), but in general you guys shouldn't be having all these issues, or at least 'see' something and don't need to fill out all the slots.

I honestly don't know what the issue could be, mind setting up textures, model and scene in folder and pming them to me, 2009, 2011 and 2012 are the versions I tested on, so either one of them should be fine.

^From what I understood in the Wiki, Valve prefers using a Phong Specular instead of Blinn, as it showcases the bending of the light around edges much better (kinda like Skin), and is cheaper/better looking with mutiple light sources around it.

Many people who try and replicate Valve-like-shaders, end up using Blinn instead, which makes a huge difference in the look of it.

Don't worry, I wasn't saying Blinn is inferior, they both have a place and time to be used

Blinn is more accurate to the specular reflections of real light, it uses the halfway vector. At more glancing angles Blinn specular stretches out as you might see in real life. At the end of the day it all depends on what fits your look, they're both sort of generalizations that are easy to work with to get a result.

Feature wise it looks awesome, but would you mind uploading a reference asset with textures and maybe a screenshot of all the corresponding values ? I have been trying the Max .fx in Max2009 here and even tho things seem to be happening (I can tell that my textures are loading properly, and so on) I couldn't quite tweak the values to get something satisfactory.

Also on a side note : Maya2008 doesn't load the CGFX. Not that this is a problem at all - but I thought I'd mention it!

^From what I understood in the Wiki, Valve prefers using a Phong Specular instead of Blinn, as it showcases the bending of the light around edges much better (kinda like Skin), and is cheaper/better looking with mutiple light sources around it.

Many people who try and replicate Valve-like-shaders, end up using Blinn instead, which makes a huge difference in the look of it.

Don't worry, I wasn't saying Blinn is inferior, they both have a place and time to be used

EDIT: For those interested, I made an update, check it out.

Alien Swarm uses this to calc it's specular values (bundled with the rim light values, too) - calculated once per light and then added together;

You're probably best off releasing your SFX project as well Ace, so people can easily change things as well. The compiled ShaderFX code isn't the cleanest or easiest to read.
Also, to avoid these uninitialized value problems, it's best to have switches/booleans that make sure there's a proper default value.

Feature wise it looks awesome, but would you mind uploading a reference asset with textures and maybe a screenshot of all the corresponding values ? I have been trying the Max .fx in Max2009 here and even tho things seem to be happening (I can tell that my textures are loading properly, and so on) I couldn't quite tweak the values to get something satisfactory.

Also on a side note : Maya2008 doesn't load the CGFX. Not that this is a problem at all - but I thought I'd mention it!

Thanks!

I'll upload a separate folder with examples in it, download that and check it out (I hope Valve is OK with that, I'll use one of the more 'older' models like Sven).

Alien Swarm uses this to calc it's specular values (bundled with the rim light values, too) - calculated once per light and then added together;
[/code]Might be helpful?

Yep, that's heavy code alright, in DOTA2 they did abit differently, as in you either Fresnel Warp a texture (can't confirm if it's an add/lerp or multi), or default to a single color like a traditional rim-light for lower end systems.

The keyword here is lower-end systems, since they're trying to pop out as much detail as possible without using fancy more then needed outside of basic math (so they keep the specular head-on for many characters, especially pronounced if you enable Specular Bloom).

You're probably best off releasing your SFX project as well Ace, so people can easily change things as well. The compiled ShaderFX code isn't the cleanest or easiest to read.
Also, to avoid these uninitialized value problems, it's best to have switches/booleans that make sure there's a proper default value.

I was thinking of doing that, but Lumonix recently 'closed' down (they moved with Autodesk), so I can't say if I'm allowed to share the SFX files or not (don't want to get in any trouble), especially since I don't own the licensed version.

I sent them an email, hopefully, they will get back to me about that!

I think I'm honestly going to do that (Bools), since it would solve alot of issues, but at the same time, almost all of the models in DOTA2 use maps for everything (EI: Ramps, Masks must be 32 with Alpha, etc) so I'm kinda worried about giving people the 'wrong looks' of the model that will looks considerably different if they don't plug-them-in, or help wrong habits (EI: Flip Green channel, etc).

But you do have a point, it will only get more confusing for beginners, so yeah, I'll include the switch sets.

I haven't looked at the code but for readability it helps to properly name the nodes in the Shaderfx graph if you havent already.

Cheers Kees, much appreciated!

And yeah, I did name the nodes, but I'm pretty terrible at them, most of the time you'll see a math node like this: FresnelxColorxStrenghtxPower

PS: Latest version is up peeps, with an example folder for you too Pior, check them out and see if I missed out on anything.

Also, for those wondering (few peeps that send me a message), I didn't include or make a Fresnel-Wrap term (meaning having a pure fresnel using a textures instead of a color) since I don't know what Valve used as their final math (you can see what I mean in the Readme), hopefully that should stop people from going crazy while taking a look at the documents.

I'm unable to use it in maya 2012. All other .fx shaders i've tried have worked fine (kodde, lcNextGen)
It's returning various compile errors, but I've seen a post or two in this thread saying that it worked fine on their install

I'm unable to use it in maya 2012. All other .fx shaders i've tried have worked fine (kodde, lcNextGen)
It's returning various compile errors, but I've seen a post or two in this thread saying that it worked fine on their install

OK, so I downloaded Maya and did a test myself, seems like it isn't liking something with the If A=B statement or the textures themselves, OR the plugin could be compiling the code wrong maybe? So I have no idea what I can do about that, sorry, wish I knew.

BTW, if you use the HLSL-Shader in the Hypershade editor, instead of the CGFX for Maya, it will work (just enable it through your Plugins-Manager) problem is, it will look abit messy and not as good as the Max version, where instead of "..." between certain sections of the parameters, you will get something like "LightDivider", the shader itself and the look of the models remain unaffected, so there is joy in that.

But it still works, I just have no idea on why Maya's HLSL, CGFX or such are acting weird honestly, or why the CGFX shader is broken, hopefully someone can shed some light, in the meantime, use HLSL shader for Maya.

I hope the few people that have said it worked on 2012 will tell me what they did (HLSL maybe?)
Yeah i've always had the impression that maya shader support was bad compared to max. I guess I could always ask to get a floating license to use Max at home
Thanks for your hard work Ace-Angel!

But it still works, I just have no idea on why Maya's HLSL, CGFX or such are acting weird honestly, or why the CGFX shader is broken, hopefully someone can shed some light, in the meantime, use HLSL shader for Maya.

Its actually the other way around. The HLSL plugin usually causes more problems haha.

BTW, if you use the HLSL-Shader in the Hypershade editor, instead of the CGFX for Maya, it will work (just enable it through your Plugins-Manager) problem is, it will look abit messy and not as good as the Max version, where instead of "..." between certain sections of the parameters, you will get something like "LightDivider", the shader itself and the look of the models remain unaffected, so there is joy in that.

Go into plug-in manager in Maya and load the cgfxshader.mll and hlslshader.mll.
In the hypershade, create either node ( apparently HLSL works and CgFX doesn't) and load the DOTA2 shader file into it and it should work.

Hey guys thanx for the awesome work! I just one to point out 1 thing i banged my head upon in maya. The shader doesn't work if your objects' uv map isn't called "map1". Gives all kinds of wierd results or just black. When i figured this out it all works like charm
i hope this helps if someone runs into the same problem
Cheers

Hey, this is great, thank you for putting it together! I had the chance to tinker around with it today. My next armor set I want to do is for Disruptor so I am starting out fresh with the default assets to try out the shader on. I am using Maya 2011 so I thought I'd share a few of my findings. I also had a few questions about the shader functionality if you don't mind. I don't have Max installed to look at the sample scene unfortunately so I'm making a best guess here at how things work.

Maya specific:
-Initially the model displayed with black diffuse but I found plugging in a point light to the light 1 position fixed this.
-Lights are treated as point lights (non-directional)
-When I duplicate a shading network maya unloads the cgfx file on the duplicate so you have to click the "reload" button
-the model display in the viewport gets wacky looking if I rotate the model so I keyframed the lightgroup rotating around the model.

Shader specific questions:
-Is the position/rotation of the rimlight adjustable?
-Should we use juggernaut_lightwarp.tga for all the shaders and both diffuse and fresnel warp slots?
-Any other settings I should edit? (or tips)

I'll probably play around with the settings some more to get a better likeness to the in-game but so far it seems good. The 3rd light slot is still open as well.

Hey Ethohe, I can't really say per se about Maya and why these issues are coming to light (pun intended), but I'll try my best to answer them.

-This is a weird one indeed, hopefully Drew can fill you in, but I think we decided to go with a light-requirement (EI: You need at least 1 light to show your model properly) setup since DOTA2 always has one source of light ontop of the character, but having your model be outright black is weird, it could be a bug that needs squashing. I think it could be a Maya specific bug.

-Mind telling what is happening exactly in terms of looks? In most cases, point lights in Maya or Max should act like directional, respecting the location and direction they're emitting the light from, same with other light sources, unless you mean you're getting a lack of directional light shadows, in which case, we kinda decided to skimp on shadows since they're somewhat buggy.

-I'm not sure about this one, Maya shouldn't be unloading or reloading anything by-itself (unless they included some fancy new thing in the latest SP patches). Does this happen all the time, after a fresh scene, or sometimes?

-Thats a bug to which I experienced in newer versions of both Max and Maya, I'm not sure what is causing it, but if you could try this: Freeze transform > Rotate Model; If model gets wacky > Freeze transform (or equivalent of Reset XForm from Max). If this works, then it's an Autodesk issue, in worst cases, it could be a Valve/Import issue, since in my case, Importing the newer FBX versions of the model in an older importer like Max 2009 will also cause the same issues.

-No it isn't, and the reason for that is because Valve made it like that for optimization (we tried to keep it close to it as possible). However, if you want to the Rimlight to be on certain parts of your model vs. non-in others, then you need to create your own Mask in Mask-2 channel G. That's how Valve did it the "More Rim ontop, less on the bottom" look, I think they used an AO and Spec map together to make the mask.

-You can use it, although I would suggest not using anything in Ramp in the mean-time, since each model has it's own Lightwrap map which does really change the look of the model (EI: Sven has a very blue warp, in some characters even pink!). Juggernaut currently has the more complicated one, and it's missing a couple of texture maps for the body and the fur, so it can throw things off, especially on other models.

If you want, I can create a dump from DOTA2 of all the Ramp maps for the Heroes as well the Fresnel Warp, since each has their own, maybe include the VMT files which tell you stuff like color of the Rimlight, Specular exponent, etc.

-I'm sure it's a Maya specific thing with the lights. I'll have to work out how to send the default light into the shader... Otherwise you need to define one for the shader to pull one. I'll have to work out a cunning plan to fix this.
Next version will have this fix!

- Valve does use a interesting rim light... They square it ( rim * rim ), and I think they might mask it by the regular diffuse light ( dot(Normal, LightVector), I didn't do that. Now that I tested it out, It's looking closer to what you're showing from the game :V
Here is that shader edited! https://dl.dropbox.com/u/8510078/Dota2/Dota2Hero_Shader_2.0.rar

- As far as I know Valve just used a regular rim with no Fresnel, but I could be wrong! You can control it's intensity/scale there... Basically it's just a multiplier.

- Fresnel warp would use a 3D warp texture, such as hue_shift_90_degrees... You don't have to use the Fresnel warp, since it's only on a select handful of characters. Unfortunately I don't have access to the Fresnel warps from the game in proper "volume-texture" form, which is absolutely necessary. Would be neat if I did! * on a site note! * The diffuse and Fresnel warp effects are showing errors a inside Maya. Not sure why. I'm working on fixing that!

- You can use "juggernaut_lightwarp.tga" for the diffuse light warp only, since it's just a 2D thing, not 3D. Although, if you can extract some of the warps from the game you can use those

Here is a simple "identity" 3D Texture. This one won't change the color of the Fresnel.

Throw it on top of an image of screenshot of your character in Photoshop and apply as many adjustment layers on top!

Here are the settings for .DDS Export. It MUST be a volume texture! Can be any bits, the only problem is you start to lose accuracy, resulting in some color errors

- Valve does use a interesting rim light... They square it ( rim * rim ), and I think they might mask it by the regular diffuse light ( dot(Normal, LightVector), I didn't do that. Now that I tested it out, It's looking closer to what you're showing from the game :V