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.
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.
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
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?
Gah, I've been testing it: Everything looks the same on my desktop (GTX280).
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.
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.
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).
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:
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:
With HueAdjust factor & Half Lambert, ambient light is slightly increased to show effect more:
It works great on most colors (some more than other):
I think I'm going to have to call this version 1.5 or something higher
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.
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 .
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.
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.
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.
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 ?
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!
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.
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.
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).
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
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
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.
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!
Replies
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 !
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.
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
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?
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
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.
when can wee see a new version of shaders?
Btw, what does edge function do in 1.4 version?
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:
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:
With HueAdjust factor & Half Lambert, ambient light is slightly increased to show effect more:
It works great on most colors (some more than other):
I think I'm going to have to call this version 1.5 or something higher
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.
i didn't mke models.
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 .
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
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.
Damn, what graphics card ?
With all these requested features I've been adding I might have hit the boolean limit on some cards.
Running an ATI Radeon HD 5770 (knew I shouldnt have bought it!). Hope this helps man
edit: ok if it even happens on a GTX260... I'm gonna fix this. try the noshadows version too, Bal, see what happens ?
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!
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.
Thanks for the fast upload on this, looking forward to trying it out properly!
Is this compatible with max 2011?
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.
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).
did some messing around
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!
By the way thanks for putting a url to the viewport part of your website. Sometimes it was really painfull to find it!
Cheers.
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
Nice work man!
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.
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!