Home Technical Talk

Best shader for viewport hair planes (3dsmax)

polycounter lvl 18
Offline / Send Message
Rick Stirling polycounter lvl 18
I'm still getting lots of rendering issues with layered hair planes in the viewport. I've tried SM 2.0 and 3.0, one object, detached planes.

Can anyone recommend a shader and/or some setting in Max 2011 that will let me see a hair object with about 2000 polygons? Even 1bit alpha would be fine.

Replies

  • Farfarer
    Should be able to use alphatest and get it working, as far as I know.

    Not done anything close to 2000 polys of hair but I've had several planes of grass (maybe 15 planes from front to back) working fine with a really basic alphatested shader I threw together in ShaderFX.
  • spacemonkey
    Offline / Send Message
    spacemonkey polycounter lvl 18
    The nitrous viewport works great for previewing hair in 2012, however I am really surprised their isn't a directx shader that can resolve sorting.. I am with Rick, if there is anything available I'd be interested in checking it out.
  • Hazardous
    Offline / Send Message
    Hazardous polycounter lvl 12
    Hey Rick,

    If your okay with your hair parts being viewed at 100% Self illumination you can say hello to soft alpha that sorts just fine in your viewport by throwing a standard blinn on your hair with a seprate tga for alpha ( cant use the alpha channel of your diffuse for this trick ), crank the self illumination right up to 100% and apply that. I am still using Max2008 but im sure it should still work.

    If you want spec, normal and all that usual jazz the only way i know of to get it working with something like xoliul is to hand sort your objects from front to back.

    To do that you can break your hair object into all its indvidual pieces, and starting with the deepest part ( usually the hair helmet ) shift drag that off to the side, then duplicate the parts that form the next layer off to the side and position them over the first part, they should be sorting fine with the bottom layer already, and keep doing this off to the side building out to the top layer. If you use only those newly created pieces you should be able to construct a perfectly sorting hair.

    Thats how I was able to get the feathers for my valkyrie to play nice with xoliul shader in realtime. Time consuming but I know of no other ways to get alpha sorting working nicely in viewports!

    Ill try to chisel up a little tutorial - hard to understand that probably...
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    Cheers all.

    The manual sorting is always going to be an issue, especially with a lot of planes. I could write a script to separate each element into an object and parent them all, but hand sorting after that is a pain.

    I'll try that 100% self illumination trick, I'm not bothered about the lighting so much as not having massive holes everywhere when rotating the model. Separate TGA eh? If that works I'll be ecstatic!

    As for the DX vs standard, I have noticed that the standard shader does seem to work much better.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hazardous wrote: »
    Hey Rick,

    If your okay with your hair parts being viewed at 100% Self illumination you can say hello to soft alpha that sorts just fine in your viewport by throwing a standard blinn on your hair with a seprate tga for alpha ( cant use the alpha channel of your diffuse for this trick ), crank the self illumination right up to 100% and apply that. I am still using Max2008 but im sure it should still work.

    If you want spec, normal and all that usual jazz the only way i know of to get it working with something like xoliul is to hand sort your objects from front to back.

    To do that you can break your hair object into all its indvidual pieces, and starting with the deepest part ( usually the hair helmet ) shift drag that off to the side, then duplicate the parts that form the next layer off to the side and position them over the first part, they should be sorting fine with the bottom layer already, and keep doing this off to the side building out to the top layer. If you use only those newly created pieces you should be able to construct a perfectly sorting hair.

    Thats how I was able to get the feathers for my valkyrie to play nice with xoliul shader in realtime. Time consuming but I know of no other ways to get alpha sorting working nicely in viewports!

    Ill try to chisel up a little tutorial - hard to understand that probably...

    It would be great if you did, would help greatly for many of us.
  • BeatKitano
    Offline / Send Message
    BeatKitano polycounter lvl 16
    I'm not sure to understand the issue perfectly so my post may be useless, but isn't that what you're looking for ?

    I've yet to encounter a situation where I need an alpha sorting fix since my max switch, I may be off topic, but that post was on my mind since that issue has been asked here
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    The issue with that is that it's a depth sorting back to front script, and while it might work for simple shelled hair working from the inside out, it won't necessarily work for a hair object when you are rotating the object around in the viewport (unless I'm missing something?).

    I'd quite like something like this:

    sun_texture_by_nyall.jpg

    Link to DA page: http://nyall.deviantart.com/gallery/#/d1plus1
  • BeatKitano
    Offline / Send Message
    BeatKitano polycounter lvl 16
    Ah yes, that will be useless for short hair, there's no proper order indeed :/
  • Eric Chadwick
    Simple... use Maya instead of Max. :)

    Doesn't really matter though, what the Max viewport does, unless it matches/approximates your game engine's artifacts... right?
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    UDK has the option for your to organize your mesh strands correctly if they screw up and set their sorting order in a more organized fashion.

    Let me reiterate that, a game engine allow you to sort your Alphas manually if they screw up during the export.

    It's a shame Max can't do that, I guess we have to hang in there till they fix DX and Nitrous, till then, people who can use Maya, use Maya, and people like me who don't use Maya, I guess we can go and have sex with sheep instead.
Sign In or Register to comment.