Home Technical Talk

Xoliul's 3DS Max and Maya Viewport Shader

1235710

Replies

  • Chai
    Options
    Offline / Send Message
    Chai polycounter lvl 17
    I can't share that particular file, but I've made a quick alternative test.
    You see when you zoom in it's identical, but zoom out and it looks like max mip maps the shader.

    Download it here - http://www.svartberg.com/wip/q_3dsmax_shaderblur_test.rar

    Edit: wow thanks Xoliul, that 1.4 seems to do the trick ! :D

    q_3dsmax_shaderblur2.jpg
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Okay good to know it works for you. I honestly for the life of me didn't see a difference (though I had a hard time setting that poopshader up, not really as friendly as my own ;))

    It's actually a really silly thing: the default MinMagMip filters do a better job than when i define them explicitely as Linear or Anisotropic (aniso doesn't seem to do anything compared to linear). Hidden default values in Max can be annoying, that's th reason Poop's shader has trouble displaying textures: default lookup is Clamp instead of Wrap, since a few versions of Max...

    I'll polish this version a bit more and release it asap.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    it looks like it's using no mip-mapping at all by default? Are you sure you want to do that by default and depend on max's default versions.
  • chronic
    Options
    Offline / Send Message
    chronic polycounter lvl 10
    not explicity setting the filtering on your sampler's seems like a bad idea

    It's very subjective but i actually prefer some filtering to the default 'nearest' (no filtering) sure it blurs your textures a bit farther away but it prevents some pretty awful aliasing and artifacts.

    there is a mip map level bias switch that can help prevent too much loss of detail.

    Marmoset, and many games, perform a post process sharpening operation
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Yeah you guys are right, with the randomness involved with some of max' default settings I better not. I'll do some research on what looks best. Also gotta try that LODbias, but i remember in Unreal that setting seems to do nothing.
    The reference om MSDN is pretty bad however: http://msdn.microsoft.com/en-us/library/ee418352%28VS.85%29.aspx They don't even list all Filter types. Am i right there is Point (Nearest), Linear and Anisotropic?
  • chronic
    Options
    Offline / Send Message
    chronic polycounter lvl 10
    I'm pretty sure the filter types available vary based on the host application - which is both crazy and annoying.

    The Mipmap LOD bias definitely helps in Maya, but maybe thats also variable based on the host app.

    Its not too hard to code a very basic post filtering sharpening function but the results can vary from mildly good to extremely horrendous
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Gah, I've been testing it: Everything looks the same on my desktop (GTX280).
    TestGTX280.jpg

    Changing the explicit Filter definition only makes a difference if I set it to point. So essentially no definition, Linear and Anisotropic look the same. I guess they're all defaulting to linear. But that doesn't explain why the 1.3, which is explicitly defined as Linear, looks worse on Sam & Chai's computers. EDIT: it's probably a different LODbias default or something.

    I'll test this again on my laptop, that's an ATi.

    And Chronic, I actually spent some time studying post shaders today. I find them a bit difficult to get my head around since the examples from Max jump around in their code all the time, it's very hard to follow, plus they do some weird scripting in there. Once I get past the implementation I can write an Unsharp Mask postshader; I've made one for UDK before and that worked fine and looked okay.
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
    Hi!
    when can wee see a new version of shaders?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    I'm still working a bit on it. And uhmm, I also want the release to go along with a bit of a redesign of my shader webpage (since it's so crappy), but I need help from someone else there since I suck at that. Being dependant on someone else slows progress down a bit.
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
    Great!Thx for info!
    Btw, what does edge function do in 1.4 version?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Ah I don't know if that's working in the one I uploaded, but normally it's a sort of cartoony edge effect, black lines around outlines and so. It's not perfect since that normally is a post effect. I might drop it in favor of a post effect now that i know how to write those (got a bunch of post shaders lined up for release too).
  • Wahlgren
    Options
    Offline / Send Message
    Wahlgren polycounter lvl 17
    Thanks for the hard work xoliul. Got to repeat myself though. A glow emissive post effect thingy would be awesome if you think you could pull it off :)
  • Ballo
    Options
    Offline / Send Message
    Ballo polycounter lvl 9
    Can I load in Maya?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Andre; thanks man. I'm thining about that. It's an unknown area for me, as it's some weird hybrid between post and object shaders. That being said: I figured out post shaders in a day or two so this shouldn't be too hard.
    Maya is a long shot: their HLSL support really isn't very good...

    Also I just implemented a really cool feature, i I might say so myself:
    the shader now performs a Hue, Saturation and Lightness adjustment based on how lit an area is. I'll explain:

    Ever since I worked on a NYC yellow cab last year, I noticed that especially with saturated colors, regular shader calculations like the ones used in every game or in my shader, wash things out and give it a bit of a fake CG look.
    here's a picture to illustarte it in real life:

    DSCN1386.JPG

    Note how at the bottom, the colors shift towards an orange tint.

    So I tried to make sense of what is happening. Thinking about painting theory I read from Steven Stahlberg and Niklas Jansson, I realized that colors don't just darken; their hues and saturation shift as well.

    So today i went and implemented this, here are two compare shots, same cabbie model:

    without Hue Adjust factor & Half Lambert:

    HueAdj1.jpg

    With HueAdjust factor & Half Lambert, ambient light is slightly increased to show effect more:

    HueAdj2.jpg

    It works great on most colors (some more than other):

    HueAdjust.jpg

    I think I'm going to have to call this version 1.5 or something higher :p
  • StefanH
    Options
    Offline / Send Message
    StefanH polycounter lvl 12
    wow that looks like a great addition. cant wait. love your shader and use it all the time.
  • cw
    Options
    Offline / Send Message
    cw polycounter lvl 17
    I am so excited! That HSL adjustment looks really cool! Pricey though in terms of instructions?
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    thanks for the nice words guys. Hopefully this will allow users to take realtime illustrative rendering one step further.
    cw wrote: »
    I am so excited! That HSL adjustment looks really cool! Pricey though in terms of instructions?

    Probably a bit yes. Shouldn't be extreme compared to other stuff: enabling 3 instead of 1 lights is heavier, for example. With a GeForce GTX280 I get no FPS hit whatsoever when HueAdjust is on. But yeah it's becoming more and more of a bad idea to use this shader with GeForce 7 and older I think.
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
    my staff with xloliul shader.
    i didn't mke models.
    tablemj.jpg
  • Michael Knubben
    Options
    Offline / Send Message
    Hey Laurens, any update on 1.5 (or whatever you end up calling it...)?
  • Ged
    Options
    Offline / Send Message
    Ged interpolator
    great work only major reason I dont use this shader often is the max shadows that I have to use with it...they are just really unpredictable :/
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Michael, It's really mostly about getting the webpage redesigned; I want something clear and easy, like RenderHJS' textools page. But I need to do some CSS edited for that, wordpress doesn't really make that sort of layout easy to do. I just gotta find someone to explain it to me, then I can get to it.

    Ged; yeah the shadows are not super, but more than 75% of the time I don't use the shadowed version. For my HotRod, that even made it into 3D Creative magazine, there was no self-shadowing, it only casted shadows onto a plane on the ground. The guys at 3Dtotal never noticed I think :p.
  • airbrush
    Options
    Offline / Send Message
    airbrush polycounter lvl 13
    love this shader...looking forward to the new tweaks
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Big Update!

    Allright, I spent the last 2 days working on this almost non-stop.
    I worked on the shader and the webpage. I based the layout on RenderHJS' Textools page and redid everything. Thanks to Lieve for finally putting me on my way with the CSS classes, so I could get the layout how I wanted it.

    So what does this mean, what's new?

    • There's a big link on the front of my website, you no longer need to know the url by heart. Finally.
    • The viewportshader page is redone to function as a manual/featureguide. Features are listed and explained, illustrated with animated GIF's (yay flashy) and I put some suggestions in there on how to use certain features. I also marked some features as "Hot" because I think they're very interesting and/or people seem to miss them most of the time.
    • New version 1.5 is released, filling requests, fixing issues, adding features. There's lightmaps, multiple UV channels, etc.. Read the page.
    • Alongside v1.5 I'm releasing the first version of my Post Shaders! Some pretty nifty effects like color correction, bloom, unsharp mask. Click the big red sphere on the viewportshader page to get to the post shader page.
    • FAQ's added or redone for both shader types. Links in obvious position to hopefully save me a few emails with questions.
    Links:
    viewportshader 1.5
    Post Shaders

    Let's hope I get to see even more awesome examples of my shader in action from now on :)
  • Bal
    Options
    Offline / Send Message
    Bal polycounter lvl 17
    This sounds great! Love the new site.

    I just tried 1.5 though, and I get this error in the Material Editor :

    error X4550: maximum boolean register index exceeded - Try reducing number of constant branches, take bools out of structs/arrays or move them to the start of the struct
    C:\Program Files\Autodesk\3ds Max 2009\maps\fx\memory(1236,25): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
    ID3DXEffectCompiler: Compilation failed

    Using max 2009, version 1.4 has always worked fine for me.
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
    COOLEST STAFF EVER!
  • CompanionCube
    Options
    Offline / Send Message
    CompanionCube polycounter lvl 12
    sweet! thanks for update :)
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Bal wrote: »
    This sounds great! Love the new site.

    I just tried 1.5 though, and I get this error in the Material Editor :

    error X4550: maximum boolean register index exceeded - Try reducing number of constant branches, take bools out of structs/arrays or move them to the start of the struct
    C:Program FilesAutodesk3ds Max 2009mapsfxmemory(1236,25): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
    ID3DXEffectCompiler: Compilation failed

    Using max 2009, version 1.4 has always worked fine for me.

    Damn, what graphics card ?
    With all these requested features I've been adding I might have hit the boolean limit on some cards.
  • senor-cojones
    Options
    Offline / Send Message
    Just got exactly the same error as Bal :(

    Running an ATI Radeon HD 5770 (knew I shouldnt have bought it!). Hope this helps man
  • Bal
    Options
    Offline / Send Message
    Bal polycounter lvl 17
    Using a Geforce GTX 260 here.
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Man, ATi must've taken a step backwards in terms of number of boolean registers; my HD2600 runs it just fine. Does the noshadows version also do this?
    edit: ok if it even happens on a GTX260... I'm gonna fix this. try the noshadows version too, Bal, see what happens ?
  • Bal
    Options
    Offline / Send Message
    Bal polycounter lvl 17
    Yeah, just tried, the noshadows version seems to work fine.
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    There's a new version up (same link), I took out one boolean option, which hopefully keeps the number just under the limit. Let me know if it works.
  • senor-cojones
    Options
    Offline / Send Message
    No shadows works but still the same error message- now with a slightly different memory number;

    error X4550: maximum boolean register index exceeded - Try reducing number of constant branches, take bools out of structs/arrays or move them to the start of the struct
    C:\Users\Cojones\Desktop\memory(1238,25): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
    ID3DXEffectCompiler: Compilation failed

    Just seen the shader running properly on my mates pc- looking really awesome!
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Try again please senor-cojones, just made a little hacky edit that hopefully gets rid of it.
    I was thinking that removing shadowcode, like in the noshadows version, only reduces the number of if-statements by 1, but it's about 2 or 3. I compared 1.4 and 1.5, and all i could see that might cause problems was the lightmap's if statement. That's been replaced by a little trick now; you turn the lightmap off with a floatspinner and setting it to 1 or 0.
    thanks for helping me test this btw.
  • senor-cojones
    Options
    Offline / Send Message
    Just tried and both the normal and no shadow versions works fine. The normal version takes a little while to load in but seems to be working great :)

    Thanks for the fast upload on this, looking forward to trying it out properly!
  • Pedro Amorim
    Options
    Offline / Send Message
    Super sweet man :)
    Is this compatible with max 2011?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Super, senor-cojones! This does unfortunately mean I've pretty much hit the limit in terms of options for the user
    bitmap: it is definitely, I tested it and works fine. Better even than Max 2010 because that bug where it forgets selected lights upon file reload, is fixed.
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
    Damn, i am stupid, but саn you explain how to use grab script?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    Heh, i guess I'll need to add a FAQ entry for that.

    It's a macroscript. you add it to a hotkey or toolbar button (i added it to my custom toolbar). It's in the Tools category as "Grab viewport" (no ... behind it).
  • zxcman
    Options
    Offline / Send Message
    zxcman polycounter lvl 10
    Thx!this is awesome!
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    works great. love the shaded hue shift thingy .my card is a nvidia 9400GT
  • Bal
    Options
    Offline / Send Message
    Bal polycounter lvl 17
    Yay, works fine now, you rock Xoliul!
  • leslievdb
    Options
    Offline / Send Message
    leslievdb polycounter lvl 15
    works like a charm
    did some messing around

    10n4z7n.gif
  • rasmus
    Options
    Offline / Send Message
    Great updates, Laurens, will check 'em out!
  • MR_Verkerk
    Options
    Offline / Send Message
    I just got a link to your shader from Nysuatro and I really like it!

    One thing that just came up is that when you copy the material it makes a duplicate that takes over the settings, but it doesnt copy the maps that I loaded into the material. I guess that if you want to copy the material you also want to keep the maps, instead of having to reasign them all over again :)

    other than that, I really like it!
  • hellkt
    Options
    Offline / Send Message
    Great news, I'm gonna check it right now. I'm using a Radeon 4850, if I get problems I'll let you know.

    By the way thanks for putting a url to the viewport part of your website. Sometimes it was really painfull to find it! :)

    Cheers.
  • MR_Verkerk
    Options
    Offline / Send Message
    Hey Xoliul, I really like your shader. The only thing I find weird is when I try to duplicate a material with your shader applied. At that point it does copy all the settings and values, but doesnt copy the textures applied in it. So basicly I then have to reasign all the texture maps again. Can this be fixed or is there a reason it doesnt copy the maps along with the values?:)

    Nevertheless, I really like the shader a lot! although sometimes my models look way better when actually placed in the engine itself:p but I guess thats a engine problem, so there is nothing wrong with showing off my awesome models with better shaders then how they are going to look in the end right ;) unreal sometimes has this nasty texture compression :p

    Nice work man!
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    hey hellkt, I hope it works, it should i think. And yeah the URL was due :)

    MR_Verkerk: that is Autodesk playing up again. They let some DirectX shader functionality deteriorate in Max 2010; e.g. how it forgets the lights when you reopen the file. Your problem fits in the same category. Good news is they fixed it in 2011.
  • BradMyers82
    Options
    Offline / Send Message
    BradMyers82 interpolator
    Xoliul: Hey man, Congrats on the awesome new release.
    Dude I have been wanting good post effects in 3ds max for ages.....
    This update is really great.

    Now the only other thing I could ask for is a true glow solution. I haven't tried the self-illumination myself properly yet... but it doesn't give you a true bloom effect, correct? (one that illuminates off the surface and blurs)

    Also, I looked at your code and I noticed that you commented out a "Glow technique" I hope I'm not giving away any special features in the next update. But I am assuming you had a glow effect in mind similar to the glow you get with shaderfx.

    Honestly, that would be the only thing I would love to see that hasn't been implemented in this shader yet.

    Lastly, I would love to know if anyone has been able to simulate really good skin effects with this shader. If so please post it!

    Again, Great Work Xoliul, you never cease to impress me!
1235710
Sign In or Register to comment.