Box or Gaussian filtering on bump

Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderators: ChrisHekman, aoktar

aybekdes
Licensed Customer
Posts: 30
Joined: Fri Apr 17, 2015 8:38 am

Hello everyone,
Is it possible to add/use filtering not only to displace maps but to the bump maps as well?
Image

I know that I can achieve this by slightly blurring in photoshop, but then I will have to use 2 images (1. clear 2.blurred) just to bump up or down the image.
like in this example
Image
Maybe it is already implemented and Im missing it somewhere?
Or any other tricks to achieve it?!

P.S. I hope i could explain with my broken English.
User avatar
bepeg4d
Octane Guru
Posts: 10375
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

Hi,
try with the OSL GaussianBlur texture node created by Mojave, you need to set the projection of the input texture as OSL UV, then plug the Texture in the input pin of the OSL texture node, load the GaussianBlur.osl script, and finally connect the OSL texture to the desired channel of the material:
7A88C35E-58D9-414E-A084-5523DBE61BFE.jpeg
oslgaussianblur.zip
(213.61 KiB) Downloaded 745 times
ciao Beppe
aybekdes
Licensed Customer
Posts: 30
Joined: Fri Apr 17, 2015 8:38 am

Thank you Beppe!
frankmci
Licensed Customer
Posts: 917
Joined: Fri May 26, 2017 2:00 pm
Location: Washington DC

I think it would be well worth paying Mojave to include this OSL in the standard distribution, or better yet, include a hard coded blur node that includes the most common modes, like directional blur, box, radial, gaussian, etc. It's honestly a bit mind-boggling that this has been missing from Octane's basic toolset for so long.
Animation Technical Director - Washington DC
User avatar
mojave
OctaneRender Team
Posts: 1345
Joined: Sun Feb 08, 2015 10:35 pm

As a matter of fact I am part of the Octane team, so that should suffice ;)

I just shared this as an example of what users can achieve by extending Octane via OSL nodes.

We would like to add samples like this to the LiveDB so they are easily accessible by everyone so if you have anything to share please let us know.
frankmci
Licensed Customer
Posts: 917
Joined: Fri May 26, 2017 2:00 pm
Location: Washington DC

Hehe, excellent, Mojave, and thanks! :oops:

I think using OSL in the LiveDB to extend the functionality of Octane is a great option, as long as those functions are decently documented. Otherwise, I think, "Oh, you could do that with OSL," get's to be a frustrating response to requests for things that are basic features in most systems.

Perhaps (I realize this is probably a plugin developer thing), often-used OSL nodes could be optionally docked right along the other hard coded nodes in the Node Editor. Ahmet has already kindly agreed to look into better organization of the scripts menu in the OSL Code Editor in C4D.

Thanks again for this node; it's something I and the rest of my team had been sorely missing in Octane.
Animation Technical Director - Washington DC
User avatar
Notiusweb
Licensed Customer
Posts: 1285
Joined: Mon Nov 10, 2014 4:51 am

Could we get the non-C4D version of this OSL?
thank you so much!
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
milanm
Licensed Customer
Posts: 261
Joined: Tue Apr 30, 2013 7:23 pm

This is the original link @mojave posted in the Facebook group (of which I am not a big fan). Make sure to set the projection of your texture to OSL UV for this to work.

https://gist.github.com/anonymous/18de5 ... 93eec13587

And here it is as .osl text file:
GaussianBlur.zip
(836 Bytes) Downloaded 419 times
Thanks again Arturo, I learned a lot from that code.

Cheers
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
User avatar
Notiusweb
Licensed Customer
Posts: 1285
Joined: Mon Nov 10, 2014 4:51 am

Hi thank you very much again.
With a colored RGB image, it warps the coloring, almost winds up looking like an "invert".
Any thoughts on how to maintain the integrity of color while still blurring?
Thx!
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
milanm
Licensed Customer
Posts: 261
Joined: Tue Apr 30, 2013 7:23 pm

It's hard to say, I guess it depends on the case. In my experience it works best if you keep stepSize to small values (low blurring amount). High iterations (Step count) improve the quality but slow down the rendering a lot. So, to avoid that, I like to lower the resolution by half or quarter using the baking texture node first and then feed that into the GaussianBlur node. That way I can keep Step count to a low number (faster to render) and also reduce the 'infinite sharpness' of procedurals a bit before blurring.
blur+baking.jpg
Baking+Gaussian.orbx
(409.97 KiB) Downloaded 334 times
Baking+Gaussian C4D.zip
(434.27 KiB) Downloaded 338 times
Cheers
Milan
Colorist / VFX artist / Motion Designer
macOS - Windows 7 - Cinema 4D R19.068 - GTX1070TI - GTX780
Post Reply

Return to “Maxon Cinema 4D”