Trying to recreate a simple Poser candleflame shader in ShaderMixer (3Delight)

2»

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,831

    It's been a while sionce I have doen even the most perfunctory shader mixing, but I've put a link on the desktop to try to have a look by-and-by if no one more comptenent beats me to it.

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited June 2022

    Thanks Richard.

    When I look at those three nested ellipsoids I see a horizontal (side-to-side) variation between edge and centre that is dependent on the height up the flame, same as before.
    To me an Edge Blend is still the obvious way to deal with the former, although a comparison of X and Z camera-space* normals is an option, but then that's part of what an Edge Blend does anyway.
    V texture coordinate is similarly the obvious way to deal with the latter because of my cylindrical mapping, althogh the vertical component of the world-space surface normals is another option. From bottom to top of the flame neither of these vary in a linear manner, but both vary in accordance with simple trig functions.

    So I think I'll try the same approach as I did in Poser, ignoring both the colours of the flame and the transparency, and just trying to get nested black and grey ellipsois within a white ellipsoid.

    Firstly, just a simple Edge Blend:

     

    Then just the V coordinate (inverted so 0 is at the bottom):

     

    And then applying gain to that inverted V:

     

    Looking at those, I'm sure that I should be able to create what I'm after.

     

    *An Edge Blend effectively takes the component of the camera-space surface normal that's pointing directly at the camera to determine how 'head-on' the surface is. A normal being a unit vector, the value should be cos(α) where α= 0° for head-on, to α=90° for edge-on.

    Just Edge Blend Attenuation.jpg
    1284 x 427 - 113K
    Inverted V.jpg
    954 x 391 - 62K
    Inv V with gain.jpg
    1710 x 490 - 136K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited June 2022

    Just playing, using the screenshots in the above post as reference. Note: I'm sometimes applying non-white colours to the edge blend simply to insure that clicking the 'Apply' button has actually applied the shader:

     

    The one below is on the right track I think:

     

    ...although significantly different from what I got in Poser

     

    (Having successfully reproduced my Poser Firefly render in Poser Superfly by playing with a separate EdgeBlend node in this way, I thought it was worth another go for 3Delight)

    Think.jpg
    1316 x 625 - 117K
    Not bad.jpg
    1323 x 624 - 141K
    poser.jpg
    163 x 282 - 6K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited June 2022

    ...and just when I thought I was starting to make progress, I run into a completely different problem when applying that to the transparency/opacity (spot render in the viewport)

      

    opaque.jpg
    486 x 593 - 56K
    2.jpg
    209 x 309 - 10K
    3.png
    239 x 298 - 26K
    Untitled.jpg
    1250 x 664 - 135K
    Post edited by 3dcheapskate on
  • Richard HaseltineRichard Haseltine Posts: 100,831

    I can't see that it would matter, since there appear to be no ray-trace operations in the shader, but on the opacity have you tried increasing the ray trace depth in Render Settings?

  • 3dcheapskate3dcheapskate Posts: 2,719
    edited June 2022

    I didn't try that - I just added the DS Default Material brick back in and the problem disappeared.

     

    Just to be absolutely sure that was the cause I bypassed the DS default brick again. Sure enough, problem reappeared. I hadn't noticed before, but the problem shows up even on the candle wick. I think I'll just pretend that I never saw this problem:

     

    And just as a visual reminder, here's the output of the Edge Blend brick that I plan to use to control the opacity, plugged into the ambient colour of the DS default with zero transparency just to help visualize

     

    Next step, try to get the black-orange-yellow-white colour stuff working.

     

    (I've attached the DBM including the connected DS default material, zipped. Note that it also contains the rest of the ongoing version of theshader with various connections removed, so it's a mess)

     

    ok via ds default mat.jpg
    1623 x 921 - 228K
    bypassing ds default mat.jpg
    1605 x 941 - 231K
    zip
    zip
    ok via ds default mat.zip
    9K
    Opacity edge blend output.jpg
    1631 x 895 - 224K
    Post edited by 3dcheapskate on
  • 3dcheapskate3dcheapskate Posts: 2,719
    edited June 2022

    Why not try using that Edge Blend to control the three Mix bricks I was using before to try and do what the Poser ColorRamp was doing ?

     

    That's sort of okay-ish I guess ? So I've zipped the DBM and attached that. At least I think I'm now on the right track.

     

    Edit (15th June 2022): I think I'm going to give up on this.

    Colours okayish.jpg
    1643 x 929 - 254K
    zip
    zip
    colours okayish.zip
    8K
    Post edited by 3dcheapskate on
Sign In or Register to comment.