How to use multiple MDL cutouts in the shader mixer?

OmnifluxOmniflux Posts: 371

Does anyone know how to apply two MDL cutouts in the shader mixer?

Here is an example of the issue I'm having using vMaterials 1.7's Design::Metal::metal_holes which includes a cutout in the MDL file.

Using the simplest network for an MDL file with no modifications to the material results in this, which is expected.

Simple MDL networkSimple MDL network render

However, if I add an additional cutout to the network, the first cutout is lost

Cutout MDL networkCutout MDL network render

The second cutout works as expected though

Cutout MDL network render with cutout map

I have also tested this by chaining multiple cutout bricks. Only the last in the chain has any effect.

Simple.jpg
512 x 512 - 57K
CutoutNetwork.jpg
1694 x 1126 - 257K
Cutout.jpg
512 x 512 - 56K
CutoutMap.jpg
512 x 512 - 38K
SimpleNetwork.jpg
1694 x 1126 - 220K
Post edited by Omniflux on

Comments

  • Wild guess, each cutout brick is going to require its own image brick as well.

    n.b. The headers and fields on some bricks can be renamed [check right-click options].

  • BejaymacBejaymac Posts: 1,886

    Basically what you have is the cutout brick over ruling the opacity in the custom brick, you need to be thinking about layering things, the attached image is a very quick throw together to give you an idea of what I mean.

    Just don't take my word for it though, having a real hard time converting many of my RSL shaders to MDL, layering several black and white masks in RSL is easy, trying to do the same in MDL is proving to be a bit beyond me atm.

    SM_possible.jpg
    1360 x 768 - 137K
  • OmnifluxOmniflux Posts: 371

    Catherine3678ab said:

    Wild guess, each cutout brick is going to require its own image brick as well.

    Unfortunately, the first cutout is defined in the MDL, so I don't have access to it as a brick, unless you know how to do so?

    Bejaymac said:

    Basically what you have is the cutout brick over ruling the opacity in the custom brick, you need to be thinking about layering things, the attached image is a very quick throw together to give you an idea of what I mean.

    I've tried previously with the "Clamped Surface Mix" brick, and just now with the "Add Weighted Layer" brick, but if that's the way, I can't figure it out...A cutout though the Base input works (in the attached example, the built in cutout), but I can't get a cutout to work through the Layer input. In the DS 4.8 changelog, there is a reference to a "Flattened Material" brick which sounded promising, but it was later renamed, and it does not say what the new name is (and it may not be relevant to this issue anyway).

    I think you are right in that it needs to be layered or mixed together somehow though.

    WeightedLayerNetwork.jpg
    1721 x 1039 - 328K
  • OmnifluxOmniflux Posts: 371

    Catherine3678ab said:

    Wild guess, each cutout brick is going to require its own image brick as well.

    Oh, clever Catherine...I don't think I can get access to the cutout in the MDL file, but I can get access to its image via the user parameters brick and then replace it with my own.

    This path may work if I can get the texture instance to use the coordinate system used by the original cutout...

    PremixCutoutNetwork.jpg
    1731 x 1131 - 312K
    PremixCutout.jpg
    500 x 500 - 36K
  • OmnifluxOmniflux Posts: 371

    I think I have found a solution...

    SolutionNetwork.jpg
    1731 x 1131 - 398K
    Solution.jpg
    500 x 500 - 58K
  • Omniflux said:

    Catherine3678ab said:

    Wild guess, each cutout brick is going to require its own image brick as well.

    Oh, clever Catherine...I don't think I can get access to the cutout in the MDL file, but I can get access to its image via the user parameters brick and then replace it with my own.

    This path may work if I can get the texture instance to use the coordinate system used by the original cutout...

    Since I can this way I will put in your image larger so people can see it.

    Will the custom cutout texture go straight to one of the Texture Instance bricks? If you're getting the results you want as is, then you're fine.
    I was thinking each texture instance goes to its own add cutout brick. Then those would have to be joining to one or two other bricks and eventually to the one output brick.

     

  • Omniflux said:

    I think I have found a solution...

     Our posts crossed ;-) If this is working for the desired results, great :-)

     

  • OmnifluxOmniflux Posts: 371

    Catherine3678ab said:

    Will the custom cutout texture go straight to one of the Texture Instance bricks? If you're getting the results you want as is, then you're fine.
    I was thinking each texture instance goes to its own add cutout brick. Then those would have to be joining to one or two other bricks and eventually to the one output brick.

    Yes, the texture can go directly to the Texture Instance brick.

    I haven't been able to find a way to combine the output of two cutout bricks, but that's what I was thinking too. Unless I run into any problems during further testing, it looks like this is what I'll be going with.

    Thanks for guiding me to a solution, @Bejaymac and @Catherine3678ab

Sign In or Register to comment.