Mantra max value clamp

   4220   11   2
User Avatar
Member
53 posts
Joined: Jan. 2015
Offline
Just wondering if there is a parameter to clamp the maximum value of a pixel in Mantra, such as the Max Value setting in Arnold here https://support.solidangle.com/display/AFMUG/Clamping. [support.solidangle.com]

I know there is Color Limit for the indirect rays, but I'd like to clamp the final pixel value so there aren't any values too extreme in the final image.

Cheers!
Edited by carlo_c - June 21, 2018 10:16:41
www.carlocarfora.co.uk [www.carlocarfora.co.uk]
User Avatar
Member
7733 posts
Joined: Sept. 2011
Online
You don't really want to clamp unfiltered/uncomposited samples. Let the film lut (2D color pipeline) do the work.

If you really must, then you can modify the pathtracer fog shader used by the pbr engine to clamp Cf before export.
User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
Well, in reality, I'm afraid that someone really want to clamp direct rays, too. Otherwise there's insane amount of sampling just to keep certain highlight to do not get wild across frames, almost impossible sampling of DOF or motion blur.
Best I got with this, it was ‘switch lighting bsdf’ node to proceed indirect rays intact, and ‘get direct lighting’ which is easy to limit because is not bsdf ‘f’, then plugging the result of direct lighting into Ce, something like that. However this was able to kill the additional photon lights for some reason, if some was already present.
Long story short, get another renderer for everyday tasks, forget Mantra. IMO Mantra and all related shader stuff is somehow unseen mix of great possibilities and long setups to get the basic options, available in any modern renderer.
User Avatar
Member
4189 posts
Joined: June 2012
Offline
Add a limitVop to the shader.

Attachments:
Screenshot_20180625_071754.png (37.9 KB)

User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
fuos
Add a limitVop to the shader.
I guess you wanted to put ‘min’, not ‘max’ . Anyway just for info, Cf does probably nothing when PBR rendering is used. It's bsdf ‘f’ that count. Some workable network could be something like in pic bellow, however such common option, present all around, in Arnold or Blender Cycles or else, I think it *should* be implemented and maintained as global rendering option.
Edited by amm - June 25, 2018 07:01:20
User Avatar
Member
4189 posts
Joined: June 2012
Offline
Interesting setup but PBR rendering is essentially depreciated. The PBRLightVOP does all the bsdf stuff in raytracing, therefore you can just limit the computed Cf output, which the Arnold seems to be doing.
User Avatar
Staff
418 posts
Joined: Sept. 2016
Offline
Hi. mantra doesn't offer built-in options for clamping direct lighting. However (as jsmack said) you can modify the built-in pathtracer, which is possible/easy with mantra as long as you're willing to dive into vex. If you have a recent 16.5 build, find the file named pbrlighting.vfl and look at line 1242, and you'll note that colorlimit parameter is passed in only if it's indirect. You can change it to be always passed in (ie change ‘is_direct ? -1 : t_colorlimit’ to ‘t_colorlimit’), so that Color Limit parameter will apply to both direct and indirect bounces.

fuos
Interesting setup but PBR rendering is essentially depreciated. The PBRLightVOP does all the bsdf stuff in raytracing, therefore you can just limit the computed Cf output, which the Arnold seems to be doing.

With Ray Tracing render engine, clamping Cf is certainly a viable option. I must point out however that PBR is very much not deprecated.
User Avatar
Member
4189 posts
Joined: June 2012
Offline
dlee
however that PBR is very much not deprecated.

Apple took 7 years to official depreciate OpenGL too
User Avatar
Member
8513 posts
Joined: July 2007
Offline
dlee
… you'll note that colorlimit parameter is passed in only if it's indirect.
I wonder if this is just for historical reasons
as I assume that vm_colorlimitdepth would be sole control on which rays get clamped, so it it is 0 I'd expect that even direct rays would be clamped, seeing that default is 2
was that not the intention?
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
98 posts
Joined: Aug. 2014
Offline
tamte
I wonder if this is just for historical reasons
as I assume that vm_colorlimitdepth would be sole control on which rays get clamped, so it it is 0 I'd expect that even direct rays would be clamped, seeing that default is 2
was that not the intention?

Thanks for info, anyway, normal option (normal = present everywhere)could be ray-swtcher (light-path) shader, as additional option, making possible to clamp only camera ray, only for certain shader. I'm using ray switchers since Mental Ray times, can't imagine to live without them. And yeah, straight alpha output as well…
Since Blender Cycles has all mentioned, choice against Mantra is simple, I'm afraid.
User Avatar
Member
7733 posts
Joined: Sept. 2011
Online
tamte
dlee
… you'll note that colorlimit parameter is passed in only if it's indirect.
I wonder if this is just for historical reasons
as I assume that vm_colorlimitdepth would be sole control on which rays get clamped, so it it is 0 I'd expect that even direct rays would be clamped, seeing that default is 2
was that not the intention?

vm_colorlimitdepth is just broken. I had a version of pbrlighting.vfl, that has the line dlee mentioned modified to perform the raylevel check instead of a simple isdirect, and then removed the section that applied vm_colorlimitdepth; but I got tired of updating it for every release of houdini.
User Avatar
Member
53 posts
Joined: Jan. 2015
Offline
Thank you all for the replies, I'll have a good read through it all but nice to know that there is a workaround for this
www.carlocarfora.co.uk [www.carlocarfora.co.uk]
  • Quick Links