How to avoid backdrop from clipping with mia_simple_exposure?


#1

I have this problem that I don’t know how to get around:

An interior with a simple plane outside mapped with a surfaceshader and a .jpg in the color-slot. The problem beeing that the 8 bit .jpg is already clipped once, and now I’m applying a mia_simple_exposure to
it so it gets clipped one more time and looks all grayish and dull (you get the picture).

I haven’t got a clue on how to solve this, I’m thinking rendering in passes but how to render out the glass-pane with transperency intact in comp if you get my drift?

Regards

//NIC


#2

Do you have a node on your jpeg to set gamma to 1.0? If you do and still have trouble, then rendering with an alpha channel should work and adding the background in post.


#3

I enocuntered this problem a couple of days ago. Seems the work around is to link a gamma correction node to your surface shader. So the network would look somethin like:

Surface Shader (Color slot) > Gamma Correction (Top Slot) > File Texture

Also make note that in the GCN, change the RGB values near the bottom to .454 respectively. Can’t remember the math on that, but it’s supposed to counteract the exposure supression.

Here’s a link to the help I recieved on the topic as well.

http://forums.cgsociety.org/showthread.php?f=7&t=544821


#4

Thanx but all my textures are already gamma corrected for gamma 2,2 that’s not the issue here :wink: And I have still not found a good solution to my problem, tried to render backdrop and bottles/window seperately for comp but I wasn’t able to render out the right alpha for the objects.


#5

Are you sure you read the whole thread of the link bmoner posted?

As pointed out there it’s not only the gamma, but also the crushing of overbrights and tonemapping that miaExpSimple does, so you also have to increase the gain on the texture - basically to fake it being HDR…


#6

Well if you read my first post of this thread isn’t that exactly
what I’m pointing out? :wink: That I’m having issues with the tonemapper clipping my backdrop…


#7

visua: I think I have been in that situation too. If I understand your question, you want to know “how can we tell the tonemapper to ignore the backdrop surface shader”.

I had partial success where I tried to figure out how to pre-apply the reverse of the effect of the tonemapper to the backdrop image. This is more than just de-gamma. I had to account for the gain, knee and compression too. I got it close enough for my purposes, but it would be better to have something like use_background with a tonemapper-ignore flag.

– David


#8

Sorry visua, didn’t read your whole post properly - I just meant that eyeballing the gain as described in that thread could maybe be a satisfactory ‘hack’ solution in your case, without using passes…

yeah, that would be great. I also just managed to eyeball it and get close, but couldn’t really figure out the proper math in order to reverse the tonemapper completely.

Not sure if a shader with an ignore tonemapper is possible since the tonemapping is done as a post effect after all shading, no?

So when not doing it in post, we’ll probably have to stick to eyeballing the thing, unless somebody (Zap??) can add an output to the tonemapper that spits out the reverse result, so you can plug it into the gain of the background textures or something like that…
Or would that disintegrate the textures too much? Should be alright, since it’s all done in float, no?

How do other people do this?


#9

For the simple exposure, you’re best off eyeballing it yes. But of course the “better” solution is to comp the background in in post.

To get the proper alpha, use mip_rayswitch_environment from 2008 to have a transparent black alpha even though you have an environment to light the scene with. Then just comp.

Actually, come to think of it, one could write a simple shader for “in render comping”. Basically, it would work such that as your “actual” background, you apply transparent black (as for comp), and then you would need to write a really simple lens shader that is applied after the toneop lens shader, and which looks at the alpha, and simply blends in that amount of the given image. “Et voila”.

Not sure if a shader with an ignore tonemapper is possible since the tonemapping is done as a post effect after all shading, no?

True, max has this option, but it has so many cans of worms attached.

First of all, “under the hood” it is really a reverse tonemap going in, not an actual “do not tonemap”. So the checkbox that says “Process environment” in max, is actually the checkbox that turns OFF. Super-confusing.

Secondly, it applies to backgrounds AND environments, with no way of separating it… but in most cases you want to do just that, i.e. you have something as an environment map, and you want something else as the “background”.

And since it’s an actual “reverse” operation, it can run into math problems (non reversable functions, the new photographic tonemapper map isn’t at all trivially reversable … maybe with a lookup map you could reverse it but… ) and sometimes if it is “accidentally” applied twice… bad things occur.

In the end, your best bet is twine:

a) Try to get your background photo in to an as-physical-space-as-possible (which means de-gamma, and possibly highlight expansion w. curves in PhotoShop, save to EXR)

  • or *

b) Just handle it with alpha after the toneop.

/Z


#10

So if I get this right there is no solution that comes without any hacks then, no?

I love your new mip_matteshadow stuff, but if I don’t want to just eyeball the dynamic range of the Background image, then how would I deal with these two cases:

Here (ok - I just put that light in to demonstrate what I mean - silly example…) the indirect causes some bounceback onto the background (mip_matteshadow)
Is there any way to correctly separate that bounce light from the background image for later compositing?

In the second image: how do you deal with refractions if you use a tonemapper?
I’m looking for a quick, easy and physically correct workflow.
Even in your own example you tonemapped the background image, so the rendering was more dull than in the original.
If not having any complex interaction between background and synthetic objects - no problem to comp it later, but how to deal with the refractions?
In your case the tonemapping was very mild, but what if you have to compress a lot more or use the Physical Sky with the gain turned to 0.2? The refraction will be way too dull, no?

Ok - I can tonemap in post instead, but I don’t want to. I really like your tonemappers and getting a good looking image straight from the renderer.

So this brings us again to a reverse tonemap, similar to what you described for 3dMax, but with the option to apply it ONLY to the background obviously.
Don’t you think it would make sense to have an output from the exposureSimple and the exposurePhotographic that spits out the reverse algorithm, so you can plug that into a special kind of mip_reverseTonemap node and then pipe your background plane and the mip_cameramap through this node?

Am I maybe thinking to complicated here? (Or too simplistic?)


#11

No disrespect but it seems like you may be over thinking the process. I’m tyring to understand where you’re coming from and am completely lost. It shouldn’t be as hard as how you’re explaining it.

Don’t get me wrong I DO understand what you want but the way you’re going about it seems over produced.


#12

Hehe - yeah, I tend to do that sometimes and there might be the blatantly obvious solution that I’m not seeing here, so if there is a simple solution to my dilemma, please point me there.

The way I’m seeing it at the moment is:
-I need to render synthetic (3d) objects into a photographic background everyday.
-I have these backgroundplates and they are usually exactly the way they should look, so I don’t want them altered.
-If I want to keep my render as photorealistic and harmonic as possible, I need to tonemap the images.
-If I tonemap the images the background plates get altered.

I can do things in post and in many cases will do anyway, but theoretically there should be a simple workflow within Maya/MR that wouldn’t necessarily require post. It’s such a mighty and complex tool with all kinds of bells and whistles and most of the tools are there to render 3d objects onto photographic background plates, but I’m missing this one simple link that keeps my background plates unaltered while still doing a tonemap to the rest of the render.

It might well there and I just don’t see it - Please help!


#13

Hi.

Had a bit of free time this days, and made a rough tutorial in my Blog about this problem in Maya.

Here is the link:

http://www.3dtapas.com/page5/page5.html

Hope it Helps,

Miko.


#14

Ah, yes, interesting:-)

I wasn’t aware of the option to render all render layers in the render view as composites.

Thanks a lot:o)


#15

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.