3Delight Useful Stuff?-Put It Here:)
Sven Dullah
Posts: 7,621
Trivial or advanced...doesn't matter, I feel we need a place to gather all the bits and pieces on how to best use 3DL, so feel free to post your favorite tricks or just ask any questions you have on your mind and we'll hopefully find working solutions together.
A couple of links:
3delight-laboratory-thread-tips-questions-experiments#latest
awe-surface-shader-a-new-physically-plausible-shader-for-daz-studio-and-3delight/p1
the-official-awesurface-test-track#latest
show-us-your-3delight-renders#latest
show-us-more-of-your-3delight-renders#latest
https://sharecg.com/pf/full_uploads.php?pf_user_name=mustakettu
Post edited by Sven Dullah on
Comments
Index:
Setting up caustics in Shader Mixer
Using HDRI:s with UberEnvironment 2, the basics
Create a shadowcatcher in Shader Mixer
Download a custom caustic glass shader
Speed up rendering of hair and transparent stuff
Setting up the ds default shader for a linear workflow
Using emissives, an introduction
Download a SM_Colorize_FogCam subset
DL a Free Volumetric Shader here
About light falloff, a demo
Volumetrics example - using a standard pointlight
How to set up some simple caustics in Shader Mixer:
Here are two quick renders using a shader spotlight, a photon mapping/caustics camera and a mirror plane with a caustic surface. These are the three things you need for the caustics to work.
Used a dFormer to make the mirror slightly concave:
Note: the mirror plane needs to be rather dense if not totally flat. Generally, the denser the mesh the better quality you'll get.
1. Set up the photon mapper cam
Open shadermixer and click on file in the upper left corner, select "create new shader/camera". Find the bricks in the attached screenshot and connect them.
To see the root settings for the caustic light brick you need to click the mini menu in the upper right of that brick and select "show advanced". Click create and head over to the parameters tab, select the camera and adjust the settings as shown here: (these are only guidelines, find your own settings by all means)
Intensity will control the caustic intensity, photon count is simply the number of photons that will be emitted, the more the better at the expense of rendertimes.
2. Set up the shader spotlight.
Create a new shader/light in shadermixer and set it up like this:
And here are the settings used in the renders:
This is a rather simple spot and could surely be improved, but it has physical falloff, soft (blurred) shadows, intensity and light color.
3. Set up a simple caustic surface. (In this case the mirror plane)
In shader mixer create new shader/material. Set it up like this:
The caustic surface goes into root settings, and again, you need to enable "show advanced" in the surface(1) brick. With the mirror (or whatever) selected in the scene tab AND the surface tab, click "apply". Adjust the settings to your liking in the surface tab.
Or you could use a premade caustic surface like the SM chrome shader:
When you add the caustics property to a surface you can choose between a number of photon materials, like chrome, glass, transparent or water, depending on what you try to do.
If you prefer a distant- or pointlight it's possible in theory, however it's much more difficult and takes a lot of fiddling around to make work. The spotlight has much more focused light intensity.
Enjoy!
UberEnvironment2 Basics (how to use HDRIs with UE2)
Load UE2 from your content library, the first icon also loads an environment sphere parented to the UE2 light.
I created a simple test scene, a figure, the UE2 and two spotlights that I set to specular only. Why? Well UE2 only emits diffuse light, so without additional lighting there will be no specular highlights on any surfaces. Here I used two spots for simplicity but you could use a number of distant light from various directions with low intensity specular light. Just remember to enable raytraced shadows, set shadow softness to your liking and set the proper amount of shadow samples in rendersettings. Without raytraced shadows your character can get glowing teeth, gums etc.
Next, here are the rendersettings I used for this test. Most important of all...the gamma settings. If you go for any level of "realism" use gamma correction on and gamma 2.20. Bear in mind that most poser content and also DS 3Delight materials are often in need of tweaking textures gamma settings in the image editor. As a rule of thumb, the diffuse textures should have gamma 0 and all opacity-, bump- etc. controlmaps should have gamma 1!!! (Tip: If you have to use a diffuse map as a substitute for a bumpmap, make a copy of the diffuse map in LIE, rename it and set gamma to 1.)
(For final renders I would probably use 8x8 or 10x10 pixel samples and lower the shading rate to 0.2 or 0.1.)
Load an HDRI in the UE2 Color slot. Here I used the "Green Sanctuary" from HDRI Haven. These are the light settings I used for this particular HDRI.
Saturation controls the emitted light saturation, contrast is obviously affecting diffuse gamma settings, more contrast darkens shady areas and brightens highlights. If you get noisy renders increase occlusion samples, if you get weird artifacts like black banding etc, decrease shading rate. The lower you go the more detailed shading you get at the expense of longer render times. All surfaces outside the radius set by trace distance (in cm) will be ignored by the UE2, thus will not contribute to color bleed/ light bounces/ambient occlusion.
There are several environment modes. The "cheapest" is ambient. It will not produce AO or shadows, only diffuse light using the color of the HDRI. Will render very fast and produce rather flat and dull looking renders. The only modes that support color bleed/bounce light are indirect lighting and of course Bounce Light, that will produce the most realistic results.
To make the HDRI appear in render you need to do the following: Select the environment sphere and enable "visible in render".
Head over to the surface tab and insert the HDRI into diffuse color (for viewport visibility) and ambient color. Also enable "Raytrace" to make the sphere appear in reflective surfaces (eyes, skin with reflections enabled, glass and metals etc.) Turn off "Diffuse active" unless you want it to be lit by additional lights you might want to use in the scene.
The brightness can be controlled by adjusting ambient strength or -color. This will affect all reflective surfaces but not the diffuse light strength from the UE2.
This first testrender uses the "Occlusion with directional shadows" mode, renders pretty fast (7 min) but there is no true bounce light:
Next one is with "Indirect lighting with directional shadows", 27 min. render. You can see there is bounce light if you toggle between the renders.
And same thing with Bounce Light, had to enable progressive mode for this test, still took almost 20 min. to render.
The Bounce Light mode needs slightly different light settings as you can see, so I increased the intensity scale as shown here:
...and re-rendered:
And finally a quick and dirty render with another HDRI:
...and another tip: Don't rotate or alter the environment sphere! If you want to reposition the HDRI you can safely rotate and scale the UE2 light. If you have added spotlights or distant lights parent them to the UE2 before you change the light direction.
A few personal reflections on the UE2: It is really slow if you are going for any kind of realism, but it works, it is free and it can handle HDRIs. On the other hand, it can be pretty fast if you use occlusion with soft shadows or indirect shadows. IBL-Master is much faster, it emits specular light, much more straight forward to work with BUT it cannot produce true color bleed, it is basically a nice light shader that uses good old ambient occlusion and it renders transmapped hair very fast compared to UE2. Soo...aweSurface is the obvious solution for me, it has it all. Many times faster than UE2 in bounce light mode with superior results. And it's also free .
PS I admit I haven't used UE2 for a very long time so no expert in any way, and I've seen some stunning renders by some friends, so yeah it's just a matter of personal preference I guess:)
PPS: Added some links that offer some fixes to the ancient UE2 light direction mismatch issue:
https://www.daz3d.com/forums/discussion/18998/uberenvironment2-ibl-map-axis-is-wrong/p1
https://www.daz3d.com/forums/discussion/28358/uberenvironment2-can-anybody-explain-the-result-of-this-simple-test-ue2-problems-fixes/p1
How to make a shadowcatcher in Shader Mixer:
1. Create a new scene and load a 3DL skydome, just to cover transparent areas (not necessary, just looks nicer;)
2. Create a primitive plane that will work as the shadow catcher! Select it and turn Cast Shadows off in parameters/display. Also select it in the surface tab!
3. Open the shadow mixer pane, it will look something like this:
4. Delete the Default Material brick on the left by clicking the x in the upper right corner! Now you should have this:
5. Insert the shadow catcher brick and the mix brick by double clicking them in the menu on the left!
6. Connect the bricks, as shown in the screenshot by clicking and dragging! Set the color in the surface brick to pure black, and set the layer in the mix brick to a value between 0 and 1, one meaning black shadows and 0 meaning no shadows! With the plane selected in the scene tab AND the surface tab, click apply!
7. Create a light with raytraced shadows and a sphere or whatever to test your shader!
8. Do a testrender and save as a shader preset! If you want, you can go to the surface pane, click the cog wheel for the layer and rename it to shadow strength or something to your own taste!
You can apply the shadow catcher to any object, just like any shader, like a ground plane or floor;)
Download a customised caustics glass shader! I noticed that the caustic glass that is in Content library/Shader Presets/Shader Mixer has some oddities like a 2.50 IoR. Should be 1.52 in my opinion. I also made a few other tweaks. Feel free to improve it by importing it in SM and make your own tweaks;)
Note that the caustic opacity color gets inverted, so for a greenish caustics color set opacity color to red;)
...just testing colored glass-obviously changed the refraction- and caustic opacity colors...
Basic tips about speeding up rendering of complex hair models and transparent surfaces:
Use OmUberSurface shader (your content library/Shader Presets/Omnifreaker/UberSurface) and turn off occlusion if not absolutely essential for your render. Turn off raytracing for the hair cap. Set resolution to base if possible. Reduce ray trace depth in rendersettings to absolute minimum (1 or 2). Use AoA lights if you own them and flag the diffuse or ambient (set the hair diffuse (or ambient-) strength to 99% and in the parameters/light tab for the AoA lights select the option to use alternative samples for all surfaces with a diffuse strength of 99%) on transparent stuff and use a lower (alternative) shadowsample number for them.
Also note that an opacity map should be a mask. This means it should not have shades of grey, only black and white. However in practice most hairmodels use these semitransparent maps that can really slow rendering down. An option is to take the map into an image editor and use a threshold filter to get rid of the grey shades.
How to set up the ds default shader for skin using a linear workflow
This is a simple guide to setting up the ds defaultshader with a linear workflow, which simply means: Go to your rendersettings and turn ON gamma correction and set gamma to 2.20. This will ensure you get the best result out of using 3Delight, no matter lighting or shaders. I would also like to point out that a great deal of the 3Delight materials you get with the purchased products are set up the wrong way!! This is especially true for poser content, but also for brand new products made by vendors that don't use 3Delight themself and have no deeper understanding of the 3Delight renderer. In a linear workflow the rule of thumb is this: Make it a good habit of using the image editor (in DS surface tab) to check the gamma values for controlmaps, especially specular-, opacity- and bumpmaps. Every diffusemap should have a value of 0. This tells DS to automatically apply the right calculations when optimizing the image for rendering. In reality this means the map will get a value of 2.20. If you manually input a smaller value like 2 the result will be a lighter less saturated color. This can be used to lighten up the skin textures if needed. Bear in mind that setting it too low will result in a desaturated washed out texture.
All the controlmaps should have a value of 1! Unfortunately this is not the case with many products. You need to check this and input the proper value manually.
I'll share a scene I made using the default G3F with the default skin converted from the AoA SSS shader to the ds default shader, a simple 3 point light setup using the DS standard spotlights set up with a physically correct light falloff and raytraced shadows, and the UE2 (with ambient occlusion using the default Ruins HDRI) to add some global illumination. It should open without errors, since I only used content included in the starter essentials. Why the ds default shader? Well, it renders very fast and is very robust, so why not?
I'm not going to list everything I did, those of you that are interested can DL the scene and look for yourself. Here are the main points anyway:
1 Selected G3F and all its surfaces and applied the default shader.
2 Selected all skin lips nails and mouth and eye sockets and set lighting model to skin. This will add a simple scatter function and a proper specular model suitable for skin.
3 Checked the gamma settings for the controlmaps and, sure enough, the specular maps had a value of 0, changed them to 1.
4 Moved every specularmap from specular color to specular strength where they belong.
5 Turned off ambient strength for EVERY surface.
6 Set diffuse strength to 100%, skinsurfaces glossiness to 69%, specular color to a light grey, spec. strength to 75%. Note: Every specular map is different, this requires a couple of testrenders and adjustments every time you set up a new skin. If you prefer not to use specular maps you need a much lower specular strength.
7 Adjusted bumpstrength using a camera with DoF enabled. This is because 3Delight only renders heightmaps taking into account the full geometry with DoF ON. If you render without DoF you need to roughly double the bumpstrength to get a similar result.
8 When using the skin lighting model you can access the sheen and scatter channels. I like to load the specular maps in the sheen slot and the diffuse maps in the scatter color slot. If the skin has SS maps you can use those instead. I also tend to set scatter thickness to 1. When setting it up you can testrender with diffuse strength set to 0 to see the scatter effect. The scatter color and saturation obviously depends on if you use maps and how saturated the maps are. So needs adjusting.
Well that's about it...testrender and scenefile attached.
Edit: To make the environment sphere show in render you need to select it and in Parameters/Misc turn on "visible in render". For some reason it reverts back to "visible in render" off when reopended, go figure...
Thank you for such a great tutorial. One noob question - when you talk about checking maps for control values, is that within Daz, or within an image editor?
You're welcome:) Yup in DS, you go to the surface editor tab and click on the little square on the left to open a menu and select image editor. Tks for pointing that out, edited the above post to avoid confusion
Thank you :)
yo Sven,
I've been relegated to lurking in 3D-land, but am seriously enjoying and bookmarking your tips for my pending re-emmersion.
Thanks for your notes and insights. Precious.
--ms
You're very welcome mindsong! I'm 3delighted if someone finds some of the stuff useful:)
An introduction to using emissives in 3Delight (OmUberArealight shader)
Making an object emit light is a simple matter of applying an emissive shader to it. The UberArealight shader is part of the starter essentials so you will find it here:
You apply it just like any other shader by selecting the object and the surface(s) and double clicking the Uber Area light base icon. All the adjusting of color, intensity, quality etc. is done in the surface pane.
A few general notes: Every polygon will be treated as a single emitter. This means the more complex the model is the longer it will take to render. Using a primitive one poly (1 division) plane is the most efficient way by far. Also be aware that the Arealight shader is single sided. It projects light along the direction of the normals. The size of the emitter does not have an impact on light intensity, only on the light- and shadow softness, and of course highlights and reflections. The default settings are rather useless so you will need to tweak them. Emitters can be instanced. Turning on progressive in rendersettings will probably speed up rendering considerably, non progressive will produce the best quality.
The interface:
Diffuse color, Diffuse active, Diffuse strength: If you want the emitter to accept diffuse rays (behave like a normal object that can be lit by other lights) you need to set Diffuse active ON. Diffuse color is where you load your diffuse maps, diffuse strength accepts strength maps (greyscale maps). If you don't need this feature, leave it off to save rendertime.
Opacity: You can use opacity masks if Opacity active is ON. More on that later.
Ambient: This controls the appearance of the emitter in render but has no impact on light intensity. Example...you make a light bulb emissive and want it to glow, turn on ambient and set the color to your liking (preferably same hue as light color). Use diffuse maps in ambient color, grayscale maps for ambient strength.
Fantom: If you want to hide the emitter to the camera (ghostlight) turn it ON. It will still show in reflective surfaces if Raytrace is ON.
Raytrace: To hide the emitter in reflective surfaces, turn it OFF.
Accept shadows: If you want the emitter to accept shadows (emissive floor?) leave it on, normally you want to turn it OFF.
Intensity: This controls the emitted light intensity. 100% won't cut it, it's more like 10000 to 100000. Don't be afraid to add zeroes:)
Color: Controls the light color. You can use diffuse maps here, preferably the same as you use in ambient color. (Firelight etc.) Using a map has a performance hit.
Samples: Controls the shadow quality. The default 8 will look grainy, try minimum 32, probably 64, for very soft light/large emitters maybe more.
Shadows active: Turn it on, simple as that:)
Shadow color: Allows for "artistic" experiments.
Shadow intensity: See Shadow Color!
Shadow Bias: 0.1 should be fine. Setting it too high will give you artifacts, too low will cost you increased rendertimes. Link here.
Falloff Active: For a physically correct falloff turn it on, leave the start and end at 0 and use a falloff decay of 2. The only time you want to turn it off is if you simulate a distant light (sunlight).
Falloff Start: Sets the point (in cm) where the light intensity starts dropping off, using the falloff decay value.
Falloff End: The point (in cm) where the light has dropped to 0 intensity.
Fallof Decay: 2 is physically correct (inverse square root), 1 is linear.
See falloff example renders at the end of this post!
Right...time to present my very artistic test scenario...the DNA Greyling:) Taking place in an enclosed space near you.
Before adding any emissives, here is the scene with only global illumination, to demonstrate the GI intensity used.
So I need to light up this place. I could use the one poly plane but I choose to use a primitive cube with 1 division (six polygons = six emitters). It will act as a pointlight, emitting light in all directions. No Fantom, as I want it to show in render:
After a couple of testrenders I decide to go with these settings: (Intensity = 13000)
As I mentioned in the intro the size of the emitter does not affect light intensity, so I scale it up to see if I like the softer lighting:
Or maybe a tube light would be better...
Perhaps a very small emitter?
Maybe no emitter, only glowing eyes? (same settings as the cube, only changed color, ambient color and intensity = 15000)
And to make the skin emissive I selected the skinsurfaces, applied the arealight base and checked that the diffuse maps were inserted in Diffuse Color. I also loaded them into ambient color and set ambient strength to 150%. Note: you can overexpose the ambient color, need to click the cogwheel in the upper right corner and turn limits OFF.
Note: The arealight shader does not have the full attributes of a regular surface shader (specular, bump, reflections etc.), only diffuse and ambient. If you need more than that, just create a geoshell, copy the surfaces to the shell and make it emissive. Or duplicate the figure, make the copy emissive and hide it with Fantom (consider using a push modifyer to expand the copy). Use the ambient channel on the original figure to give it a glowing appearance.
Now, to demonstrate how to use an opacity mask I created a primitive plane, and added a mirror:
To sum things up a bit, if I turn on Fantom it will be hidden to the camera but still visible in the mirror. To make it completely invisible I also need to disable Raytrace.
So I loaded an opacity mask into the opacity strength slot. I loaded the same mask into Color. Otherwise the reflection will not show the mask, the masked areas will render black in the mirror. Settings:
Intensity is 60000. The more saturated the more intensity needed. Render using 100% ambient strength:
And upping ambient strength to 200%:
The opacity mask I used, unfortunately the forum compression made it look not so good:
...which led me to try making a sunset, so I found myself a suitable skydome, placed and scaled up the emissive plane just inside the dome and adjusted intensity and opacity to let the skydome sun through...
Sun emitter settings: (Intensity 15000, note: falloff OFF simulating a distant light)
To be honest, a standard distant light would render faster and yield a very similar result. But I can see the use of an emissive for a very diffuse outdoor lighting with a very large emitter. Which leads us to the very last render, an indoor scene with a large emitter placed outside the windows to simulate skylight:
...and a tip, use the universal tool with local coordinates to see the normals direction, hint: green arrow:))
Quick testrender:
PS
For realistic use of emitters with 3Delight I would very much recommend you look into using the built in pathtracer and scripted rendering with physically plausible shaders like wowie's AWE Surface. If you have questions about that, feel free to post in my AWE thread (see my signature).
Examples illustrating the light falloff feature: An emitter plane with shadows disabled, the cylinders are pure white and positioned at 100cm, 200cm, 300cm, 400cm and 500cm. No other light sources.
No falloff: (all cylinders equally bright)
Falloff on, decay 2:
Falloff decay 5
Falloff start 100
Falloff start 200
FOS 200 FOE 300 FOD 5
FOS 200 FOE 300 FOD 0.1
FOS 300 FOE 300 FOD 2
An example of how to set up some outdoor lighting using the OmUberarealight shader...
Found an ancient Poser set that was simple enough for this test, just converted the materials to OmUberSurface so I could make use of the blurred reflections feature. Loaded an overcast skydome and applied the Uberarealight shader after flipping the normals using the geometry editor (select all polygons/edit polygons/flip normals). No light falloff, inserted the skydome diffuse map into ambient- and light color and set intensity to 500. Added a primitive plane, applied the arealight shader and placed it just inside the skydome covering the skydome "hotspot". No falloff, white light with an intensity of 1500 and using the opacity mask showed in the above post, made it barely visible. For Global Illumination I just used ambient occlusion and indirect bouncelight at a rather low level. Samples used for both the Uberarealights and occlusion were set to 128. The moose with LAMH fur is using the default settings.
Your thread lives up to its name. If rendering with 3DL, this all looks very useful.
Do you have a YouTube channel where you show your workflow?
Tks for that:)
Unfortunately not, guess I'm not much of a social media guy:) However, feel free to ask anything in here and I'll do my best to iron things out!
+++ on the uber area emmisives info/details. clear and not-too-scary looking - pdf-d and tucked away!
tnx!
--ms
So PWToon seems to have this weird bug where if a figure is wearing an outfit that has a surface named the same as the figure, PWToon gets completely confused and starts mixing up the surfaces.
Like, the pant's Legs surface starts looking fleshy.
Anyone know if there's an easy way around this?
I think this was an issue with the logic in the script - I seem to recall running into it with one of my own. You might try making new, .duf format, shader presets and see if the issue goes away.
... dang it, didn't even occur to me that it wasn't a shader preset. Ha.
I'm also thinking you've told me this before, maybe years ago... you are a treasure, Mr Haseltine!
I had a bright idea (tm) on how to make better use of dForce Hair in 3delight.
First of all, dForce Hair works fine in 3Delight, except that you can't do the texture mapping. But it otherwise works fine.
I thought about that... oh hey!
So, imagine fox fur with, say, 3 defined colors (red, black, white). Ok, take the color map into Photoshop (or whatever), posterize it. Select each color and create a black and white mask, save separately. (so, like, Fur Mask Black, Fur Mask White, Fur Mask Red).
Now go to the texture of, say, Oso Fox. Duplicate the density map a few times (Oso Fox Fur Density Black, Oso Fox Fur Density Red, Oso Fox Fur Density White).
Open those density maps and the mask maps, multiply them.
Now make a scene with Oso Fox, convert to 3delight, duplicate the fox fur twice. Change the names, again, to Fox Fur Black, Fox Fur Red, and rename the original to Fox Fur White (or whatever).
Change the density maps.
Change the colors to the, well, appropriate colors (red, black, white)
Voila!
So it's a bunch of steps but you can now save this as a scene subset for later.
Sample render to come.
(You can also allow for more overlap by blurring the initial posterizing)
Ok, it could be better... ended up postering in FilterForge because Photoshop's posterize leaves a lot to be desired.
If I was going to do it 'well' I'd probably end up making my own color pattern masks instead of trying to extract it from existing colors, but you do you.
Now to make it toony...
Tks for sharing, that's a nice looking fur;)
For reference, as usual I used AoA lights. I DID turn off AO on the ambient light, because past experience suggests it slows to a crawl on things like fur.
Well you could always set the fur diffuse strength to 99% and the ambient light to use alternative samples for flagged surfaces and set alternative samples to 0.
Huh. One thing I've discovered is that, at least with PWToon, dForce Hair looks GREAT if you set it to render line tessellation 1; it keeps most of the interior of fur a bit lighter and cool looking.
For some reason I was under the impression that it needed to be 2 or more.
I'm busy following your Gamma Correction tutorial and my forehead is getting sore. But I'm persevering and I will conquer it.I don't think I'll use Uberenvironment in future but, because it takes foooooooooreeeeeeeever to render...I'm an impatient being. I'm also NOT looking forward to checking all the maps in my Corbie Holler opus as there's thousands...well, multiple hundreds at least.