(ok I´m creating a separate therad to make it easier to find the thread and to keep stuff together)
while I´m working on some custom models for tf2 i thought it would be faster to see the tf2-shader already in the max viewport..
this shader is more like a fake of the original tf2 shader but it´s already helping to get an idea what's going on
grab it if you want
thx again to
Lumonix for shaderFX.. a very helpfull tool
(tested with max8 and max 2008 )
Team Fortress 2 shader v0.32
This shader is based on the real tf2-shader math.
That does not mean it's exactly the same but the visual result gets very close.
The Update to v0.32 brings you
- vertex color support and
- a fixed bug in the ramp shading
You can find the Download page
- HERE -
+
picture of material rollout
Toon / Comic Shader v0.60
changes since v0.58
- completely reworked the code by hand going away from shaderFX. So I can clean up the code and I have more control over it.
- improved the sss-fake
- improved the rim lighting, it's now softer and easier to handle
- added cubemap blurring per value or per gloss map and masking through specular map
- you need a max version capable of displaying realtime hard shadows in the viewport (max 2009 or 2010, not sure)
- opacity can be read from diffuse color value
- allows up to 2 shadow casting lights
changes since v0.57
- fixed normal depth setting
- changed and fixed rimlight calculation. It's now working more the common way. You can offset the rimlight light source a bit (maybe have to increase the range) and exclude the normalmap from the rimlight calculation
- also added a simple sss fake. Have to get deeper into this but for the beginning it does a good job in fighting against black-skin-shadows
changes since v0.56
- zbrush material technique
changes since v0.55
- fixed colored specular map turned monochrome
- re arranged UI
changes since v0.53
- LitSphere support
- all major texture slots can be disabled/enabled
- normalmap red and green channel can be inverted
- added technique for 1 light/pass support - choose this if you're using the shader with the default scene light
- rim light can be calculated from normalmap or surface normals
- diffuse to ambient "leaking" can be influenced
- global opacity can be changed
changes since v0.51
- changed from shader model 2.0 to 3.0
- better rim light handling
- better ramp shading handling
- modify the nm blue channel
- some minor bugfixing
You can find the Download page
- HERE -
+
picture of material rollout ( v0.58 )


the RampTextures
And here are some ramp textures for you to use
DOWNLOAD
TF2 example:
the LitSpheres
Example LitSpheres
DOWNLOAD
Example 4:

