Home Technical Talk

ShaderFX TGA PBL shader

2

Replies

  • Braddish
    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).
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    Hello Braddish,

    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

    D2wEOP.jpg
    [size=-1]click me![/size]
  • Braddish
    Wow, thank you! That just saved me a lot of time! :)
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    You're welcome!

    Please do share any future thoughts or issues you might have. Always good to get feedback.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    Small update due to popular demand. RC5.

    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.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Hi kodde,

    Can your shader work with 3dsmax 2014?
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    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.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks for the reply, kodde.

    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?
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    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.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Okay. Thanks for the reply, mate.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    New version, nothing big but now works properly in Maya 2016 and fixed transparency issue with metalness approach setting.

    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.
  • Seaseme
    Offline / Send Message
    Seaseme polycounter lvl 8
    Hi Kodde,

    Thanks for the great tool!
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    You're welcome. Glad you like it.
  • Eric Chadwick
    Hey @kodde, I was able to load your Maya 2016 sfx shader in 3ds Max 2018 and it works flawlessly!

    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. 
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    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.. 
  • srsface
    Offline / Send Message
    srsface polycounter lvl 5
    Aye it's a great shader, I've also fiddled around with it in 3ds Max. :smile: Just wish Autodesk fixed shadows in viewport for ShaderFX previews.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    Hey Eric,

    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!" :D 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.


  • Eric Chadwick
    1 = yes. BabylonJS has similar transparency sorting issues. So I don't mind.

    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!
2
Sign In or Register to comment.