DS3/4.6 ShaderMixer ShadowCatcher That's Semi-Transparent In Preview Pane?

Is this possible? A DS3/4.6 ShaderMixer ShadowCatcher That's Semi-Transparent In Preview Pane? With the 3Delight renderer.

The standard plugging a Shadow Catcher brick into the Opacity Color of the DS Default Material brick (attached image) makes the plane fully opaque in the preview.

Routing it via a Color Multiply (the extra dangling brick in the image) makes no difference to the preview, regardless of the value I set for my Opacity Strength Multiplier color.

I guess it's not possible?

 

Alternative approach - is there any way to display the shadowcatching plane as just wireframe in the preview pane while everything else is displayed textured?

sc.png
814 x 517 - 61K

Comments

  • 3dcheapskate3dcheapskate Posts: 2,689

    ... sound of tumbleweed rolling ...

     

    "Hello! ...hello! ...ello! ...llo! ...lo! ...o! ...!"

    "Anybody there? ...there? ...here? ...ere? ...re? ...e? ...?"

     

    ... sound of tumbleweed still rolling ...

  • mjc1016mjc1016 Posts: 15,001

    Unfortunately...no, I don't know of one.  And I'm not sure how to go about making one that won't ultimately make 'half strength' shadows.

  • millighostmillighost Posts: 261

    Is this possible? A DS3/4.6 ShaderMixer ShadowCatcher That's Semi-Transparent In Preview Pane? With the 3Delight renderer.

    The standard plugging a Shadow Catcher brick into the Opacity Color of the DS Default Material brick (attached image) makes the plane fully opaque in the preview.

    Routing it via a Color Multiply (the extra dangling brick in the image) makes no difference to the preview, regardless of the value I set for my Opacity Strength Multiplier color.

    I guess it's not possible?

    Yes, it is possible. The preview does not really care what the shader does, or how it works. The only thing that the preview cares about is the properties of the material. So you only need to get a property named "Opacity Strength" into your surface parameters. That can either be done by adding a float value brick into your network (you need to be creative to connect its output, otherwise it will be ignored). You can also write a simple script that inserts the property into the material without any function; like this snippet below:

    ...var material = find_shadow_catcher_material_somehow ();var prop = new DzFloatProperty ("Opacity Strength", true, false);material.addProperty (prop);

     

  • 3dcheapskate3dcheapskate Posts: 2,689
    edited August 2015

    Only just spotted that there's now some replies - thanks!  :) Still stuck after trying millighost's suggestions though...

    "So you only need to get a property named "Opacity Strength" into your surface parameters." - I like the sound of that. There's already an "Opacity Strength" property on the "DAZ Material" brick (which is I think a renamed "DS Default Material") as in the attached screenshot...

    (same network as in the OP but with "Opacity Color" expanded and properties of "Strength" displayed. I noticed that on a "DS Default Material" the Label for this property is also set to "Opacity Strength"). If I recall correctly, this is 'ignored' since there's something plugged into the "Opacity Color" input of the "DAZ Material" brick - so it doesn't appear on the Surfaces tab for the material in the normal DS UI. So I need to somehow get it there?

    I tried changing it to mid-grey and then to black in the ShaderMixer window and applying the modified shader to the ground - but no effect, still 100% opaque black.

    And the creative connection of a float brick? This made the "Opacity Strength" appear on the Surfaces tab and control the opacity in the preview window exactly as I wanted. But when I render the ground is always 100% transparent.

     

    Since the material in question is created in script I tried that approach, but it doesn't seem to do anything when added to my code...

    DsActions.prototype.setGroundMaterialProperties = function( oMaterial, oShape )
    {
        this.m_oElement = oMaterial;
        this.m_sMaterialType = "DzBrickMaterial";
        this.m_sMaterialName = "Preview";
        this.prepareGroundMaterial();
        g_oPresetHelper.setTargetElement( this.m_oElement );
        g_oPresetHelper.setNumericProperty( "UV Set",  [ 0 ] );
        g_oPresetHelper.setNumericProperty( "Smooth On",  [ 1 ] );
        g_oPresetHelper.setNumericPropertyWithAttributes( "Smooth Angle", true, 0, 180, [ 89.9 ] );
        g_oPresetHelper.setNumericProperty( "Render Priority",  [ 3 ] );
        g_oPresetHelper.setNumericProperty( "Propagate Priority",  [ 0 ] );
        g_oPresetHelper.setNumericProperty( "Accept Shadows",  [ 1 ] );
        g_oPresetHelper.setColorProperty( "Diffuse Color",  [ 0, 0, 0 ] );
        g_oPresetHelper.setNumericPropertyWithAttributes( "Diffuse Strength", true, 0, 1, [ 1 ] );
        g_oPresetHelper.setNumericPropertyWithAttributes( "Glossiness", true, 0, 1, [ 1 ] );
        g_oPresetHelper.setColorProperty( "Specular Color",  [ 255, 255, 255 ] );
        g_oPresetHelper.setNumericPropertyWithAttributes( "Specular Strength", true, 0, 1, [ 0 ] );
        g_oPresetHelper.setNumericProperty( "Multiply Specular Through Opacity",  [ 1 ] );
        g_oPresetHelper.setColorProperty( "Ambient Color",  [ 0, 0, 0 ] );
        g_oPresetHelper.setNumericPropertyWithAttributes( "Ambient Strength", true, 0, 1, [ 1 ] );
        g_oPresetHelper.setColorProperty( "Reflection Color",  [ 0, 0, 0 ] );
        g_oPresetHelper.setColorProperty( "Refraction Color",  [ 0, 0, 0 ] );
        g_oPresetHelper.setColorProperty( "value3",  [ 255, 255, 255 ] );
        g_oPresetHelper.setColorProperty( "value22",  [ 128, 128, 128 ] );
        
        print("Creating Opacity Strength property")
        var prop = new DzFloatProperty ("Opacity Strength", true, false);
        oMaterial.addProperty (prop);
    }

     

    (and yes, I did check the log file - the script doesn't crash!)

    (and I'll fix those images if and when DAZ fix the forum s**tware)

    Post edited by Richard Haseltine on
  • 3dcheapskate3dcheapskate Posts: 2,689

    If I can get this working, a black and white image map with the words "Shadowcatcher material", would be a useful reminder when I'm looking at the preview pane.

    Of course, I need to make sure that the "Opacity Strength" that this is plugged into has no effect on the render, just on the preview.

     

    SCM.png
    256 x 256 - 8K
  • millighostmillighost Posts: 261

    Here is an example of what i think you want to do in shadermixer:

    left is the shadermixer nodes, middle a screengrab of the preview, right the render from the camera. Important are the names of the parameters of the Value(3) and Image Map(5) nodes: they are named "Opacity Strength" and "Diffuse Color" respectively.

     

     

    scatch-pv.png
    1758 x 684 - 303K
  • mjc1016mjc1016 Posts: 15,001

    After much playing around and trial and error (lots of error on my part...I doubled up the plane and didn't realize it), I got this one working...

  • 3dcheapskate3dcheapskate Posts: 2,689
    edited August 2015

    Here is an example of what i think you want to do in shadermixer:

    left is the shadermixer nodes, middle a screengrab of the preview, right the render from the camera. Important are the names of the parameters of the Value(3) and Image Map(5) nodes: they are named "Opacity Strength" and "Diffuse Color" respectively.

    Yes, that's exactly what I'm after. So I just tried your network in DS4.6 (I assume from your screenshot that you're using a later version?), but with no luck - it still shows solid opaque dark grey in the preview. Attached screenshot is my attempt at duplicating your network - hopefully I made a stupid mistake.

    I'm trying to understand exactly what it should do - here's my thoughts/guesses/observations.  You've not got the DS Default Material brick, so I guess this is sort-of similar-ish to bypassing most of Poser's PoserSurface inputs and just plugging a network into Alternate Diffuse? At rendertime the shadowcatch brick alone will control the opacity (Value(7) will have no effect on this), and the color will be black (zero from the BinaryOperation(5) 'min' brick), so we'll get black shadows. In the preview pane the shadowcatch has no effect (neither does the 'Opacity' color set in the Surface(1) brick, which surprised me), so what you see is controlled only by what's plugged into Color input of Surface(1). I assume that naming Value(7) input as "Opacity Strength" and ImageMap(8) input as "Diffuse Color" somehow make the preview treat them as such? But I'm lost with the 'add' and 'min' bricks.

    Am I even in the ballpark?

    mjc1016 said:

    After much playing around and trial and error (lots of error on my part...I doubled up the plane and didn't realize it), I got this one working...

    And do we get to see the network ?  ;o)  What version of DS are you using?

    mytry.png
    960 x 580 - 77K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,689
    edited August 2015

    ...and (removing a few more bricks from millighost's network to simplify things and give my brain a chance!) even if I just plug a Value brick directly into Color on Surface(1) the preview is solid opaque grey, and in the render I see the shadow but the whole plane is visible, coloured, and semi-transparent.

    simplefail.png
    801 x 393 - 64K
    simplefailPR.jpg
    358 x 393 - 29K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,689

    ...and doing a similar thing but just using the Value brick for Opacity Strength...

    OpSt.jpg
    827 x 399 - 70K
    OS2.jpg
    574 x 338 - 46K
  • mjc1016mjc1016 Posts: 15,001
    edited August 2015

    The two middle bricks...Add and Min are binary operation.  Everything else is exactly the same as millighost's...but I did rename everything on the value and image map bricks (name and label, even the brick title itself).  And that was one of the 'problem' areas, until I renamed everything, it kept showing up opaque.

    One really weird thing...when I reloaded the network, after closing and restarting DS a png image wasn't showing up, when put in the image slot, but a jpg does  and so other pngs.

    Post edited by mjc1016 on
  • 3dcheapskate3dcheapskate Posts: 2,689
    edited August 2015
    mjc1016 said:

    The two middle bricks...Add and Min are binary operation.  Everything else is exactly the same as millighost's...but I did rename everything on the value and image map bricks (name and label, even the brick title itself).  And that was one of the 'problem' areas, until I renamed everything, it kept showing up opaque.

    One really weird thing...when I reloaded the network, after closing and restarting DS a png image wasn't showing up, when put in the image slot, but a jpg does  and so other pngs.

    Got it, thanks! It's the "Name" parameters (exactly as millighost said) that are important. Not the "Label", "Path" or brick title (I was setting the label).

    This now works in DS4.6 as millighost stated. Off to try the same in DS3...

    (Note: the "Diffuse Color" and "Opacity Strength" that appear on the users Surfaces tab only control what the preview looks like and have no effect on the render.  Next trick is to work out how to add a "Shadow Color" control that will affect the render...)

    working.png
    1271 x 660 - 161K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,689

    Can't seem to get it to work in DS3 though - render's okay, but the previews always solid opaque dark grey.

    Here's a screenshot of the network in case anybody can spot something. Or it could just be that it won't work in DS3?

     

    NotForDS3.jpg
    1251 x 586 - 153K
  • 3dcheapskate3dcheapskate Posts: 2,689

    Anybody have any luck with this in DS3 ?

Sign In or Register to comment.