Home Technical Talk

Maya CGFX Shader: KoddeShader v2.0!

polycounter lvl 18
Offline / Send Message
kodde polycounter lvl 18
KoddeShader_v2.0_PromoBanner.jpg

Hey guys!
I finally got around to remaking the "KoddeShader" from the ground up. Some old features which I found less useful were cut and a few new features I've learned since last time have been added. If you give this shader a go then please share your results or any other feedback.

Some highlight features of this shader:
  • 2-pass Transparency support (support for Specular and Reflections on transparent surfaces)
  • Fresnel based Specularity and Reflections
  • Gloss based Cube Map Mip Level modulation (For blurring, etc)
  • Various Skin parameters to mimic "realistic" skin (Blended Normals being one of them)
  • Ward Specularity option (Besides regular Phong Specularity)
  • Gamma Correction (2.2)

I've been feature creeping and tweaking the UI for quite some time and I think I've found and fixed most issues. I'm calling this version "rev3". Please let me know if you find any issues. Thanks!

Download "KoddeShader_v2.0_rev3.rar"


KoddeShader_v2.0_User_Guide_banner.jpg

User guide time! <- Right-click to download

This ended up taking me longer to write than the shader :)
It's 24 pages filled with example images and useful info on how the shader works.

Let me know if you find any typos or errors. I've gone through it a few times but there's certainly something I've missed.

Enjoy.

