The (Mar)Graveyard

margravemargrave Posts: 1,822

Now that I've hit the big 1,000 (posts), I figured it's about time to start one of those Art Studio threads all the content creators have these days.

Feel free to leave feedback.

First up, I call this "Corridor Run".


Comments

  • WinterMoonWinterMoon Posts: 1,970

    Congratulations on rounding 1000 posts! That's most definitely time to start a thread. I think I had like 11 posts when I started mine, but that's just me.

    Is Aiko hunting someone or something in that corridor? I like her expression, she looks rather dangerous!

  • margravemargrave Posts: 1,822

    WinterMoon said:

    Congratulations on rounding 1000 posts! That's most definitely time to start a thread. I think I had like 11 posts when I started mine, but that's just me.

    Is Aiko hunting someone or something in that corridor? I like her expression, she looks rather dangerous!

    lol Thanks.

    I have no idea what she's doing there. Just looking cool, I guess. Shame they never made an HD Add-On for her.

  • margravemargrave Posts: 1,822
    edited August 2021

    Posted this one in "Show Us Your Iray Renders" a while back.

    It was made with the fog shader I created in https://www.daz3d.com/forums/discussion/505581/the-shader-mixer-deciphered-blender-to-daz-conversion

    In Search of Documentation: The Daz Experience


    f5ea92c6601ef2802b47f26ebfb7a5.png
    1200 x 1800 - 3M
    Post edited by margrave on
  • margravemargrave Posts: 1,822
    edited September 2021

    A tutorial on how to create low-poly figures for crowd scenes with Blender.

    This is a quick test I did using Genesis 3, Peasant Outfit, and Morley Hair.

    1. Pose your figure in Daz, put clothes and hair on, etc.
    2. Export figure as OBJ and check the option to export as separate objects. Make sure to write out the surfaces and UVs too, but don't bother with the texture maps themselves.
    3. Import into Blender and apply the Decimate modifier to each of the individual objects. Decimate works on a per-object basis; ideally we want finer control over the hair (215k) than the shirt (13k), though in this case I just used "Collapse" at 0.1 for everything. This reduced the total vertex count to 55k, which is one-fourth the poly count of Morley Hair alone. You can also try using "Planar" for hair, since it collapses connected faces based on the angle between them (perfect for hair cards).
    4. Use Blender's Clean Up features to tidy things up, such as deleting vertices and edges in the hair that no longer have faces.
    5. If you see any intersecting meshes, just quickly use proportional editing or sculpting to drag it out. For expediency, I didn't do that in this test. You could also just delete the parts of the mesh hidden by clothes. You'll probably want to delete the hair cap too, or else you can just set the surface transparent in Daz Studio.
    6. Export the figure as one big OBJ and re-import it into Daz Studio. Again, make sure the surfaces and UVs are written out.
    7. Re-apply the materials using the material presents from each product. Since material presets in Daz appear to be name-based, as long as you kept the names intact while exporting and importing they should work perfectly.
    8. If the figure looks too flat-shaded, fiddle with the geometry smoothing options at the very bottom of the surfaces.

    Obviously, you can control the strength of the decimation based on how far the figure will be from the camera. 

    Rendering tips:

    • Make judicious use of depth of field to hide decimation flaws.
    • Use Scene Optimizer to reduce the texture size further, if necessary.
    • VRAM is consumed based on texture maps used; reuse maps between figures to save memory.
    DecimateTest.png
    845 x 845 - 2M
    Post edited by margrave on
  • margravemargrave Posts: 1,822
    edited October 2021

    The Lighting Tutorial

    So I've helped quite a few newbies with lighting questions, but it seems like the same questions keep popping up. Rather than create another tutorial in a thread that will get promptly buried once the original question is answered, I figured I should put my dusty Art Studio thread to use and write down everything you need to know about lighting in Iray.

    For this tutorial, the lovely Aiko 8 has volunteered to be our guinea pig the subject.


    The Basics

    Daz Studio has four kinds of lights (that matter): point light, spotlight, HDRI, and emissive surfaces. Distant lights create a strongly directional light coming from an infinitely far distance, a la the sun, but I have never used one since HDRIs do everything they can, and better.

    Now, Iray is a physically-based rendering (PBR) engine. That means it's designed to emulate how light really works. Light shoots out from a light source until it hits something, and energy is either reflected or absorbed in different wavelengths depending on the object's composition. Those reflected light rays continue to bounce around and hit more surfaces, until it's all absorbed. Some surfaces (like mirrors) don't absorb any light at all, thus we get a perfect copy of the light going into the surface. For most objects though, the microfacets on their surface will cause the light to scatter in many different directions relative to the angle they hit the object at.

    This is why PBR materials have between three and seven separate maps. The albedo/base color and roughness or specular maps (and optionally the metallicity map for metals) work together to tell Iray what "wavelength" (i.e. color) the surface is and how much the light rays should be scattered when it hits. Normal maps and bump maps provide additional data about the surface microfacets that would catch the light, so it doesn't have to be modelled onto the mesh and eat up precious memory. Subsurface Scattering is an additional map that tells Iray how far into a semi-transparent surface (like human skin) the light should penetrate. And lastly, there's opacity maps, which just tell the rays whether they can pass through a surface and how much energy they should lose.

    Long story short, Iray shoots out light rays that bounce off surfaces according to their texture maps. That is the principle behind how PBR engines work. And it all starts with a light source.


    Aiko is scared of the dark, so let's put some light in the scene.

    For our demonstration, we'll use a spotlight since it has the most options to play with.

    First, I went into the render settings pane, and into the Environment. At the top, there are four options: "Dome and Scene", "Dome Only", "Sun-Sky Only", and "Scene Only". Dome refers to an HDRI, a combination backdrop picture/light source that surrounds your scene from infinitely far away. Scene refers to your scene tree, and all the physical lights you've added. Sun-Sky is a special HDRI that comes built in with Iray. It models the sun and the sky as accurately as possible, but it's a bit boring to look at since there's no clouds or landscape.

    You may be asking "Where's Sun-Sky and Scene" or "Where's Sun-Sky and Dome"?

    Sun-Sky is already a dome, so you can't have both. You have to pick one or the other. Related to this, if you choose "Dome and Scene" and remove the HDRI file by clicking the thumbnail, it will revert to Sun-Sky mode. That way, you can use both the Sun-Sky and your scene lights.

    We only want to deal with scene lights right now, so we'll set it to "Scene Only".

    I created a spotlight about 150 units away from Aiko, aimed it at her face, then orbited it around until it's just to the right of the camera.

    Now, since Iray mimics real light, we should be able to use physically-based values, right? Let's give it a shot. We're going to use this Amazon product as our reference point. Lights in Iray are measured in Luminous flux (Lumen). If we do a bit of research, we see that fluourescent lights have 60 lumens per Watt. The lights in that product are 95 Watts. So, by doing some simple math, we arrive at 5,700 lumens. So let's plug that into our light's properties, all the way down at the bottom. We can also read that the bulbs are 6,500K in temperature, but that's the Iray default so we can leave that as is.

    If we return to the Amazon product, we next see the softboxes (those big things you put over the light to make it softer) are 20x28 inches. Now, in Iray, the bigger a light is, the more the light rays are spread out across its surface. This results in more even, diffuse light and softer shadows. So, in the light's properties, let's change its geometry to a rectangle and its size to 72x50 (since Daz uses centimeters for units).

    Let's give it a render, and hopefully Aiko won't be scared anymore.


    Hmm. That's...quite a bit darker than we were expecting from a studio setup.

    Not to fear, though!

    As long as we're sticking to real life values, we can also use Daz's tonemapper. The tonemapper emulates the exposure triangle settings available on real cameras. The three settings we'll focus on are the Shutter Speed (how long the shutter is open for), the F-Stop (how wide the shutter opens), and the ISO (how sensitive the film stock is). We'll leave our ISO at 100; the lower that number is, the less grainy (in theory--Iray doesn't have grain, but just pretend is does) the photo will be. We'll set our shutter speed at 100 to minimize shaking from the cameraman's hand (pretend!) too. All that's left is the aperture/F-Stop. In reality, this value determines how much depth of field there is. A wide aperture (1.4) has an extremely shallow depth of field while a narrow aperture (22.0) has an extremely wide depth of field. However, in Iray, you can set those two F-Stop values separately, so it doesn't really matter. But, as long as we're pretending, let's aim for the middle-of-the-road option to strike a good balance between DOF and brightness. We'll put it at 5.6.

    That still looks way too low for a studio light. What the heck is going on here?


    The answer is that Iray is supposedly physically accurate, but that's not entirely true. Its light values are always at a fraction of their physically accurate value.

    The solution lies in the tonemapper's cm^2 Factor slider.

    This one slider will amplify all the light levels in your scene at once. Let's try setting it to 10 and see what happens.

    *Chef kiss*


    The Grand Outdoors

    Now, does that mean 10 is the correct setting? Well...it depends.

    The image above was taken using the Sunny 16 rule: Shutter Speed at 125, F-Stop at 16, ISO at 200. The environment was set to "Dome Only", so our spotlight has no effect on Aiko. But even though it's supposed to be a bright sunny day, it's still too dark for her liking.

    However, when we bump cm^2 to 10, now the image is way too bright. Sunny 16 is supposed to be a catch-all rule of thumb for taking great pics in sunlight, so something's not right here.

    See, for whatever reason, most HDRIs are loaded in with their environment value set at 2.0 by default. Setting the cm^2 Factor to 10 when using an HDRI usually results in an image that's waaay too bright. So you either have to set the Environment scalar down to 1.0, or set your cm^2 Factor to 5 instead (since 5 x 2 = 10, this effectively brings you to the same value). It depends on: whether you're using an HDRI; whether you're supplementing it with scene lights (since those will also be affected by the cm^2 Factor scalar); and whether the PA you buy it from attempted to compensate for Iray's bugged cm^2 handling and ended up using "incorrect" values.  Either way, the resulting pictures from those two techniques look pretty much (if not exactly) the same. But this will matter a great deal if you're using scene lights, because one of these two options will halve their lumens value and the other won't.

    Now, lets change our environment type back to Scene Only and restore our tonemapper to 100/5.6/100 so we can look at the spotlight's other options (that I actually use, and know what they do), shall we?


    The Other Settings

    Spread Angle: Changes the width of the light beam. The lower the angle, the more the light rays are concentrated in the center. That means your subject is brighter, but also has a higher chance of being blown out with specular highlights and noise.

    Above: Angle at 10 (narrow).

    Above: Angle at 100 (wide).


    Beam Exponent: Controls how much of a gradient the spotlight has.

    Above: Exponent set to 1.0. The light is evenly spread across the surface of the spotlight.

    Above: Exponent set to 100.0. The beam is tightly focused in the center. At this point, it resembles a circular gradient in Photoshop. You can see this if you look at your light in Iray preview mode.

    Warning: using a low spread angle and a high beam exponent together may make your monitor burst into flames from all those hot pixels.


    Light Geometry: There are four options you can use for your spotlight's geometry, and they're all pretty self-explanatory.

    There's also Point, but that's never an option.

    Point will make all your light rays come from one infinitely small point in space, which makes for unnaturally hard shadows. If your SubD is set to 0, you'll see ugly jagged shadows on your figure, called the Shadow Terminator.

    Generally, you pick the geometry that matches the light you're mimicking. If you're mimicking a softbox (as we are), pick rectangle. If you're mimicking a regular floodlight, pick disc.If you're using a point light (which shines light in every direction at once), pick sphere. If you're mimicking a fluourescent bulb, pick cylinder and make the height really small and the width really big.

    Incidentally, the width option only works for rectangles and cylinders. For spheres and discs, it does absolutely nothing. Neither the height nor the width work with point geometry, but I already told you not to use that, didn't I?


    Light Portal: If you're using an HDRI and you're indoors (your scene, I mean, not you in real life), you can use a rectangular spotlight to let outside light in without having to calculate it passing through windows, etc. It's a cheat to make renders faster. You just position the spotlight where a window is, or should be, and click this toggle to punch a hole in reality.


    Render Emitter: All lights inside Iray exist as physical geometry. See the images in the beam exponent section above. If you click this toggle, you can make them invisible.

    Note, however, that the lights still exist in your scene. They will still create shadows when they block another light source, and they will still appear in reflective surfaces.

    Some people use mesh lights (3D objects with emissive surfaces and low opacity) to get around this.


    Temperature: As we discussed previously, the temperature of our lights is 6,500 Kelvins. In films, they would use different kinds of lights with different temperatures depending on whether they were shooting indoors or outdoors. While you can adjust your lighting depending on whether you're trying to shoot indoors or outdoors, we can also use this to get a particular effect. If our temperature is low, our light will resemble firelight. If our temperature is high, our light will resemble harsh UV light.

    Above: 3000K, 6000K, 9000K.


    The Big Picture

    So now that you've had all that dumped on you, you may be asking yourself what you can do with this knowledge?

    If you're making a portrait (we went to all the trouble of mimicking portrait lights, after all), then you want to use something called 3-point lighting. The light rays will hit our subject from three separate points around it. With that much light, Aiko should feel nice and comfortable.

    Above: The key light. This is basically what we've been using all this time. You want it to hit the subject at an angle, but not too much of an angle. Maybe 15-30 degrees off-center. Ideally, it should cover most of their face. This is the key to defining their features.

    Also notice the reflection of the spotlight in her eyes. That's good, we want that. Those're called eye lights and they help give the subject some soul. Even in animation, which doesn't use studio lighting at all, they will purposefully draw eye lights into characters' eyes to make them feel more alive.

    Above: The fill light. This light should be at a right angle to the key light's beam. Since the fill light covers the face at an angle, it doesn't contribute much to the final image, but it does help fill the areas that the key can't hit with light, reducing unwanted shadows on the face.

    Above: The rim light. This light shines down from above, creating a soft, halo-like glow on the hair and shoulders. This rim of light helps separate the subject from the background and define their shape.

    Now, when we put them all together, we get a bright, evenly-lit Aiko. She's not scared of the dark anymore!

    But the cool thing is, once you get the basics down, you can start playing with lights in fun and interesting ways. Take another look at the picture with only the fill light. It's terrible for a portrait, but doesn't it look moody and mysterious? If she was meeting somebody in an abandoned building, using a single light off to the side would be perfect. And if we turn the temperature down, it'd look like she was meeting somebody at night over a post-apocalyptic barrel fire.

    Using light and shadow to craft the mood of your scene is the essence of effective lighting.


    Putting It All Together

    Aiko's had a long day, and she wants to go home now.

    Only problem is, after all our lighting shenanigans, her home (iVSD Summer Dreams) looks way too bright with our adjusted, physically-accurate tonemapper settings!

    While our tonemapper is accurate to real cameras and the three-point lighting setup we created, if we adjust it to match this set, which was probably created with Iray's wonky light handling in mind, it'll be way off. So, what do we do?

    And the answer is...

    It depends.

    It is 100% dependent on how the set was designed, what the surface settings are like, whether the PA grouped all their lights together in the scene tree, etc. etc.

    The simplest way to handle environment lighting is to right-click the environement's root node and select all its children. Then go to the Surfaces pane, select "All", and type "Lumin" into the search bar to filter out non-emissive surfaces.

    To adjust use physically-based values, you can set the Luminance Units to "lm" (No, I don't know why "lumens" is abbreviated here but spelled out elsewhere) or you can set it to "W", which stands for wattage. Wattage will enable a Luminous Efficacy slider. That's why we only typed out "Lumin" and not the full word, so we don't filter it out by mistake (as I did, until I realized the thing even existed). Luminous Efficacy is just a scalar that multiples the Luminance value. Just plug the lumens per watt from that webpage we visited alllll the way at the beginning of this tutorial into there.

    In this case, though, I decided to just use lumens directly.

    Since I already had the tonemapping and three-point lighting set up, to save time I decided I'd just adjust the emissives until they looked good, rather than going for physical accuracy. I put them at 6,000 because I liked the way the lamplight splashed on the wall. Any brighter and it started to look ugly and overblown, like in our original image.

    Next, I brought the three-point lighting setup back. Though I intended to keep the settings the same, in the end I decided the portrait setup was too bright for a cozy domestic scene, so I dialed both the lumens and the temperature back to 4,000 to match the environment better. While it's good to start with physically-based values whenever possible, you can cheat a little if you need to.

    A lot of areas outside the camera's view were still quite dark, but if the camera doesn't see it, then it doesn't matter. If I were making more renders in this environment, I'd probably go about it a different way--like increasing the tonemapper settings to get a better overall light level, along with adjusting the emissives to control the way they splash on the walls, or maybe using point lights for ambience. But since I'm not doing anything else with this scene, it really doesn't matter. There's a million different ways to light a scene, as long as you understand the fundamentals. Obviously the longer you spend tweaking it, the better it'll look, but we all need to call it a day sometime.

    At the end, I got this nice, cozy little image of Aiko at home, getting ready for bed.

    Say goodnight, Aiko.

    "Goodnight, Aiko."

    That's all, folks!

    lighting1.png
    1396 x 855 - 575K
    lighting2.png
    422 x 845 - 1M
    lighting3.png
    422 x 845 - 1M
    lighting4.png
    422 x 845 - 1M
    lighting5.png
    422 x 845 - 2M
    lighting6.png
    422 x 845 - 2M
    lighting7.png
    422 x 845 - 2M
    lighting8.png
    422 x 845 - 1M
    lighting9.png
    422 x 845 - 1M
    lighting10.png
    439 x 845 - 253K
    lighting11a.png
    439 x 845 - 249K
    lighting11b.png
    422 x 845 - 1M
    lighting12.png
    1266 x 845 - 1M
    lighting13.png
    422 x 845 - 1M
    lighting14.png
    422 x 845 - 1M
    lighting15.png
    422 x 845 - 899K
    lighting16.png
    422 x 845 - 1M
    lighting17.png
    422 x 845 - 2M
    lighting18.png
    422 x 845 - 2M
    lighting19.png
    422 x 845 - 2M
    lighting20.png
    422 x 845 - 2M
    Post edited by margrave on
  • The lighting tutorial was very helpful and thank you for putting it together. I've bookmarked this for future reference :)

  • MollytabbyMollytabby Posts: 1,163

    Thank you, this is really useful. Also bookmarking this to go back to when working on scenes.

Sign In or Register to comment.