Jump to content

Blurring/Filtering Procedural Textures


Recommended Posts

Help a brother out, I'm getting headache by trying to figure this out. At this point assuming it's a limitation of the software.

 

I've been getting more into procedural texturing and shading and sometimes want to blur those textures for example to use as a mask. This far I haven't been able to figure out if there is a way to blur or filter SHOP textures in a similar way you could in COPs with Blur node. I guess SHOPs can't do this since the procedural textures are resolution independent. However is it possible to maybe import the texture to COPs and then after blurring there back to the shader again. The main thing being I want to avoid writing out the textures in between, if there is a interactive solution for baking texture out then maybe that would be fine.

 

Attaching a examle scene file with texture() blur and example procedural texture I want to blur out.

Thanks!

textureBlur.hip

Link to comment
Share on other sites

You can prefix a path to a Cop texture with op: and it will be referenced directly from the COP network without writing it to disk.

 

Here is an example I was using today.

op:/obj/cop2net1/OUT
Edited by Atom
Link to comment
Share on other sites

In your shader turn on check box mirrored ramp on RAMPS1 node. That will force ramp node to begins and ends with same value avoiding such sharp edge on pattern repetition. If that is not you want then create new RAMP PARAMETER node, connect output of your ramps1 to input of newly created ramp1 node and output of ramp1 node to input2 of your switch node. Now, one level up, where is slider for your switch node you will see RGB ramp starting with black and ending with white color. Point is to create start and end colors same values and in the middle you can define several ranges of different colors. If their contrast is less, more blurry results will be. By other words, with that color ramp you define spread in between two repetitions. That is not a blur, it is just better control of spread of your noise function which could give you desired results.

 

Suppose you blured that procedural pattern. In the result, all details from noise function will be lost, so you could decrease number of octaves and roughness of your noise to achieve similar results. Then adjust color spread to less contrast and that's it.

Link to comment
Share on other sites

  • 3 weeks later...

Neither of these really work. I knew about COP referencing but in this case I would need to reference procedural texture first to COPs and then back into the shader (possibly multiple times).

First I tried blurring with For Each loop inside SHOP but ran into some limitation after which I found this thread: http://forums.odforce.net/topic/22781-dennis-albus-technical-reel-2015/#entry134933

 

Method that Dennis describes is exactly what I was looking for!

Thanks anyways!

Link to comment
Share on other sites

I'm not sure if I understood you correctly, but there is a texture vop, which gives you three methods to blur images in shop context, Filter Width, Texture and Pixel Blur. See attached image.

 

As to blur procedural textures, why not do them completely in COP Context, as inside a Cop Generator Node a lot of pattern nodes are at your disposal there.

 

You could also try setting up an dynamic referencing network described here:

http://ramblingsofadigitalnomad.blogspot.de/2013/10/houdini-basics-simple-texturing-using.html

post-7548-0-10323200-1460061370_thumb.pn

Edited by Yader
  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Just stumbled upon that serie of video from Kim Goossens that might be of some help.

COP Filter using SOP Part01: https://www.youtube.com/watch?v=_5t-afUyMfE
COP Filter using SOP Part02: https://www.youtube.com/watch?v=FMz-CpFXnGs
COP Filter using SOP Part03: https://www.youtube.com/watch?v=1F5usFluB1I

At 4:30 on Part03, he is blurring via smoothSOP.
There would be some adjustment to do as this is based on an image, not a procedural texture but the principle of converting a COP output into SOP context to manipulate is probably a good lead. 

 

Edited by iamyog
link
Link to comment
Share on other sites

I'm not sure exactly your situation, but if you're generating all the noise in the shader itself, then to get a 'blurry' version of it you can reference copy that whole chunk but then reduce its octaves + optionally the roughness. This won't exactly be a 'blurred' version of the direct texture but its close enough -- that's a method i've used before for doing smoothed out displacements for example that correlate with the texture (say a worn down rock where texture is detailed but its geometry is more smoothed). 

Link to comment
Share on other sites

you can use loop to blur any procedural pattern generated inside of the shader. watch the H15 loops masterclass on sidefx site. one of the examples shows that in VOP context. it shouldn't be that hard to translate to SHOP.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

I just bump up in this older thread which describes exactly what I am trying to achieve with no success off course, I am trying to 'blur' a procedural 'soft dots' pattern more than it's own softness using what i saw on the Masterclass about loops but I it's not working for me, can someone point me on the right direction?

 

Thanks.

loop_blur_vop_values.hip

Link to comment
Share on other sites

Over time I have found two solutions that are more-less working when you NEED to do blur in shader but both have it's caveats due to the fact you have to actually raytrace the blur, and generally I always bake the result into bitmap to avoid high render times and/or possible artifacts coming from sampling noise.

poor man's trick would be gaussian random VOP added to your position data, like this:

blur.thumb.jpg.a506b1c889b21e547de8a0c109c076b6.jpg

this is easy to do but may be hard to sample enough. good in simple cases but forget about using it in more complex shaders. 

 

Another option would be gather VOP - that's more capable loop based solution but soon you'll see there are similar caveats as in it's essence you still need to raytrace that blur. check this article for details:

https://vfxbrain.wordpress.com/2018/08/28/gather-vex-function/

 

in general, blurring non-bitmap based patterns seems to be a hard nut to crack. I don't know what are you doing but if it's just blurred dots I'd use COP network (or substance designer), brought that in as a bitmap and worked my shader up from there.

cheers.

  • Like 1
Link to comment
Share on other sites

Thank you so much for giving your time to explain this to me it really help me understand this, I already knew that do something like this in PBR would involve some more complex calculation with Rays I just did know how to do it, in the old micropolygon days I knew that with some loops you could do it with less complex calculation I guess. My intent was to learn how to average the values like in sops and also to learn how to do it and also I like the idea to do all that I can in shaders but thanks to your explanation now I know the caveats so I can decide better if I should in in textures or not. Thanks again for the explanation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...