Replies

  • wailingmonkey
    hot dawg! Looks awesome, kodde!

    (tips hat...thanks for sharing it) :)
  • BigErn
    Offline / Send Message
    BigErn polycounter lvl 11
    Ooh nice, looks great, will look forward to checking it out! Thanks
  • attattattack
    Offline / Send Message
    attattattack polycounter lvl 8
  • wasker
    Offline / Send Message
    wasker polycounter lvl 7
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Thanks guys!

    Working on a guide for using the shader as we speak.
  • Marine
    Offline / Send Message
    Marine polycounter lvl 18
    makes even temp textures look good, but blended normals doesn't like hard edges
    normalblending.jpg
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Marine> Thanks for sharing.
    Hmm, I never actually tried the Blended Normals feature on an object which had hard edges. Makes sense though. This feature is intended to use on surface which are supposed to look like skin. This should probably mean that it won't be that many hard edges.

    In your case could you not just make that edge soft? Is there a reason to keep it hard?

    Blended normals work with the normal map. Only details present in the normal map will benefit from the effect blended normal gives. In your case I think it seems to work nice, red is much softer and more believable for the eye than black when it comes to skin. At least in my opinion.

    Keep at it, looks promising. Do please share future progress on this ;)
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Did anyone ever get everything right the first time around?

    Anyways, I found that the "Normal Multiplier" attribute did not work with the "Use DXT5nm style Normal Texture" in the rev1 version. I fixed it and updated to rev2 in the main post.

    EDIT:

    Rev3 is up!

    Changes in rev3
    -The "Reflection Mip Level Min" and "Reflection Mip Level Max" have been swapped around to hopefully be more clear.
    Min now represents a lower mip level value as in higher resolution, the Max now represents a higher mip level value
    as in lower resolution.
    -The default light with intensity when loading the shader is now Directional 1 instead of Directional 3.
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    nice job kodde! Will test it soon!
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Thanks Bugo.

    Working on help documentation as we speak. I'm already at 16 pages filled with useful information and example images. Think I'll end up with 20+ pages. I will have spent more time writing the help docs than the actual shader. Hopefully it will be worth it in the end :)
  • willy-wilson
    Offline / Send Message
    willy-wilson polycounter lvl 8
    providing some sample scenes with this would be really sweet to, like you did with the eye shader. are you ever going to merge the two BTW?
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    providing some sample scenes with this would be really sweet to, like you did with the eye shader. are you ever going to merge the two BTW?

    Hey Willy,

    Right now I'm working on the help doc which should hopefully be finished tonight. It has lots of good example images and information on all the parameters, etc.

    I can probably provide my example scene of Lee Perry-Smiths head as well.

    I don't have any plan on merging these two shaders. I realized that I was already pushing the amount of parameters in my old KoddeShader and wanted to be more sparse without loosing the most essential features for this version.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    KoddeShader_v2.0_User_Guide_banner.jpg

    User guide time! <- Right-click to download

    Finally finished what ended up taking me longer to write than the shader :)
    It's 24 pages filled with example images and useful info on how the shader works.

    Let me know if you find any typos or errors. I've gone through it a few times but there's certainly something I've missed.

    Enjoy.
  • ivars
    Offline / Send Message
    ivars polycounter lvl 15
    Awesome guide. And awesome shader! Can't wait to try it out :D
  • zxcman
    Offline / Send Message
    zxcman polycounter lvl 10
    I wanna Max version!
  • throttlekitty
    Oh Ohhhh I can't wait to try this, thanks!
    (actually, I still need to troubleshoot my problems with actually getting cgfx to work, but that's my problem.)
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    ivars> Thanks, hope you like it.

    zxcman> Mental Mill seems to be able to export for Max also without any major hassles. Thing is I've done quite some editing with Notepad++ after the Mental Mill export so making a Max version wouldn't be that easy for me. Especially since I can't debug it either. Sorry.

    Throttlekitty> You're welcome. What's up with not getting cgfx to work? ATI card?


    I'll get around to uploading an example scene as willy requested before. I'll try to get it done tonight.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Here's a sample scene with the head I used for most of my examples in the user guide.

    There's a Maya 2010 scene in the package. If you have an older version of Maya or for whatever reason cannot load this scene there is also an .obj. If you use the .obj you will have to set up the shader yourself.

    Sample Scene Download (v2)

    EDIT: Updated the link with a more correct sample scene.
  • onionhead_o
    Offline / Send Message
    onionhead_o polycounter lvl 16
    im using maya 2009. and the cubemap i use doesnt show up. like theres no cube reflections at all.the cubemap is in tif format. becuase the dds maps that i try to use couldnt be loaded for some reason?
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Hmm, .dds should work. How are you processing them? Or did you download any premade?

    Download the example scene I post a few posts up. Try using the included the Cube Map called "cube_neighborhood01.dds". Does it work?
  • animax
    Offline / Send Message
    animax polycounter lvl 15
    @kodde - I am currently trying the shader in my Maya 2011 x64 in my Windows 7 machine with ATI HD4850 graphics card.After loading the CGFX, i can't select between the two techiniques, the default technique selected is "Transperency_with_diffuse_alpha". So all i see is a light red silhouette of the model.I have gone through the document, don't seem like i am missing anything.I have even tried with the sample model you provided.Same result :(

    Is maya 2011 not supported?
  • BeatKitano
    Offline / Send Message
    BeatKitano polycounter lvl 16
    Welcome to tha ati world, funny i got those kind of problems with my ati rigs, never with nvidia one.
  • animax
    Offline / Send Message
    animax polycounter lvl 15
    Noooooooooo.Any official words? Any alternatives to use the shader with ATI?
  • BeatKitano
    Offline / Send Message
    BeatKitano polycounter lvl 16
    I didn't say it was ati's fault, just saying it tends to happen a lot with ati on my machines. I can't really help you much than say, udpate your drivers :/
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    animax> Yeah I've been having trouble with my shader and ATI cards. Someone on another forum pointed me towards it might be due to not using same data types on both ends when doing math, there was some terminology for this. Can't remember what now. An nvidia card would for instance let me multiply a float3 by a float, but an ATI-card would be picky about this.

    Try this version. Uses a different more compatible (I think) shader profile. Not sure if it will work, but you might give it a shot.
    KoddeShader_v2.0_rev3_vp40_fp40.rar
  • animax
    Offline / Send Message
    animax polycounter lvl 15
    @kodde:Thanks for the update & explanation man.But the new cgfx file didn't work with the updated drivers also.

    Just wanted to know, why did you use dds in your shader texture slots?why not tgas?I do not know the advantage of DDSs over TGAs(except that DDS stores mip-map versions within the file).

    Thanks.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    animax wrote: »
    @kodde:Thanks for the update & explanation man.But the new cgfx file didn't work with the updated drivers also.

    Just wanted to know, why did you use dds in your shader texture slots?why not tgas?I do not know the advantage of DDSs over TGAs(except that DDS stores mip-map versions within the file).

    Thanks.

    That's a shame. :(

    What are you referring to? The "Use DXT5nm style normals" user guide text? Where did I use DDS's? Can't remember :)

    DDS's advantage over targas would be smaller file size and mip-maps like you said. It can also store cubemaps in certain established layouts. However DDS will compress in such a way that you loose detail. This is a format you use in games to minimize texture file sizes while still keeping a decent quality level.
  • animax
    Offline / Send Message
    animax polycounter lvl 15
    I will wait for your 3dsmax version :poly121:

    I was referring to your sample file.Where all the textures you used are DDSs.So thought it supports only DDS or something.

    I have read your nicely explained documentation about "DXT5nm" options.
  • SmartDevil
    Thanx KODDE... Your shader seems to me perfect. but feel slightly sad to hear that it'll not be proted to max just because of you edited some lines of it... Anyway... Your work is superb and saves a lots of time.

    Keep it up dude...
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    I'm cross posting here, but I posted a big cube map pack today which most people using this shader will find useful. Check it out.

    http://www.polycount.com/forum/showthread.php?p=1544773
  • Scruples
    Offline / Send Message
    Scruples polycounter lvl 10
    Super-nice, I wonder if you take requests...is backface culling feasible?
    I love your shader.

    FaceTestRender.jpg
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Thanks Scruples. Nice head.
    Are you using the blended normals feature? If not, try it. There's a thorough manual you can use for reference.

    You can very easily modify this features yourself.
    Open the shader, at the very bottom, look for this row.
    CullFaceEnable = false;
    Just set it to true instead. Note that there are two techniques, make sure to edit the one you are using.
  • LRoy
    Offline / Send Message
    LRoy polycounter lvl 10
    Big thanks for the maps. Definitely gonna try this out
  • Scruples
    Offline / Send Message
    Scruples polycounter lvl 10
    kodde wrote: »
    Thanks Scruples. Nice head.
    Are you using the blended normals feature? If not, try it. There's a thorough manual you can use for reference.

    You can very easily modify this features yourself.
    Open the shader, at the very bottom, look for this row.
    CullFaceEnable = false;
    Just set it to true instead. Note that there are two techniques, make sure to edit the one you are using.

    It works perfectly, thank you!, and yup I am using blended normals, without it she looks like some sort of cake faced monster. I'll check out the manual, I downloaded it but only quickly glanced over it.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    kodde,I am trying to apply textures on a different uv tile(u=1.00,v=0.00)and the file isn't uploading.Does this shader support multiple uv tiling?I used (u=0.00,v=0.00)for the body,I am using another tile for the hair and the file is just blank when I try to add new textures from the default colour of the first texture file.
    Thanks.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    melviso> I'm afraid not, at least not for your purpose. Duplicate it the shader and use one instance for the body and one for the hair.

    There is support to use a secondary UV-set for AO if I'm not mistaking, but that's it. To achieve the secondary set for AO you can change the Texcoord3 at the bottom of the shader to your secondary set instead of the default primary.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the heads up.Does this also include the TGA physical lighting shader?
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Yes, should be similar there.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    RACHELrefined.png

    Your shader is awesome.I used it for the body of the model while I used IcUberShader for the hair and weapon.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 18
    Cool.
    Thanks for sharing :)
Sign In or Register to comment.