Replies
Will try messing around some more with it, I know you said you hadn't tested it in 2009.
additional.. if you have shaderFX you can get the project file, open it -> save 3dsmax shader
you should get a shader that works with your version of max
shaderFX Project File
if someone has another max and shaderFX AND the shader is not working in this version of max, than it would be cool if he could provide me with the *.FX file from his shaderFX
DEElekgolo: tf2 uses a fallof function to create the ramp-effect.. it´s not the "default" half-lambert..
but why I´m using the ramp-texture here is bc I've modified my previous toonshader (which is based on a ramp-texture) to get a tf2 shader preview in max viewport fast
this shader does only FAKE the tf2 shader behaviour.. but that's all I need while texturing
But if you want Rollin, tudy my code to see how i did all these things, it's intended for people like you to learn from as well.
if you`re wondering what cubemap format the shader is using:
take one of the maps that ship with 3ds max (you'll find them under ./max8/maps)
or create your own one with CubemapGen from ATI
you can create one out of single images like ben cloward describes here
or simply convert a cubemap cross (3:4 format!!)
you can find free ones here
you definitely need if you go for the TF2 look
http://www.valvesoftware.com/publications/2007/NPAR07_IllustrativeRenderingInTeamFortress2.pdf
the half lambert is a part of the shading, as is the ramp
half lambert doesn't give you harder shading edges (like blurred cellshading) only makes the shading brighter and flatter
full lambert is a fall-of / ramp function
half lambert is another one
tf2-"lambert" is another one too
I don´t know how they've implemented the ramp technically but theoretically I would say they've use simply a new fall-of function (tf2-"lambert") while ep1 just uses a normal half lambert fall-of/ramp
but thx for your kick in the ass to read the paper...
should start to work on v0.3 now and make the shader a bit less fake#
edit: and thx CheeseOnToast.. this helps indeed!
and there was no reason to do it..
when I´m doing it now than just to try to REALY simulate the tf2 shader if possible
not that it would be truly necessary
obsolete
should be fixed now
the download link is the same but I´v updated the file
Ah I was looking for this paper...Thanks a MILLION!!!
v0.31
i´ve marked all settings which are no real tf2-shader values with an underscore
the default values will get you a very close tf2-like result
added spec, rim and exponent boost values
added a texture slot to mask out the ambient cube
v0.21
added a texture slot to mask out the ambient cube
there is a new Update online
- the shader v0.2x is now implemented in my toon shader (v0.51)
- added vertex color support for both shader
- fixed some bugs
I've updated the first post
check it out
With: new update for the toon shader (now v0.53)
changes since v0.51
- changed from shader model 2.0 to 3.0
- better rim light handling
- better ramp shading handling
- modify the nm blue channel
- some minor bugfixing
I hope the model-gets-invisible problem is now gone.. but I'm very happy for every positive or negative report !!
I've finished version 0.55 which supports some important features and bugfixes.
changes since v0.53
- LitSphere support
- all major texture slots can be disabled/enabled
- normalmap red and green channel can be inverted
- added technique for 1 light/pass support - choose this if you're using the shader with the default scene light
- rim light can be calculated from normalmap or surface normals
- diffuse to ambient "leaking" can be influenced
- global opacity can be changed
DOWNLOAD Page
the new material rollout
- fixed colored specular map turned monochrome
- re arranged UI
I can't test the shader in max2009.
But in max2008 it does work.
So I'm bit sorry, but I can't guaranty it's working in all max version
no worries man. thanks for the reply tho
I'm releasing version 0.58 now while version 0.57 is used by GoMax
new from v0.57 is a new technique that allows to see only the litsphere on the object. Nothing special.. just to get Zbrush materials into max viewport
new with 0.58
see image below
- fixed normal depth setting
- changed and fixed rimlight calculation. It's now working more the common way. You can offset the rimlight light source a bit (maybe have to increase the range) and exclude the normalmap from the rimlight calculation
- also added a simple sss fake. Have to get deeper into this but for the beginning it does a good job in fighting against black-skin-shadows
Download page is - HERE - again.
I thought this would allow me to see what the final project would look like in my 3d viewport window, basically making the 3d viewport window look like modelviewer.
if so, the default settings should already give you a quite similar result
I don't know what you're doing.. if you use the toon shader to texture tf2 stuff it will not work (at least not with the default settings).. thats why there are two different shaders
Also tested the toon shader in it and for just a few minutes of playing around I really like the result
Either way, Stickfigs, without images we can't help you.
you don't render an fx-shader offline.. you can use a script like this to make a high resolution screenshot though
Sorry, I'm rather new to this. Thanks.
I tried testing it with a car I modeled, but I can't seem to get the toon-y effect. If I set my rampcontrast to anything above 0, then everything just gets a lot darker.
Anything from 0 to negative values, and everything gets saturated and a lot lighter.
Am I doing something wrong?
I made screenshots:
Ramp Off
Ramp On
If you're not afraid of the technical side behind it
the shading calculation returns a value between 0 and 1. Instead of multiplying this to darken the unlit areas, this value is used as a UV-coordinate for a gradient ramp texture. Since a gradient only goes from left to right, there is no need for a height coordinate, you can just use a constant value for this. Once the gradient is sampled from the texture, this value is multiplied instead of the 0-1 of the original Phong calculation. Nifty huh?
What you are seeing in your case, is 3DS Max returning black, because no gradient ramp texture is loaded. Just load one into the correct slot, I think the shader comes with a few of them.
updated my main shader to 0.60
changes since v0.58
- completely reworked the code by hand going away from shaderFX. So I can clean up the code and I have more control over it.
- improved the sss-fake
- improved the rim lighting, it's now softer and easier to handle
- added cubemap blurring per value or per gloss map and masking through specular map
- you need a max version capable of displaying realtime hard shadows in the viewport (max 2009 or 2010, not sure)
- opacity can be read from diffuse color value
- allows up to 2 shadow casting lights
DownLoad Page
this here for example is done with the shader: unedited screengrab from max 2010