3Delight Laboratory Thread: tips, questions, experiments

18889919394100

Comments

  • Oso3DOso3D Posts: 14,894

    Wow, that’s impressive!

  • RAMWolffRAMWolff Posts: 10,146

    Now that's amazing! 

  • Oso3DOso3D Posts: 14,894

    Will vector displacement work with free version?

  • wowiewowie Posts: 2,029
    Oso3D said:

    Will vector displacement work with free version?

    Naturally since it's a shader feature. There are some updates to stuff in the commercial pack, but shader features will always be free.

  • wowiewowie Posts: 2,029
    edited January 2019

    Made some progress on iray Uber to AWE Surface conversion. Worked out a script to transfer values and textures over. These are:

    • Metallicity
    • Refraction Index
    • Base Thin Film IOR
    • Translucency Weight
    • Glossy Reflectivity
    • Refraction Weight
    • Refraction Color
    • Refraction Roughness
    • Top Coat IOR/Top Coat Thin Film IOR*
    • Top Coat Weight
    • Top Coat Color*
    • Top Coat Roughness
    • Top Coat Anisotropy
    • SSS Amount
    • Scattering  Measurement Distance
    • SSS Direction
    • Base Bump
    • Cutout Opacity

    Still need to fiddle a bit more on the script.

    For Top Coat IOR/Top Coat Thin Film IOR. AWE Surface uses a single value, so the conversion script have to choose what value is appropriate. If Thin Film is enabled, use the Thin Film IOR, or use the Top Coat IOR otherwise. It's not a big deal. I've actually already written a conditional for Metallicity/Metalness so if it's not zero, it automatically enables 'Use Diffuse Texture'.

    I've also noticed DAZ is using Top Coat IOR as specular/reflectivity input, rather than a coat transmission color. The texture transfers OK, but I need to convert the color data into a single value since Coat Strength is in percent.

    Two things I've forgotten to add dummy fields for are Glossy Color (for the base specular) and Translucency Color, which DAZ uses for Subsurface Color. Should be easy enough to do.

    I've run into one snag so far. The script seems to have trouble importing Glossy Roughness, Glossy Anisotropy to AWE Surface base specular/reflection lobe and Transmission Measurement Distance to Transmission Scale. Haven't figured out what's wrong exactly, so it's still a bit of a puzzle.

    One note though. Although the script should carry over values and textures from iray uber to AWE Surface, values like roughness probably won't exactly match up (unless they're 0 or 1).

    Edit. OK - fixed all the above problems and all values/textures gets passed to their relevant AWE Surface parameters. The script works 100%. Will look into combining it into a .dsa preset.

     

    Post edited by wowie on
  • RAMWolffRAMWolff Posts: 10,146

    Great news wowie.  Conversions are such time savers!  

  • wowiewowie Posts: 2,029
    edited January 2019

    Since the AWE Surface preset is actually a DAZScript file, I'll have a look into combining it and the conversion script. If it works, then the conversion/transfer is automatically executed as you apply the preset.

    Might also be possible to do it for dsDefaultMaterial as well.

    I'll probably keep the old preset and transfer script though and make a new one (if it works).

    Post edited by wowie on
  • RAMWolffRAMWolff Posts: 10,146

    Sounds good!  

  • cain-xcain-x Posts: 161

    This may be a stretch but is there a way for DAZ Studio to export an animated RIB file (single file with all of the animated frames within)? This would make this whole process so much easier than using the built in render queuing in DAZ and I can offload rendering to other nodes. Currently I achieve the above using DAZ Script to output a RIB file for every frame - its clunky but it works.

  • Mustakettu85Mustakettu85 Posts: 2,933
    ffzero58 said:

    This may be a stretch but is there a way for DAZ Studio to export an animated RIB file (single file with all of the animated frames within)? This would make this whole process so much easier than using the built in render queuing in DAZ and I can offload rendering to other nodes. Currently I achieve the above using DAZ Script to output a RIB file for every frame - its clunky but it works.

    Welcome to the club =)

    A script hack to export a RIB per frame is what I ended up doing, too (and the path to making it work is prone to invoking some of the most mysterious DS bugs that no tech support will help solve). 

    The problem is that neither dzRenderer nor dzScriptedRenderer classes have methods that would correspond to RiFrameBegin/End. Either an oversight... or a deliberate restriction. 

  • Mr_FreemanMr_Freeman Posts: 8
    edited January 2019

    Hi. When AWE surfase was released i've returned to experiments with 3Delight, after a while start looking for a Good distant light source and remembered about Mustakettu's "Physical Sun" light. Tried to compile it follow by instruction, but result always same: ERROR: undefined variable "raytrace". what am i doing wrong? Could you help, please?

    error_msg.png
    449 x 130 - 6K
    Post edited by Mr_Freeman on
  • Sven DullahSven Dullah Posts: 7,621
    edited January 2019

    Hi. When AWE surfase was released i've returned to experiments with 3Delight, after a while start looking for a Good distant light source and remembered about Mustakettu's "Physical Sun" light. Tried to compile it follow by instruction, but result always same: ERROR: undefined variable "raytrace". what am i doing wrong? Could you help, please?

    Sorry can't help with that specific issue, but it's pretty easy to set up a sun using omnifreaker's light disc prop and applying the awe arealight to it. You need to position it way off center of the scene and fiddling with temperature, light intensity and possibly decreasing the fall off to a number near 0. Also the size of the disc will affect intensity. And the larger the disc the softer the shadows;)

    You can of course use any primitive plane, but a square emitter may give you square highlights.

    Or use a standard distant light, is not optimized for awe though, so will cause longer rendertimes.

    Post edited by Sven Dullah on
  • Thank you Sven Dullah, i'll try it. But i still want to solve issue i wrote about.

  • wowiewowie Posts: 2,029
    edited January 2019

    Hi. When AWE surfase was released i've returned to experiments with 3Delight, after a while start looking for a Good distant light source and remembered about Mustakettu's "Physical Sun" light. Tried to compile it follow by instruction, but result always same: ERROR: undefined variable "raytrace". what am i doing wrong? Could you help, please?

    I did played around with importing the Physical Sun shader like kettu. I have to look for it though.

    That error is Shader Builder is descriptive enough if you understand RSL. Best way I found to load up the Shader Builder project and go to the 'Light/Surface Code' tab.

    Once there, select all the code and paste it into a text editor with line number info ie Notepad++ for Windows. The error code mentions line 132, so that's where you should look. Looking up the actual physicalsun.sl from 3DSP package, "raytrace" is used for the shadow () call with the distant light. I think it should compile if you just paste "raytrace" directly into the shadow call.

    Rather than:

    color shad = 0;if( i_shadowmap!="" && i_shadow_samples>0 )	shad = shadow(		i_shadowmap, Ps,		"samples", i_shadow_samples,		"blur", i_shadow_softness );

    Edit it so it looks like

    color shad = 0;// if( i_shadowmap!="" && i_shadow_samples>0 )    shad = shadow(        "raytrace", Ps,        "samples", i_shadow_samples,        "blur", i_shadow_softness );

    It does mean shadows will always be rendered and raytraced though.

    Shader Builder.jpg
    835 x 628 - 99K
    Post edited by wowie on
  • Thank you Wowie, RSL to me is chinese grammar. I did as you said. Error message is gone, but appears another issue - light don't work. Tried remove // (double slash) from new code - error message returns.

  • wowiewowie Posts: 2,029

    Got this to work.

    Not quite there yet, but it looks more promising than yesterday. The key was doing proper Fresnel, which you can't do with just out of the box stuff. After that, just need to trace refraction rays per wavelength, with each wavelength using the appropriate Sellmeier values. Basically the same way done in any other renderer. Right now, the problem is that I'm still using sRGB, so there's visible separation between the color bands.

    I can do the 'fake approximation' by slightly adding blur to the second loop or do the proper tihng and do it in spectral color space.

    I haven't yet decided how to present the feature in AWE Surface. Easiest way would just be IOR spread, which is the offset depending on wavelength. People seems to like abbe more though, which is more commonly used in other renderers (Arnold, Redshift. Vray). We'll see what happens.

  • wowiewowie Posts: 2,029

    Thank you Wowie, RSL to me is chinese grammar. I did as you said. Error message is gone, but appears another issue - light don't work. Tried remove // (double slash) from new code - error message returns.

    Turns out I had it in my Shader Builder project folder all this time. Silly me. Uploaded my version of 3delight physical sun to my Google drive folder.

    Physical Sun.zip - https://drive.google.com/open?id=14ZGP0mYz7ipoHdTJu18xrxa3sT5ZEzIA

    Inside the archive, you should see the Shader Builder file (.dzs), the RSL source file (.sl) and the scene subset to load the compiled version of the light (.duf).

  • Mustakettu85Mustakettu85 Posts: 2,933

    Hi. When AWE surfase was released i've returned to experiments with 3Delight, after a while start looking for a Good distant light source and remembered about Mustakettu's "Physical Sun" light. Tried to compile it follow by instruction, but result always same: ERROR: undefined variable "raytrace". what am i doing wrong? Could you help, please?

    In all honesty, a) the light is not even mine, it's a port of an old Jupiter Jazz light included with pre-13 3Delight builds; b) if you have my old blogpost, you should see it requires some editing to match the DS coordinate system; c) the colour it provides is nice, but it's still a distant light! Which means it will eat at performance. Try using proper quality outdoor HDRIs as environments for the best performance with aweSurface.

  • Mr_FreemanMr_Freeman Posts: 8
    edited January 2019

    In all honesty, a) the light is not even mine, it's a port of an old Jupiter Jazz light included with pre-13 3Delight builds; b) if you have my old blogpost, you should see it requires some editing to match the DS coordinate system; c) the colour it provides is nice, but it's still a distant light! Which means it will eat at performance. Try using proper quality outdoor HDRIs as environments for the best performance with aweSurface.

    Got it. Kettu, thank you for detailed explanation.

    wowie said:

    Turns out I had it in my Shader Builder project folder all this time. Silly me. Uploaded my version of 3delight physical sun to my Google drive folder.

    Physical Sun.zip - https://drive.google.com/open?id=14ZGP0mYz7ipoHdTJu18xrxa3sT5ZEzIA

    Inside the archive, you should see the Shader Builder file (.dzs), the RSL source file (.sl) and the scene subset to load the compiled version of the light (.duf).

    Wowie, thank you. After installing these files, firstly i ran .duf subset and got black scene (and no lights are working before restart DS). After restart DS, used create new light from Shader Builder tab, then all worked. Test render with light:

     

    test02.jpg
    800 x 1200 - 707K
    Post edited by Mr_Freeman on
  • wowiewowie Posts: 2,029

    Wowie, thank you. After installing these files, firstly i ran .duf subset and got black scene (and no lights are working before restart DS). After restart DS, used create new light from Shader Builder tab, then all worked. Test render with light:

    Ah yes. I forgot to mention that you need to build the shader first before loading the .duf. Otherwise, the .duf simply loads a light with no compiled shader. Hence, no light. Once you've compiled it, you should be able to use the .duf to load the light, instead of calling up Shader Builder.

  • Hmm.. strange. I did "save network"+"compile shader" before i ran .duf. Oh, nevermind. "Create new light" works, it's enough for me. Today i tried to put "rendertime script block" with  Shader.setStringAttrib( "light", "emitphotons", "on");   , like it was in Kettu's tutorial. But didn't see a difference.. yet.

  • wowiewowie Posts: 2,029
    edited January 2019

    Hmm.. strange. I did "save network"+"compile shader" before i ran .duf. Oh, nevermind. "Create new light" works, it's enough for me. Today i tried to put "rendertime script block" with  Shader.setStringAttrib( "light", "emitphotons", "on");   , like it was in Kettu's tutorial. But didn't see a difference.. yet.

    That is needed for caustics, but if I recall correctly, the shader needs to have photon map support. I don't think it will do anything with the publicly available shaders.

    I haven't played with photon map/caustics succesfully though, so kettu will likely be able to provide a better answer.

    Post edited by wowie on
  • Hmm.. strange. I did "save network"+"compile shader" before i ran .duf. Oh, nevermind. "Create new light" works, it's enough for me. Today i tried to put "rendertime script block" with  Shader.setStringAttrib( "light", "emitphotons", "on");   , like it was in Kettu's tutorial. But didn't see a difference.. yet.

    Caustics needs two extra steps: invoking the photon hider to actually generate photons and using a "caustic light" to have them affect surfaces. 

    Theoretically, shader mixer can be used to make a "photon camera" - but shader mixer is shader mixer. It's buggy as hell. On my machines, it plain out refuses to be even remotely reliable. *rolls eyes*

    Calling the photon hider via a render script is super reliable, on the other hand. There's a mega monster evil render script I have in the works - unless other DS bugs stand in my way, it should provide toggle-able options of invoking the photon hider and/or rendering to a proper linear HDR image (EXR) for tonemapping in whatever software you have. And some other advanced bits exposed. And then I'll bundle a precompiled "caustic light" with it. It will be a freebie, so you'll need to install it manually, like the free aweSurface package.

    It's possible to just have different scripts for all these purposes, like I've had for years - but many users appear to be getting confused enough when using scripted rendering (it's pretty new for a lot of people), so I want to provide one script to rule them all, erm, well you get the drift. 

    Oh, and a preliminary warning: photon generation is not necessarily instantaneous. =)

     

  • wowiewowie Posts: 2,029
    edited March 2019

    Thanks Kettu. Finally got Russian roulette working with this.

    Path traced, physically based, Marschner hair in 3delight and DAZ Studio. Originally by Mustakettu for curve/strand based hair, mixed with my own code. Been adding support for poly hair and melanin/melanin redness (eumelanin/pheomelanin). So if you want to ditch hair maps completely, this shader will render hair with realistic shades. Should work really well with strand based hair though I haven't tested it yet. laughI'm kinda surprised it works well even with scalp geo.

    Still needs further testing, obviously. Next on the feature list is root to tip ramp, hair dye, randomization options, plus maybe a coat and diffuse layer. Render times are lower ( 9 minutes 17.61 seconds with 512 samples) compared to AWE Surface (13 minutes 59.28 seconds at 128 samples with translucency and subsurface enabled on poly hair), but have much less noise. It's not fully optimized yet since I haven't figured out how to properly optimize the hair BRDF.

    Since it's using 3delight's built in hair BRDF, there's only one sample setting, which makes it much easier to troubleshoot noise/control render quality. Plus, it should work regardless of normals, so there's no Use Face Forward trickery and you always have translucency.

    aweHair1.jpg
    400 x 600 - 116K
    aweHair2.jpg
    400 x 600 - 101K
    Post edited by wowie on
  • RAMWolffRAMWolff Posts: 10,146

    Looks really good.  Keep going! 

  • Sven DullahSven Dullah Posts: 7,621
    wowie said:

    Thanks Kettu. Finally got Russian roulette working with this.

    Path traced, physically based, Marschner hair in 3delight and DAZ Studio. Originally by Mustakettu for curve/strand based hair, mixed with my own code. Been adding support for poly hair and melanin/melanin redness (eumelanin/pheomelanin). So if you want to ditch hair maps completely, this shader will render hair with realistic shades. Should work really well with strand based hair though I haven't tested it yet. laughI'm kinda surprised it works well even with scalp geo.

    Still needs further testing, obviously. Next on the feature list is root to tip ramp, hair dye, randomization options, plus maybe a coat and diffuse layer. Render times are lower ( 9 minutes 17.61 seconds with 512 samples) compared to AWE Surface (13 minutes 59.28 seconds at 128 samples with translucency and subsurface enabled on poly hair), but have much less noise. It's not fully optimized yet since I haven't figured out how to properly optimize the hair BRDF.

    Since it's using 3delight's built in hair BRDF, there's only one sample setting, which makes it much easier to troubleshoot noise/control render quality. Plus, it should work regardless of normals, so there's no Use Face Forward trickery and you always have translucency.

    Wow, I NEED thislaugh

  • Ditto!  That has a really wonderful quality to it!

    wowie said:
     

    Wow, I NEED thislaugh

     

  • wowiewowie Posts: 2,029

    Still pretty much a work in progress. So, the final shader probably will look very different. Just finished adding toggleable root to tip gradient, with offset/curve controls. Hair dye is in, though I haven't enabled/tested it yet.

    When the ramp isn't enabled, the eumelanin/pheomelanin is constant along the hair strand. When it's enabled, you can vary the amount from root to tip. I plan to have some randomness per strand and maybe along the strand, but probably not going to do 100% random.

    Seems like I couldn't find any shader examples with separate highlight controls. Might be a good idea to add adding that, either via the hair dye controls or melanin controls. Probably both since they're both plausible options for hair. Obviously, you'll need a mask or a surface zone to use that on poly hair. Not sure how to do that with strand/curve based hair.

  • GoneGone Posts: 833

    If, by strand hair, you mean Garibaldi - it uses the marschner shader by default. The R and TRT values perform the highlighting.

  • wowiewowie Posts: 2,029
    Gone said:

    If, by strand hair, you mean Garibaldi - it uses the marschner shader by default. The R and TRT values perform the highlighting.

    Hi Gone, yes Garibaldi is one of them. The other being LAMH. I only have Garibaldi though (bought it) and I have the LAMH player. Just haven't had the chance to test it out.

    I don't know about LAMH, but one of the things I don't like about Garibaldi hair is you need to restart renders when tweaking shader settings. So I'm putting off working with curve based hair until really necessary and all the shader elements are in place and I know how they all fit.

Sign In or Register to comment.