Planetside Software Forums

General => Terragen Discussion => Topic started by: WAS on July 05, 2015, 03:46:12 PM

Title: Blur Function
Post by: WAS on July 05, 2015, 03:46:12 PM
Is there a simple way via functions blur a shader? Alternatively also sharpen? I have a few masks generated via PFs, and based on distribution shaders and I'd like to use them also for masking color PFs but they are a bit fuzzy in some instances, and in others, to sharp.
Title: Re: Blur Function
Post by: Oshyan on July 05, 2015, 08:19:11 PM
Blurring is a Raster function (generally speaking), not a procedural one, so there is no general "blur" function. If you're working with procedurals (e.g. Power Fractal), you would have to convert it to raster first, at the least. In the case of Terragen, most Raster operations are performed on Heightfields. It so happens that there is a Heightfield Operator called Heightfield Smooth that essentially performs a Blur. So if you really want to do a blur in TG (rather than for example exporting your data as an image and editing it in an image editor), then you first have to convert your procedural data to raster by creating a Heightfield Generate and feeding the output of your procedural terrain into its Shader input port (on the right), then set the Size In Meters to cover the area that you want to blur, and click Generate Now. It will create a Heightfield version of your procedural shader network. Note that this will mean overhangs will disappear as they are not supported by heightfields. Finally, add a Heightfield Smooth, and voila! If the detail of the heightfield version of your network is too low, you can increase the Number of Points in the Heightfield Generate settings.

- Oshyan
Title: Re: Blur Function
Post by: WAS on July 05, 2015, 10:13:21 PM
Thanks, I saw that that function earlier and was wondering if it blurred things.