Help with Shadows and Freestyle

Hi everyone. :slight_smile:

I’m pretty new to blender still, but having lots of fun learning it. Right now I’m following an online course and the current project is to design, model and render a robot.

I made a little police sentry type bot I thought up and have been toying around with different fun ways to render it. I have a few different color schemes, and the one I’m working on now is kind of a park ranger type color. My idea for him was to have him render on top of some images of forest or park scenery, and try and have him blend (hah) in. While I’m not going for a photorealistic scene by any means, I had just learned about Freestyle and thought it might look good with the robot.
Anyway, my first render was ok-ish, I placed him where I wanted him, fixed the lighting and Freestyle options, and I had to fake a shadow through Photoshop (very new with that also). My second render on the other hand (I have several park photos I’m gonna try and use) looks much better. For this one I made a rough model of the ground he was floating over, and I had the lighting make a ‘real’ shadow instead of my fakey Photoshop smudge. :stuck_out_tongue:
Here’s the second render, which turned out alright:


Well, on to the issue. I’m currently working on my third and last render for this bot version. I’ve got a similar setup. For this I created a plane as the ground and side “wall” to help with the shadow. At first the Freestyle contours were showing up on the planes despite being set to Shadows Only, but I solved that by adding them to a group and excluding that group from the Freestyle layer. First off, here’s what the planes look like (I included them just to show where they were placed roughly):


Now this is where the problem arises; in order to get the Freestyle layer to look good on my robot, I have to exclude the planes from the render. (That’s the only solution I’ve found so far) If I do so, the robot looks like this:


If I include the planes in the render, despite them not being included in Freestyle, the lines on the robot suddenly become transparent, and I can see the lines I shouldn’t see since the robot is opaque.
I haven’t worked out the lighting yet either as you may have noticed, but that’ll be after I solve this issue. :slight_smile:

Now I’m hoping I can get some advice on this. I’m stumped; my only solutions currently are either to exclude the planes from the render, and getting the Freestyle look, or to include the planes and thus get good looking shadows, but no Freestyle.

Any help? :slight_smile:

Here’s the image where you can see the issue I’m talking about (main post only let me add 3 photos).


I still have no idea why the lines suddenly become visible like that.

A .blend file to look into is much better also for those much more experienced than me with freestyle, i guess :slight_smile:
Sometimes i needed to show only some lines and to do so i used “mark freestyle edges” (ctrl+e) and turned on edge mark on the freestyle line set panel.

Oh, great idea, thanks! :slight_smile: Although I’m not entirely sure if the single .blend file is enough or not. There’s also a .blend1 and .blend2 file in my folder. Is it enough to link the first file only?

Also, yes, I’ve got two Freestyle line options enabled; Contour and Edge Mark, and am using both. It should be the only two I need, as well as being the only two I used on the previous render, which worked fine.

Blend1 and blend2 are backup files; each time you save, blend1 become the lastest version before the one you saved, so the .blend is enough.

Excellent! Thanks again. :slight_smile:

The forum file attachment wouldn’t work, it seems, so I uploaded it onto my Dropbox.

The link to the blender file is here: https://www.dropbox.com/s/qjhdy1xqgoz1onn/Police%20Sentry%20Bot.blend

I have tried the blend you provided, with Blender 2.69 this is the result:


your background image was not present, i used one random; then i simplified the lighting and render without changing freestyle parameters. The lines in the back are ok, not visible…
About some things i changed: are you sure you need 20 samples for the sun? 10 usually are enough, render times are much lower…
The material for the floor: in the shadow panel i changed from: shadow and distance to: shadow only.

Thanks for trying it out. 20 sun samples is just one of those things I haven’t learned much about yet, like I said I’m still a noob so I’m bound to have some wacko stuff going on. There’s more than one option so far that are little more than guesswork on my part to what they actually do. :stuck_out_tongue: Higher samples seemed to give slightly better shadow definition so I went with 20. :slight_smile: Render times weren’t affected, but I suppose they might with more advanced scenes.

Anyway, after playing around with this still I found out that this problem only appears at certain angles, or with certain object light interactions, or something. What I mean is, with my robot at the original spot I get the transparent lines still, but if I move him up a bit (but still within the render view) the lines work fine. My haphazard guess would be that there doesn’t seem to be something wrong with the freestyle options at least, since they work as intended if I move the objects away from one another (or exclude from the render). Still fairly clueless for the most part though…