Source Filmmaker

Source Filmmaker

34 ratings
Rendering Ambient Occlusion WITH an Intel HD Chipset!
By Clearwater
Want to be able to render Ambient Occlusion in your pictures, yet only have an Intel HD integrated chipset? This guide will show you how!
   
Award
Favorite
Favorited
Unfavorite
Introduction
If you're reading this guide, then chances are you're an SFM artwork creator who is wondering how they can render their pictures with Ambient Occlusion or shadows, yet can't because they only have an Intel HD integrated graphics chipset, and Ambient Occlusion/shadows will not render out
on their pictures. This guide will show you how to still be able to render a form of Ambient Occlusion, and then merge it together with your original pictures, so it would seem as though there was Ambient Occlusion in the first place!

Ever since I began making SFM artwork nearly 2 years ago, I've struggled to understand why my Intel HD 5500 was able to run SFM completely fine, yet was not able to render out any kind of shadows or ambient occlusion. As such, my artwork was forced to take a fair blow in terms of quality, but not too long ago I discovered an interesting fix that, while still won't fix the 'no shadow' problem,
will at least be able to apply Ambient Occlusion to my pictures. I decided to write this as a way to aid other SFMers whom are also straggling on less-than-best setups in getting AO into their pictures.
What is Ambient Occlusion?
The TL;DR version:
Ambient Occlusion (or 'AO' for short) is a graphical feature that permits models and cast shadows to shade (occlude) areas based upon the surrounding pixels of the screen. This particular form of AO is known as 'Screen Space Ambient Occlusion' (SSAO), and is what SFM uses.


The in-depth version (taken from Wikipedia):

"In computer graphics, ambient occlusion is a shading and rendering technique used to calculate how exposed each point in a scene is to ambient lighting. For example, the interior of a tube is typically more occluded (and hence darker) than the exposed outer surfaces, and the deeper you go inside the tube, the more occluded (and darker) the lighting becomes."

Why can't an Intel HD Chipset render AO?
While there is no exact reason as to why an Intel HD chipset is not able to render AO in SFM, it is very largely agreed that the reason is due to to the fact that Intel HD chipsets do not contain any dedicated video memory to be able to render AO. In short, while they are able to render
almost everything fine in SFM in varying resolutions and quality settings, they cannot render dynamic shadows, or AO in SFM.

So, if AO cannot be rendered in SFM on an Intel HD chipset, then how exactly are we supposed to be able to add it to our picture? Well, stick with me and I'll show you how.
Prerequisites
Source Filmmaker (duh.)
Any image editing software with transparancy and layer support . PhotoShop will be the go-to choice for many, but for this guide I will be using GIMP [www.gimp.org] , a free image editor that has just as many capabilites as PhotoShop.
The will to experiment. The procedures I show in this guide isn't the magical solution to everything. It's always worth spending a bit of time tweaking around with settings and seeing what works best.

Got all that ticked? Great, let's get started!
The Setup
To begin with, I've set up a pretty simple scenebuild with a hut, a shelf, a few models and two lights as seen below:


Both lights have a very low intensity (about 4 or 5) with ConstantAtten turned on and MaxDistance ramped up, and the second light is casting volumetrics and has an orangy tinge to simulate a sunset coming through the window, which is out of view.

Now, noticed something?
Of course, there's no Ambient Occlusion. That's because it's obviously disactivated. To view the window where we can activate it, right-click on the viewport, and click on "Render settings..." in the drop-down menu that appears. The render settings will then appear:


Let's activate AO by checking the box here and see what happens...


Still no AO, despite us having turned it on. This is because we can't directly turn on AO this way on an Intel HD chipset. The only actual difference we'd get with AO 'turned on' is an FPS drop.

So, how do we view our AO then?
The AO Greyscale
In order to view our AO in the picture, we're going to need to turn on the AO greyscale . To do this, right click on the viewport and go back into the render settings, the same way as described in the previous step. In the window, in the Ambient Occlusion box, you'll see an extra checkbox called "Show Ambient Occlusion". Check this (and make sure you have the actual Ambient Occlusion checkbox ticked as well):

















Huzzah! The AO greyscale is now visible inside the viewport.
We can now proceed to manipulate the AO sliders of our camera, while being able to properly see the effects it has in the camera viewport.
Select your camera in the animation set editor. If there isn't one available, then right click on the animation set editor, click on 'Create animation set(s) existing element(s)'
and select 'camera1'.
Once the camera has been added, click on it in the animation set editor. We're going to be interested in the sliders circled in the picture below:


