Issue 122 – November 12, 2022

Non-Photorealistic ParaView

Hey there,

It’s Robin from CFD Engine & let’s face it “photorealistic” CFD images are hardly ever realistic or photo-like. So why not save yourself some time & go for something unrealistic in the first place?

This week I’ve got three quick ParaView effects that you can use today to make any CFD plot look a little fancier.

Two of them can be turned on with just a couple of clicks, one needs a teensy-bit more work, but none of them require faffing about with lighting rigs, materials, environment maps or any of that jazz.

They don’t increase render time either, so you can use them interactively, spinning your model around & zooming in & out, as much as you like, with no lag.

So, if your CFD images would benefit from a little something extra, then you might want to give these three tips a whirl.

First Off

I didn’t know non-photorealistic rendering was "a thing" – I’ve seen plenty of non “photorealistic” CFD renders 🙈 but this actually refers to a family of techniques that don’t strive to look like a photo, instead they’re trying to add something different to your image.

The three I’m showing here, are all trying to improve the depth perception in a flat image – one of them adds shadows, one highlights the edges & one does a bit of both.

We could go a bit crazier one day & render our CFD results as watercolours or oils or something else – but let’s start easy…

Ambient Occlusion

We’ve seen this one before – ambient occlusion is a quick way to add soft (fake) shadows to a model without having to setup a lighting rig or do any raytracing. As an aside, it’s also the technique I mentioned for isolating & removing internal details using MeshLab.

Since ParaView v5.9 you can turn ambient occlusion on with a single click – it’s in the view options in the sidebar & it looks like this.

I’ve also turned on Tone Mapping here, which helps to even out the image if it’s too dark or too bright, but that’s up to you.

This one is fast & needs almost no effort to use. The diffuse shadows don’t detract from the CFD data (IMHO) & it definitely helps to bring more depth to the image.

Eye-Dome Lighting

This one has been in ParaView for more than 10 years, but you might’ve missed it as it’s kind of hiding & it has a weird name. Essentially it uses depth maps to work out where a surface is in relation to its surroundings & uses that information to bring out the foreground bits & subdue the background.

It also creates a neat edge effect, where we get a deep shadow that looks like a thin outline. You can find out more about how it works here.

You won’t find this one in the view or display options, to use it you’ll need to open a new view & select the eye dome lighting option.

It doesn’t work for transparent surfaces as they mess up its depth calculations. But it’s really good for slices – where you get a subtle black outline that picks out all the free edges – bonus 👍

Cartoon Outline

Last but not least, this effect adds a hard outline, highlighting the edges of your model, to give it an anime/cartoon look.

You can’t just click a button for this one though – you need to create an offset of the model, slightly larger than the original, & then use back-face culling to hide everything but those cartoon edges.

To create the offset, first apply the Generate Surface Normals filter & then use Warp By Vector to offset your surfaces along those normals.

Colour the warped surface black (or whatever colour you want your outline) & set its backface representation to Cull Backface in the display options, in the sidebar.

You could also throw on some ambient occlusion if you’d like, but then it starts to look a lot like the eye-dome lighting version.

I only put this one together recently & it’s my new favourite 😎 although the thin surfaces (& low-res mesh) of the motorBike tutorial aren’t the best demonstration of it 🤔

Over to you

So there you have it, three non-photorealistic effects that you can use in ParaView to enhance depth perception & bring out the detail in your plots, without having to mess around with lighting rigs, cameras & materials.

Do you have a favourite? Do you already use one (or more) of these in your plots? Are you going to give any of them a try? I’m be keen to see what your model looks like with a cartoon outline, drop me a screenshot.

Until next week, stay safe,

Signed Robin K