How to solve shadows in wrong direction?

I have an image in which just under midway on an 8:5 ratio 'canvas' is a horizontal railing which goes all the way across from right to left. The sun position is just right of centre, so the shadow just left of centre is what it would be in real life, but on the right hand side of the image the rail bars' shadows all tilt to the left while left hand bars' shadows all tilt to the right. There's a character approximately centre in the foreground so her shadow angles left as it should do, but in the middle left ground is a small building which has it's shadow angled right (the same directions as the left hand bars) and in the far right background is another building and it's shadow angles left. I have the same problems with other images, particularly those which are landscapes, but there's one in which the sun is dead centre and there are 4 characters evenly spaced across the 'canvas', so the shadows on the left 2 angle slightly right and vice versa on the other side when in real life all 4 would have their shadows going directly straight behind them. I assume the anomaly is caused because the virtual sun can never be the size of the actual sun and the same distance it is from Earth, but is it possible to fix this shadow problem in a render?

Comments

  • JonnyRayJonnyRay Posts: 1,744

    Sunlight in Iray (or a distant light in 3Delight) is cast as if it was so far away that the light rays all hit the scene from the same angle. So if you are only using enviroment lighting and haven't added any other lights, then all the shadows should point the same direction.I think we'd need to see how your lighting and/or environment settings on the Render tab is setup to understand how you're getting shadows in various directions.

  • barbultbarbult Posts: 23,131

    Did you forget to turn off the camera headlamp?

  • FishtalesFishtales Posts: 6,043

    Also check you aren't using a wide angle lens on your camera which would cause some distortion depending on the zoom you have set.

  • Prince WaoPrince Wao Posts: 373

    Thanks for the feedback above folks! I'm rendering in 3DL re the images I have where shadows are noticeably as such when the sun is centre: /////llll\\\\ - but it's mostly on landscape images (not indoor). I'm not using a wide angle lens; Lens Distortion Type is "none"; and Headlamp Mode is Auto. An Off render is the same as Auto, but On has no effect on the shadows. All camera settings are default. On various images I'm using various lightings, some environment defaults but always with extra lighting and often altered diffuse/filter colours. Only the Sun is ever set to produce shadows. Shadow type, intensity, etc, makes no difference, plus I've tried altering numerous other parameters, but all to no avail. In all renders which have the Sun well off to left or right of centre the shadows all go in the same direction, so it's only when the sun is central or just off centre I get the left side shadows angled right and the right angled left.

  • JonnyRayJonnyRay Posts: 1,744

    When you say you have a "sun", do you mean a sphere that is set to emit light?

    Normally in 3Delight, we would use a Distant Light to represent the sunlight on the scene. The position of a Distant Light doesn't matter, only the angle of rotation for how the light is shining on the scene.

  • Prince WaoPrince Wao Posts: 373

    Yes, I'm referring to the primary Distant Light. In most environments the Distant Light is given as "Sun" thus I assumed everyone would know what I mean.

     

  • barbultbarbult Posts: 23,131

    Attach an image to demonstrate the problem you see.

  • JonnyRayJonnyRay Posts: 1,744

    Agreed. I'm confused. In 3Delight, the physical location of a distant light doesn't matter. All that matters are the angles of rotation. You can put all your distant lights at (0, 0, 0) and they will still cast parallel light beams across the entire scene according to the X, Y, and Z rotation. 

  • Prince WaoPrince Wao Posts: 373
    edited June 2018

    I don't think I'm allowed to attach an image as the ones in question are designed for print on HD acrylic and are for sale, or will be once sorted. But an image won't tell you any more than I've already explained.

    If you look at my icon which is just the centerpiece of a wider image there are front rails. In that image the main light which casts shadows - the sun or distant light - is to the right and so all shadows angle to the left correctly. In the image I mentioned above it's the same rails but they're more distant (plus I use another shader on them). When the sun is positioned centrally the shadows on the centre rails are as they should be - l l l l - but the ones on the left begin slant bt degrees to the right [/ / / /] while the shadows on the right slant by degrees to left [\ \ \ \]. As said above a foreground building on the left has its shadow angled right while a distant building on the left has its shadow angled left. I only get this effect when the sun/distant light is centred.

    In 2 images I have which are for sale there a four characters in each. One image has the characters centred and facing forward in the mid-distance so the centred sun creates shadows approximately like this though not as extreme: / / \ \. In the other image the characters are evenly spaced and right in the foreground and the shadows are the same. Re these images the shadows create a dynamic effect and so are fine, but in all landscape images I've tried in which buildings, props and characters are smaller with a central sun the shadows just look wrong as they're / on the left and \ on the right. The solve is easy: change the position of the sun! But Id like to know why it is that I'm getting these oppositely angled shadows.

    Post edited by Prince Wao on
  • JonnyRayJonnyRay Posts: 1,744
    edited June 2018

    Distant Lights in 3Delight don't work that way. 

    When you place a Distant Light, it creates the little 3-arrow icon. The location of that icon does not matter in regards to how the light is actually added to the scene. The light cast and considered by the 3Delight rendering engine is calculated as being from the same angle no matter where the object for the light is located in the scene.

    I can move the light object to the far left, and I still get universal light across the entire scene.

    Heck, you can even move the objet BELOW the scene and as long as the angle of the light doesn't change, it will still cast light (and shadows) in the same direction.

    I suspect if you are not seeing this behavior, then you are not using a Distant Light, but rather a Spotlight or something like that.

    3Delight-DistantLights.png
    1018 x 394 - 24K
    3Delight-DistantLights-2.png
    1018 x 394 - 23K
    3Delight-DistantLights-3.png
    1018 x 589 - 25K
    Post edited by JonnyRay on
  • barbultbarbult Posts: 23,131

    I don't think I'm allowed to attach an image as the ones in question are designed for print on HD acrylic and are for sale, or will be once sorted. But an image won't tell you any more than I've already explained.

    If you look at my icon which is just the centerpiece of a wider image there are front rails. In that image the main light which casts shadows - the sun or distant light - is to the right and so all shadows angle to the left correctly. In the image I mentioned above it's the same rails but they're more distant (plus I use another shader on them). When the sun is positioned centrally the shadows on the centre rails are as they should be - l l l l - but the ones on the left begin slant bt degrees to the right [/ / / /] while the shadows on the right slant by degrees to left [\ \ \ \]. As said above a foreground building on the left has its shadow angled right while a distant building on the left has its shadow angled left. I only get this effect when the sun/distant light is centred.

    In 2 images I have which are for sale there a four characters in each. One image has the characters centred and facing forward in the mid-distance so the centred sun creates shadows approximately like this though not as extreme: / / \ \. In the other image the characters are evenly spaced and right in the foreground and the shadows are the same. Re these images the shadows create a dynamic effect and so are fine, but in all landscape images I've tried in which buildings, props and characters are smaller with a central sun the shadows just look wrong as they're / on the left and \ on the right. The solve is easy: change the position of the sun! But Id like to know why it is that I'm getting these oppositely angled shadows.

    Just make a simplified scene then, with your troublesome lighting and a few cube and cylinder primitives placed where the rails and buildings would be. A picture is worth a thousand words, you know.

  • JonnyRayJonnyRay Posts: 1,744
    barbult said:

    Just make a simplified scene then, with your troublesome lighting and a few cube and cylinder primitives placed where the rails and buildings would be. A picture is worth a thousand words, you know.

    Good idea. :) Also, if you can, zoom out and take a screenshot of the scene from the interface so we can see the objects. 

  • Prince WaoPrince Wao Posts: 373

    I threw this together quickly to demonstrate what I wrote above. I've used Easy Environments Greenlands sky box and default lighting; 2nd-5th arcs from Realistic Grass; size-morphed and shadered Breezeway Balcony, size-morphed Moroccan Courtyard Floor, 2 x size-morphed crates; Genesis 2 and Genesis 1 females. The Sun - the default for Greenlands so definitely not a spotlight - is zero degrees rotated and therefore dead-centred. I've taken shadow softness down to 0 so that the shadows can be clearly seen and as stated above objects on the left cast their shadows right and vice versa. You can see that the centre bar of the railings hides its shadow, then the shadows angle to left and right.

    This is obviously default lighting and so the shadow angles have nothing to do with any other aspects of lighting (headlamp, focal length, etc, etc). In real life the shadows wouldn't be angled to the left on the right and vice versa but would all be at the same angle. When there are more objects across the scene - animals, props, characters - the shadows look even more wrong. In the current scene I'm currently building, the sun aka distant light is Y-rotated just a tad to the right of centre and as a result the differently angled shadows look even more wrong than here - though if I make the Y-rotation more extreme, say 45 degrees, all shadows have the same angle

    I was hoping there was a way of making all shadows angle the same when the Sun is 0 Y-rotation or not far off 0, but I now feel that shadows as in the image are just the default - though I'd love to be proven wrong!

    PS: I've tried other default lighting sets and the shadows are always as in this image.

    Aaawasteoftime.jpg
    1200 x 750 - 538K
  • Prince WaoPrince Wao Posts: 373

    I couldn't find an image with the rails left to right, but in this photo all shadows are parallel.

    fence1.jpg
    183 x 275 - 13K
  • kaotkblisskaotkbliss Posts: 2,914

    In you're example, the shadows are correct because the lighting is coming straight on from behind the camera and so due to perspective, everything looks like it's heading towards the vanishing point (which is straight ahead of the camera on the horizon) When in actuality they are straight.

    It's because of the camera's perspective. It would look this way in the real world too.

  • barbultbarbult Posts: 23,131

    In you're example, the shadows are correct because the lighting is coming straight on from behind the camera and so due to perspective, everything looks like it's heading towards the vanishing point (which is straight ahead of the camera on the horizon) When in actuality they are straight.

    It's because of the camera's perspective. It would look this way in the real world too.

    Yes, it is like the telephone poles appearing to converge at the end of a long road because of perspective. You can turn perspective off on the Daz Studio camera, but that won't give you a very realistic view of things. 

  • FishtalesFishtales Posts: 6,043

    I am just up and was just about to post after reading the thread and I see kaotbliss and barbuilt have mentioned it. I was going to suggest opening the camera settings Cameras/Camera and turn off Perspective. The scene might look a bit weird though :)

  • Prince WaoPrince Wao Posts: 373

    Thanks to all for your responses and patience. It's always much appreciated. As I suspected, the shadows are the default when the Sun is at 0 Y-rotation. As regards the shadows looking the same in the real world, it's true but only at a larger scale. I live in a small market town in the UK with a view over the market square which is very close re the camera height and my distance from people as in the image above, but I'd never see the shadows of people on the left angled right and vice versa. If I go out to close by fields and look at the shadows of trees they would only begin to look / & \ at a far greater distance than say the crates are in the image. Re the image I'm currently working on I'll just have to not have the Sun centred. Once again thanks to all responders!

  • kaotkblisskaotkbliss Posts: 2,914

    If you don't want the shadows in the /|\ pattern, then I'd rotate the distant light on a more extreme angle. Maybe around 60

Sign In or Register to comment.