· SSAOBias defines how close or far the AO will reach the edges of the geometry of any affected model.
· SSAOStrength will define how strong the shaded areas will be affected. The higher the value, the darker the affected areas will be.
· SSAORadius determines how much the AO will spread around the affected area, like radius in a light. The higher it is, the more pixels in an area will be affected by AO.


Depending with the setup of your scene, and what objects are in focus the most, different settings for each slider will be necessary. As mentioned before: The key is experimentation.

AO affects the edges and undersides of models the most, so we'll want to change our sliders to shade the undersides of the cat plush, so the small nooks by its paws are darker.
At the same time, we'll also want to shade the undersides of all of the other models, including the cube, the dog and the sea otter as well.


So here I've found a good balance. I've raised SSAOBias to one third, remapped SSAOStrength to a higher max value and raised it to around three quarters, and I've turned down SSAORadius a small bit to prevent the AO from going wild and covering too much of the underside of the models. We don't want the affected areas to be completely black, but rather a good balance of grey. (See why it's called greyscale now? :P )

But as you can see, the greyscale also looks quite noisy and grainy... The reason for this is because SFM isn't previewing it with DOF samples. To fix this, we're going to switch
over to our Clip Editor, and turn on Depth Of Field sampling. To do this, right click on the viewport, select 'Render Settings...', and in the window that appears, check "Depth Of Field" and set the amount of samples to a minimum of 128. It's good practice to go up to 256 samples or even 512 samples to get a more accurate rendition of how the AO will look.

Now switch to the Clip Editor, and SFM will start sampling and show a preview:


Yep, that looks about right! The undersides of the plush models now have a nice looking darker underside, with some other areas (such as the inside of the cat's ears) also looking a bit darker and as such, a bit more realistic.

I'm just going to make a few more tweaks to this and then we'll be ready to render.
Rendering
Okay, we have our scene and camera set up, and we have our AO settings set up. We're now ready to render. To do this, we're going to make some changes to our SFM settings to enable to to render at 4K, and with the best possible quality.

To begin with, close SFM, and in your Steam games library, find Source Filmmaker, right click on it, and click on 'Properties'. Then click on 'Set Launch Options'.
A window like this will appear:



















Type the following into the box:

-sfm_resolution 2160

Click on OK once you've typed the above into the box, and launch SFM.

WARNING: This launch setting will SCREW OVER the performance of your PC, especially with an Intel HD Chipset. Be prepared for its performance to tank badly.

Upon launching, you'll get a message box like this; you can just click OK and pass it without any problem:

















Load up your session again. Once it has, we need to enable some last graphical features. We can't do this in the launch settings since SFM disables these particular settings after having been force enabled. In the top-left of the screen, click on 'Windows', and then click on 'Console'. The SFM console will then appear.
Type each of the following lines into the console, one by one, and hit enter. SFM will freeze for a small amount of time after entering each command, so be patient.

mat_picmip -10
mat_phong 1
mat_specular 1
mat_bumpmap 1
mat_forceaniso 16

Once that's done, it's time to render. Close the console, Click on 'File' in the top-left, highlight 'Export' and then click on 'Movie...'.
This window will appear:


We're going to change some options in here before rendering.
· Click on the 'render' tab, and change 'Movie' to 'Image Sequence'.
· Click on the 'format' tab, and change it to PNG. This will ensure a better quality render, since PNG has higher quality than JPG or TGA.
· Untick 'Seperate WAV file'. We're not rendering something with sound, so there's no need to have this ticked.
· In the 'resolution' tab, you'll see a box where it says '720p'. Click on this, and assuming you did indeed launch SFM with the -sfm_resolution 2160 switch, the '2160p' option
should be available. Select it.
· In the 'duration' tab, click on 'Sequence' and change it to 'Custom', and then click on 'Seconds' and change it to 'Frames'. The frame window will then be selectable. In the first box, change the value from 0 to 1, and change the value of the second box from 1440 to 3. This will render out two pictures, if for some reason the first frame does not look right.
· Click on 'More Settings', and make sure 'Depth Of Field' and 'Subpixel Jitter Antialiasing' are ticked, and 'Depth Of Field' is set to a minimum of 128 samples. More samples mean better quality, but a longer render time.
· Make sure Ambient Occlusion is unticked for now. We'll be doing a second render with this after this first render is finished.

Once that's done, your render settings should look something like this:


I'm using 512 samples for this particular picture to ensure the best quality. You can go all the way up to 1024 samples, but the difference in quality is almost negligible. I'll stick with 512.

Now click on 'Export Movie' and let your picture render. This WILL take a while, depending on the complexity of your scene, how many lights you have and similar factors.

Once it's done, don't close SFM just yet. We need to render a second time, but this time, we need to activate the AO greyscale. Follow the same procedure as above, but make sure to check 'Ambient Occlusion', 'Show Ambient Occlusion', and make sure the AO tab is set to 'AO Only'. Also be sure to name your render something else, otherwise it'll ask if you want to overwrite the first render, which is not what you want to do.
The greyscale shouldn't take long to render.


And voilà, both our picture and the greyscale are rendered as two seperate files!
We can now close SFM now that rendering has finished.
Splicing the AO together
Now that we have our picture and our greyscale both rendered out, the final step is to splice the two together in an image editor. For this guide, I'll be using GIMP.
Start off by loading your rendered picture in:


Once that's loaded in, what we'll need to do is load in the greyscale as a layer on top of the original picture. To do this, click on 'File' in the top-left, then 'Open as layers':



























Navigate to the greyscale of your picture, and open it.

The greyscale will now appear as a new layer, covering the original picture.
Direct your attention to the layer dialog on the right side of the screen. If it's not there, then click on 'Windows', then 'Dockable Dialogs' and 'Layers'. (Or press Ctrl+L)











In the layer window, you'll see a bar called 'Opacity' and a little arrow above it which opens a drop-down menu. The opacity slider determines how transparant the layer above (the AO greyscale) is on the layer below (the actual picture). The drop down menu determines the type of transparancy:







































Now, this is the part where you will need to EXPERIMENT. Test out each of the different opacity types and play around with the opacity slider with each one to discover the best transparancy for your picture.

For my picture, I've found that the 'Overlay' opacity type works the best, with full opacity.










See how the undersides of the cat's feet, the letter cube and the dog now cast small dark areas beneath them?
We now have Ambient Occlusion in our picture!

Now we can export out our picture, ready for uploading. Click on 'File' -> 'Export as', give your picture a name, and export (preferrably as .jpg to make sure it's under the 8MB max size limit imposed by Steam.)







And that's it! We're finished!
Conclusion
I hope this guide will finally be able to put the problem of being unable to render ambient occlusion to rest once and for all, and that those with no dedicated graphics cards will be able to squeeze the best of quality out of their pictures thanks to this. As with everything else out there, this guide is subject to change under suggestions and feedback, if you have any ideas for improvements, please let me know, since your constructive criticism helps out greatly in making this a better guide, much obliged!

I should also point out again that I used an Intel HD 5500 for this guide. Depending on the models and makes of other Intel chipsets, this guide may or may not work in the same way. If there are other chipsets which work, please let me know and I'll compile a small list of which chipsets work.

If this guide did help out, then please consider spreading the word about it by upvoting and favoriting it for other to see :P
Credits
Of course, I didn't get this far on my own, and I have a few sources and people I'd like to thank here for their guidance and help.

- A big thanks to the /r/SFM community over on Reddit for being an awesome and helpful group when it comes to searching for feedback and advice.
- Same thanks also goes out to the vast repository of other guides, tips and tricks here on Steam.
- And last but not least, a huge huge thank you to A Tomato and Ori for helping me get started with SFM and helping me overcome my limitations up to now. You guys rock.

And with that said, happy poster making, y'all!
< >
5 Comments
♡ �AureddSkei� ♡ Jul 20, 2021 @ 1:12am 
i just use linearattentuation and it works
Scruffygamer Dec 16, 2020 @ 5:47pm 
This tip is actually useful for anybody. Some models don't have ambient occlusion, but you could do this
Juicebox2x Aug 16, 2020 @ 3:30pm 
update: I figured it out.
Juicebox2x Aug 16, 2020 @ 2:25pm 
I know you made this a while ago, but whenever rendering, I cant tell how long it takes to render and I've waited for about 2 hours, using half as many samples you did, at half the resolution you did.

I'm not really sure what to do since I'm not getting any images.
akaDan Apr 19, 2019 @ 5:30pm 
When i turn "show ambient occlusion" on my viewport frezzes in the last frame it was, i still can use SFM, but the viewport keeps frozzen until i disable "show ambient occlusion", what do i do?