Hi Kodde, I've been using the shader and its working out really well!
I've created a layered shader that does vertex blending to blend between to layers. I've also been able to plug in the RGB channels from my packed reflect/roughness/metal textures that can go straight into a game.
I have one question, kind of unrelated to your shader specifically... Do you know if there a way to create an "Overlay" blend mode in shaderFX? (like overlay in photoshop).
melviso> I don't think shaderfx shaders are interchangeable between Maya and Max. I can't speak from my own experience though. If you try it out then please let me know. Thanks.
3dsmax 2014 does not support shaderfx. I don't intend to interchange materials made with the shader between Max and Maya. I was asking if your older physical based shader (non-shaderfx) supports max 2014 bc I tried using it and it reported an error.
If no, any chance u might bring this to max for older versions?
Oh you mean the CGFX-version? I am fairly sure it doesn't. I know some users asked about this in my thread for the shader. Not sure about Max 2014 specifically. But I wouldn't get my hopes up if I were you. Sorry.
I am not a Max user so I am afraid I wouldn't even know where to begin. Also putting effort on the old CGFX-version isn't really that appealing. Getting the newer ShaderFX-version to work in newer Max as well would be really nice though.
From 1.0 RC5 -> 1.0 RC6:
*This version is only compatible with Maya 2016*
-Fixed issue with shader displaying incorrectly with Maya 2016 due to "Use floating point render target" now being enabled by default for VP2.0. This caused issues which I had not noticed earlier.
-Transparency using albedo alpha channel now works correctly with Metalness approach setting.
I'd like to add a Boolean checkbox to enable diffuse alpha for alpha blend transparency.
I'm able to expose this, but getting some odd results when the same shader is applied to multiple materials. Maybe I just need to export the sfx into a standalone fx.
2. Gamma.
Viewport gamma has to be disabled for the lighting to be correct. But then IBL diffuse contribution is about 3x lower. I bet I can boost it in ShaderFX.
3. AO.
AO texture isn't occluding IBL diffuse contribution. I bet this won't be hard to change in ShaderFX.
4. Color cast.
The IBL seems to be casting more color in Max than in BabylonJS. Not sure how to fix this.
You might want to look at what sort of tone mapping and color correction is there in babylonjs. I'm having similar issues with maya shaders at work vs engine vs substance
It's a sodding minefield and I wish I'd never started fiddling around..
Cool! I think that's the first time I hear someone using Max that got the shader working. First off, I haven't touched that shader in what feels like ages (2,5yrs).
1) What do you mean by diffuse Alpha? I.e. diffuse texture's alpha channel controls transparency? My experience with real-time shaders in Maya and transparency has always been dodgy. I never heard of anyone who said "Gee the transparency in Maya viewport works great!" Maybe similar scenario in Max? I do have some recollection of the multiple objects causing issue in Maya.
2) This is a tricky one since I have no idea how the BabylonJS does their shading. It could be a number of factors. HDR ibl texture? Should be easy to just add some tweaking possibilities as you mention.
3) Oh I wasn't aware. I'd say this is just a miss on my part. As you mention, should just be a matter of adding an extra multiply node in the right spot.
4) Also a very tricky one since I have no idea how BabylonJS does it. Is their pipeline fully linear? Same IBL texture? Any dynamic lights? Any tonemapping as poopipe mentioned? Switch from non-linear pipeline to linear pipeline usually means overall darker darks and thereby a more saturated look. At least as far as I remember, haven't really been working on these parts of shading since I worked with this shader.
Replies
I've created a layered shader that does vertex blending to blend between to layers. I've also been able to plug in the RGB channels from my packed reflect/roughness/metal textures that can go straight into a game.
I have one question, kind of unrelated to your shader specifically... Do you know if there a way to create an "Overlay" blend mode in shaderFX? (like overlay in photoshop).
Glad to hear you like it
Here's some math behind the blending modes.
http://www.deepskycolors.com/archivo/2010/04/21/formulas-for-Photoshop-blending-modes.html
I tried building it. Works just fine.
SFX-file here: http://kostas.se/files/overlay_shaderfx.rar
[size=-1]click me![/size]
Please do share any future thoughts or issues you might have. Always good to get feedback.
You can get it here: http://www.kostas.se/shaderfx-tga-pbl-shader/
From 1.0 RC4 -> 1.0 RC5:
-Per popular demand added emissive/fullbright texture + multiplier.
Can your shader work with 3dsmax 2014?
3dsmax 2014 does not support shaderfx. I don't intend to interchange materials made with the shader between Max and Maya. I was asking if your older physical based shader (non-shaderfx) supports max 2014 bc I tried using it and it reported an error.
If no, any chance u might bring this to max for older versions?
I am not a Max user so I am afraid I wouldn't even know where to begin. Also putting effort on the old CGFX-version isn't really that appealing. Getting the newer ShaderFX-version to work in newer Max as well would be really nice though.
You can get it here: http://www.kostas.se/shaderfx-tga-pbl-shader/
From 1.0 RC5 -> 1.0 RC6:
*This version is only compatible with Maya 2016*
-Fixed issue with shader displaying incorrectly with Maya 2016 due to "Use floating point render target" now being enabled by default for VP2.0. This caused issues which I had not noticed earlier.
-Transparency using albedo alpha channel now works correctly with Metalness approach setting.
Thanks for the great tool!
I'm investigating a way to edit glTF models in 3ds Max, and see an equivalent preview of how they'll look in the BabylonJS web 3d viewer.
Your shader is really really close!
This isn't my model, it's from the GitHub samples.
More example images, and a link to the model:
https://github.com/BabylonJS/Exporters/issues/296
A couple open issues:
1. Transparency support.
I'd like to add a Boolean checkbox to enable diffuse alpha for alpha blend transparency.
I'm able to expose this, but getting some odd results when the same shader is applied to multiple materials. Maybe I just need to export the sfx into a standalone fx.
2. Gamma.
Viewport gamma has to be disabled for the lighting to be correct. But then IBL diffuse contribution is about 3x lower. I bet I can boost it in ShaderFX.
3. AO.
AO texture isn't occluding IBL diffuse contribution. I bet this won't be hard to change in ShaderFX.
4. Color cast.
The IBL seems to be casting more color in Max than in BabylonJS. Not sure how to fix this.
It's a sodding minefield and I wish I'd never started fiddling around..
Cool! I think that's the first time I hear someone using Max that got the shader working.
First off, I haven't touched that shader in what feels like ages (2,5yrs).
1) What do you mean by diffuse Alpha? I.e. diffuse texture's alpha channel controls transparency?
My experience with real-time shaders in Maya and transparency has always been dodgy. I never heard of anyone who said "Gee the transparency in Maya viewport works great!" Maybe similar scenario in Max? I do have some recollection of the multiple objects causing issue in Maya.
2) This is a tricky one since I have no idea how the BabylonJS does their shading. It could be a number of factors. HDR ibl texture? Should be easy to just add some tweaking possibilities as you mention.
3) Oh I wasn't aware. I'd say this is just a miss on my part. As you mention, should just be a matter of adding an extra multiply node in the right spot.
4) Also a very tricky one since I have no idea how BabylonJS does it. Is their pipeline fully linear? Same IBL texture? Any dynamic lights? Any tonemapping as poopipe mentioned? Switch from non-linear pipeline to linear pipeline usually means overall darker darks and thereby a more saturated look. At least as far as I remember, haven't really been working on these parts of shading since I worked with this shader.
Most realtime renderers do the same, unless you have faster hardware and can afford fairly-expensive sorting solutions.
4. Linear, ah that's a good thing to ask. I'll look into it. There's 1 directional dynamic light in each, white. No tonemapping I think.
I'll keep digging!