Community
Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to blur shadows - skydome with hdri map maxtoA?

27 REPLIES 27
SOLVED
Reply
Message 1 of 28
dina18
3095 Views, 27 Replies

How to blur shadows - skydome with hdri map maxtoA?

Hi,

I am trying to make shadows more blurred, in particular to soften progressively - as they fall further from the object.

I see that it makes renders look much more realistic.

I tried using a "Decay filter" or a "light filter" with a "ambient occlusion light filter",

but it just lightened or darkened the scene without making any falloff in the shade.

I would like to know, is it possible to create shadow softening with a hdri skydome? It seems to me that an extra large sun would increase the shadow blur.

7432-1592772554482.png

In addition, is there a way to set the contrast between the light and shadow (like Gamma in vray)?


Thank you

Labels (3)
27 REPLIES 27
Message 2 of 28
pproestos
in reply to: dina18

wire hdri to a color correct map (osl or arnold) for tweaking gamma and

assign this to skydome.

I don't think you can intervent how an hdri emmit light+shadows, otherwise

use an arnold direct light+arnold filters to get the effect you want...

Message 3 of 28
madsd
in reply to: dina18

You can blur the map in an OSL Bitmaplook up node, but a bit of code addition is neeed, and Arnold needs to have the Auto mip map flag enabled.

This way you can control the amount of blur, and thus how soft or strong the shadows are.
Do note you cannot go the other way around, make a very soft image sharp. But thats also not what you want.

I can cook up some code for it and return in a bit with a custom shader.

Message 4 of 28
madsd
in reply to: dina18

7393-qweqweqwe.gif


7394-qweqweqwe.png


This is the actual shader.
Download it, and overwrite the one in maxroot/OSL/ folder.
Or just open a random OSL node in max, delete all code, and copy paste this into it and press f7.

You then need to adjust the blur value on the map in the bottom shown above, and dont forget to enable Auto-mipmapping in the render panel.

https://github.com/gkmotu/OSL-Shaders/blob/master/HDRIEnviron_blur.osl



Message 5 of 28
pproestos
in reply to: madsd

Mads my friend, I used to raise up hdri's gamma for bluring

shadows, this isn't the right way to do?

Message 6 of 28
madsd
in reply to: pproestos

Gaussian blur is the most robust failsafe way, when you have either super bright tiny spots or "whatever"

Message 7 of 28
dina18
in reply to: madsd

Hi Mads,


Thank you so much! That is very helpful!

I've been struggling with this issue for a few days.


I'm trying to carry out your instructions,

I can't manage to overwrite the OSL map in the folder so I copied and pasted your code, then pressed F7,

But for some reason it does not look the same as the OSL map in your image above.

7441-1592858049488.png

And when I tried to set the blur value, the background became blurred instead of the shadow.

What am I doing wrong?


Message 8 of 28
madsd
in reply to: dina18

Right, the .ui file is missing.

Technically it does not mean anything, your ui just resorts to an autoUI.

If you want to have the ui, go into the maxroot/OSL and find the .ui file, copy it to your root/plugins/OSL folder and store the osl file there as well. The same name is needed on both files. Restart max and you should have 2 environment maps in the list, original and this custom one.

For the seperation of the background and the environment, use an environment swither, there is an OSL one, and an Arnold render panel one.

Message 9 of 28
Anonymous
in reply to: dina18

Really cool Mads Drøschler !
Some template & mtd file for Maya, Houdini, and Cinema4D
#Maya

7451-hdrienvblur.jpg

#Houdini

7452-htoahdrienvblur.jpg

#Cinema4D

7453-c4dhdrienvblur.jpg


HDRIEnviron_blur.zip

Message 10 of 28
madsd
in reply to: Anonymous

Updated the git, zip lies next to shader.
I put a general statement in top of ReadME that you typically do the 3 other host UIs.

Message 11 of 28
dina18
in reply to: madsd

I copied the UI file and OSL and restarted max, and still don't see 2 environment maps in the list.

Why is it not working?

7443-1593019423160.png

7444-1593019486479.png

Message 12 of 28
madsd
in reply to: dina18

Max 2021? needed.

Message 13 of 28
dina18
in reply to: madsd

No, unfortunately I've got max 2020,

Does that mean there's no way of making the shadows blur?

Message 14 of 28
madsd
in reply to: dina18

Sure, the UI just wont be original. Its doing an auto UI, ignore that part, it should work.


I can see on your screenshot that the blur = 0.02 thats what I added, so you have loaded the shader.

You need to remember to enable "auto mipmapping" in the render settings as I explained, else it wont work with Arnold.

It wont work in the viewport.

Message 15 of 28
madsd
in reply to: dina18

Or maybe, zap introduced something for 2021 OSL which isnt supported in 2020. I can see things in the code I think that are relatively new. So my guess is something may break if you use 2020.

Message 16 of 28
madsd
in reply to: dina18

The shader is part of 2021 anyways, try download a trial and see if you can get it going.

Else you have some workflow misses, like the mipmap thing, hard to say.

Message 17 of 28
dina18
in reply to: dina18

Your right!

The auto mipmap turned off, probably as I restarted max.

I still can't see any noticeable change in shadows, but I do see a change in the material preview.

From what I understand, the next step is what you wrote for me-

For the seperation of the background and the environment, use an environment swither, there is an OSL one, and an Arnold render panel one. 

I'm sorry, I didn't understand what to look for, and didn't find any similar map.

Do you know the exact name of the map?

Message 18 of 28
madsd
in reply to: dina18

Its a map that ships with 2021 as well.
Get the 2021 trial latest point release, steal the shader from that install and use it in 2020 and see if it works.

Message 19 of 28
dina18
in reply to: madsd

I copied the code from max 2021 environment/background switcher to a max 2020 OSL map,

and didn't see any change.

I also tried rendering the scene in max 2021 and still no change?

7541-1593330197187.png

Message 20 of 28
madsd
in reply to: dina18

Ok, since you have 2021 installed now, Ill cook up an example bit later today.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report