Needing an unusual "Iray Shader"... Just an ALPHA.

JD_MortalJD_Mortal Posts: 760

I am looking for a shader that will render the surface as an "ALPHA", not an "Opacity level".

Eg, I want it to be rendered "invisible", not rendering it transparent, which would reveal what is behind it.

Specifically, I need this for they eyes, so I can render the model with the eyes cut-out. This is going to be for a sprite-set, which has the eye-balls rendered alone, placed on a layer behind the model.

Unfortunately, the only way to do this now, is to delete all the geometry in the eye-socket and the back of the head. However, that messes with the rendering, as light now enters inside of the head. (SSS glow, and other things.)

Thus, my need for a material that simply tells IRAY to not-render the surface, so it simply renders it as an alpha there. Like how it does in canvases. (Which, unfortunately, in Daz, you can't select specific parts of the model to NOT render. It is either the whole model, or nothing.)

I can see other practical uses for this shader, so please, if one exists or someone knows how to make one, or hack a bad shader so it has that effect on a specific material, by accident... Please, let me know where to get it.

Post edited by JD_Mortal on

Comments

  • chris-2599934chris-2599934 Posts: 1,835

    Maybe you could use a green screen techjnique instead: make the eye surfaces solid matt green (or whatever colour), then remove them in post. Googling for "remove green screen" came back with a lot of hits.

    Another way: use two copies of the same figure identically posed on top of eachother. One has invisible eyes, the other only has eyes visible. Then use canvases.

    Both are a lot less convenient than using a shader - but you can at least do them both today without waiting for the shader to exist.

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528
    edited March 2020

    iray doesn't have a shadowcatcher shader?

    Octane render does

    this thread suggests iray does too

    https://www.daz3d.com/forums/discussion/290671/shadow-catcher-in-iray

    Post edited by WendyLuvsCatz on
  • JD_MortalJD_Mortal Posts: 760
    edited March 2020

    My issue isn't that I can't make things invisible... My issue is that, because the model is a whole item, it only has the options, in "canvases", to select the whole object. You can't select bones or materials within it, to "not render", which would make them exist, but just render an alpha-mask in that spot.

    I did find a couple of suitable workarounds...

    1: I made a sphere the same size and position as each eyeball.
    2: I hid the eyeballs and turned the opacity of the "Eye Moisture", to 0.0 opacity. (Otherwise it refracts the unseen sphere that replaces the eyeball.)
    3: I setup the canvas to render just the model, not the (unparented), spheres.

    Poof, instant cut-out eyes.

    I managed to do a similar thing with a geo-graft... But it really doesn't like this method for rendering. If you set the shell to 0.0cm offset, it erases the model completely. Even though I had it setup for a "nose-bridge", custom "surface", made from the model's topology. A glitch in the matrix... The only solution is to use a real small offset, which leaves a horrible "shadow" and also offsets the thing you are trying to perfectly align. However, it is functional if you use the offset, except for the fact that the "Rendering pixel-blur" value will mess with the edges, causing the two individual surfaces to "Not match". (Apparently, that nasty pixel-blur setting extends PAST the rendered image, via the alpha-mask, which is why all these things pick-up "black edges", as Daz renders with a "Black background", instead of using the "last edge pixel-color", as the "void" in the alpha background.)

    That results in the second image, where I rendered a hole in the nose and the skin, from the geo-shell, which is the same exact size as the hole, and it should have aligned perfectly. But, you can see that pixel-blue blended the edge, inward AND outward into the void. Thus, they will never patch-together seamlessly.

    However... That is fine, as the purpose was to create these masks, as individual masks to expose parts that couldn't normally be isolated otherwise. So they render as an alpha-mask, not just transparent. If this were used to "isolate the nose", so I could render it and other noses... It gives me something to use that can be dropped in place over the old item. Which is exactly what I needed. As opposed to trying to manually create an edge-mask, which just never looks right at all, in a paint-program, when you need precision corners masked.

    The second image shows how the two individual masked items don't align at the edges, when stacked. Each was individually rendered by telling the canvas NOT to render each other item. (But it still uses the item in the render, so it picks up shadows and reflections and refractions, etc.)

    test.png
    1920 x 768 - 1M
    ___test.png
    500 x 1000 - 4M
    Post edited by JD_Mortal on
  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528

    well isn't that what a shadowcatch shader does?

    allows the png alpha background to appear where it is applied, at least it does in Octane, I have not tried the iray one mentioned in my link

  • JD_MortalJD_Mortal Posts: 760
    edited March 2020

    well isn't that what a shadowcatch shader does?

    allows the png alpha background to appear where it is applied, at least it does in Octane, I have not tried the iray one mentioned in my link

    I'm not trying to catch shadows... I'm trying to isolate individual components of a model, that don't have specific "selectable" parts. The shadow catcher is about creating a dummy surface to "catch shadows"... I want a full alpha, no shadows, on individual materials or surfaces or specific topology. (Hiding isn't an option, because it allows light to enter the model. Phantom shadow objects would not work, because they would render the shadows or cast shadows themselves.)

    Currently, there is no setting in Daz, that does this. A simple material option, or object option to "Render to Alpha", as a level. (Being right next to the opacity option, which is similar but not the same. And also being next to the objects "Hide in render", which should honestly be an opacity and Alpha slider to adjust, not just an on/off value.)

    However, I am sure there is an option in the "Shaders", that could be made to do this. Because the shaders help determine what to render, or not render. Which is part of how the canvases function, for certain aspects. But, even in canvases, there is no option to "not render a material", only to "render materials by ID", which doesn't create individual "alpha" layers, it makes one giant nasty colorized patchwork of all the individual materials. The eyes have many layered materials. You can't isolate them into an alpha from that mess.

    Post edited by JD_Mortal on
  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528
    edited March 2020

    the correct term is actually matte shader

    I am just used to calling it shadowcatch because that's what it is called in Carrara which I mostly use and there it does exactly what you want in both the native engine and Octane 

    I know because I do it

    Post edited by WendyLuvsCatz on
  • JD_MortalJD_Mortal Posts: 760
    edited March 2020

    the correct term is actually matt shader

    I am just used to calling it shadowcatch because that's what it is called in Carrara which I mostly use and there it does exactly what you want in both the native engine and Octane 

    I know because I do it

    Well, I'm not finding that option anywhere in Daz... Show me where it is and that it works "like this", adn not just working like an "opacity"... and I will gladdly use it. (Demonstrate it on the eyes.) Eye-moisture is the outtermost layer of the eye.

    Clicking the script, "Create advanced iray node", does nothing to the eyes materials, or the base-model, or anything in Daz, on my computer. I see the Matte option, but it does nothing related to hiding the eye materials and making them "alpha". It makes them "Matte", a color...

    From the looks of it, it is nothing more than a transparent surface, which would not render as an ALPHA, unless it was on an ALPHA background. (If you put that in front of an object, it would still render the object behind it.) From what I have seen of the demonstrations.

    Post edited by JD_Mortal on
  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528
    edited March 2020

    I am busy rendering something in Carrara devil

    I did say I only have used it with Octane, just linked a thread about the iray equivalent and not actually tried it because personally I am not fond of iray, maybe it doesn't work as you say, I honestly don't know

    it works like chromakey in Octane on an object with a png background 

    if the iray matte shader doesn't work you need to do in post as others have suggested using chromakey if animated and a green or blue shader

    Post edited by WendyLuvsCatz on
  • JD_MortalJD_Mortal Posts: 760

    I think it isn't working, for that, because it is just something wrong with the script, in the latest updates to Daz. But, from further reading, there is a "mask" option for that setting too. (If the script actually worked.)

    However, for now, I have found a suitable work-around. Though, I do hope that the script gets fixed, or just becomes part of the actual material properties. I am not sure why a script was even needed to turn on MORE iray properties. I guess "Daz" themselves, just haven't added them to the base-line yet. Unfortunately, the script is a dud on my system. But, I know what to look for, later-on, if it ever gets put into Daz, officially.

    Thanks for letting me know it exists as a setting. (Potentially.)

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528
    edited March 2020

    I tested on the scene I am rendering in Carrara with the Octane plugin

    no help to you I know but shows the principle involved

    he is wearing briefs and nothing is hidden under his briefs but applying my matte shader I have also on the infinite plane below indeed makes his underwear an alpha

    matte0034.png
    1920 x 1080 - 608K
    Post edited by WendyLuvsCatz on
  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528

    I just tried DAZ studio and iray and that script

    it works but not quite the same as it applies to the whole object

    so

    what you need are conforming eye masks

     

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,528
    edited March 2020

     

    I exported his eyeballs and reimported as an obj

    (hid all bones except left and right eye, obj export no hidden)

    used transfer utility to conform them

    applied script to them

    in parameters display clicked the matte option

    then hid the figure's eyeballs 

    this works

    Post edited by WendyLuvsCatz on
  • Richard HaseltineRichard Haseltine Posts: 102,418

    Look at the Canvasses section in the Advacned tab of Render Settings.

Sign In or Register to comment.