High resolution AA issues

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  08 August 2013
Funny. This talk about MR made me go check the elemental ray blog, and I just came across this exact issue.

There is apparently a replacement shader for the mia material which have a clamp option, look in this blog post to see it in action.


If you want to try them I think you can download a beta of the shaders in the following link, though it might be old. You also have to register as a forum member. But look around for a newer beta, as those I linked to might be too old to include the clamp feature.

  08 August 2013
I am still fairly new to maya, so forgive me when it comes to some of the things I ask... as for working linearly, I am honestly not sure what you mean... linear workflow?

As for render passes, I suppose I could do this for some of my larger still frames, but I am now animating these same scenes and this AA issue is killing me. BTW if you look at the pictures I posted, you can see the jaggies are most obvious on the highlights, but they are also very prevalent pretty much everywhere else in the scene.

Rendering twice the size for a 0-1 ratio sounds lovely, but that is an insane amount of extra render time, particularly now that I'm animating these scenes.

I can see what you guys are saying about the highlights and surrounding lighting for one of my scenes, but the blue picture i posted on the other page isn't really that dark, so I don't see why it would be happening there if the lighting contrast was the issue... unless it's just because of how reflective and shiny the mia_material_x is.

Ekenryd, that sounds like a promising solution. I will certainly give that a shot. Unfortunately i'm going out of town this weekend, so I will have to try on Sunday sometime.

What it comes down to is that I am using mia_material_x for a lot of my scenes because I am more familiar with it than other materials, so this is an issue I'd like to fix properly as opposed to having to do lots of post work or extra rendering size. I'm thinking at this point my best guess is to try these clamp shaders and see if any info comes to light from trying that; it looks like the article explains a lot on the page with those shaders, so I'm guessing I might learn the exact cause of the issue there.

I'll post back this weekend.

Thanks again for all the replies, and has no one else ever ran across this issue? I'm wondering if you guys maybe want me to setup a brighter scene based on the same lighting setup and materials to see if the jaggies are still there. Wouldn't that determine if the contrast is actually the issue?
  08 August 2013
Another thing that may help is to use a different filter type. Mitchell and Lanczos both introduce some sharpening effects that can cause negative rgb values around high contrast areas like higlights. Try with a Gaussian filter and see if that alleviates the jagginess at all.
  08 August 2013
I've tried all different filter types and none remove jaggies. Some making the reflection highlights a bit wider/fatter but the jaggies are still the same.

I'm trying to test these shaders but I have to register to the forum and make a post and then get approved by a moderator before I can access the download page... what a drag; just wanted to try that quickly.

EDIT: Just go approved; will try the shaders tonight!!

I attached a screenshot of some other areas of jaggies I've noticed in my animation renders. This area doesn't seem to have the highlight reflection jaggies, so I'm wondering if this is the mia_material itself and not just highlighted areas (where it's just more obvious). What do you guys think? It could be that this area is still technically a highligit or hot spot but just doesn't look like quite as much of a light reflection; I have the mia_material setup to a light_surface so the materials emit light.
Attached Images
File Type: jpg error.jpg (75.6 KB, 15 views)

Last edited by jbardy : 08 August 2013 at 09:10 PM. Reason: updated info
  08 August 2013
Posting an update: The shaders have the clamp option and I still haven't tried, but I decided I don't want to have to use these shaders in the event I run into this problem again, so I searched around...

I found this thread: http://forums.cgsociety.org/showthread.php?t=543646

Apparently this is a well known issue.

Tonight I will try the camera lens again; I must not have tweaked the parameters correctly. I will also try rendering spec pass separately as suggested earlier in this thread and applying a glow to it (I originally dismissed this idea because the poster said blur it, and that sounded like it would look less render quality).

I'll post back as I'm sure others will run into this problem at some point.

But here are the two fixes a poster explained on that forum thread:

Quote: This is actually completely "normal", although for most people, unexpected.

As a matter of fact, this effect happens in real life with real (digital) cameras too.

Here's the thing; Anti-aliasing is done by blending some subpixel samples.

Imagine a window, whose edge covers one quarter (1/4) of some pixel.

If we are rendering in low-dynamic range (i.e. not to floating point), mental ray clips each rays color to 1.0 (i.e. "white") *before* filtering.

This means that no matter HOW bright the window was (1.0, 10.0, 100.0 or 1000000.0) the ray gets clipped to 1.0 (white) and THEN blended with it's neigbours.

So for our example with a window that covers 1/4 of a pixel, the result is a 25% gray pixel, which is what you would expect for an anti-aliased white pixel covered to 25%.

However, in floating point rendering there is no clipping happening.

So if the intensity of the window was 10.0, and it covers 25% of the pixel, this is still a total intensity of 2.5 ... whiter than white (but still rendered on your screen as a "white pixel"! This is no less white than the "white" pixel that results from a pixel that is fully covered by the window. Even a pixel only covered 10% by the window still ends up "white". Yet the wall pixel beside it (covered 0% by the window) is dark. I.e. any pixel that even "touches" the window is full white. You get aliasing!

And this is completely normal. As a matter of fact, if you change the exposure in your HDR viewer you will see that when you get to the point where the window stops blowing out, your anti-aliasing comes back!

And yes, this would happen to a superbright pixel also in a real digital camera. However, intra-pixel bleed and glare tends to cover this up, it can sometimes be evident in a photographed image.

So... how do you get around it?

Well, there are two basic fixes:

a) Do what reality would do, and cover up the effect with glare.

In a real optical system, such superbrights would spill onto neighbouring pixels due to lateral scattering in the imaging surface (film, ccd, or retina of eye) or scattering inside the optical path (lenses, the optical goo inside the eye) and - to a much lesser extent and much less than people think - scattering in the atmosphere.

There are numerous shaders and tools to do this, from "glow" filters in photoshop, the Lume "Glare" shader that ships with max, Maya Glow, etc. etc. that all "does the job"... pick one. Use it. Enjoy.

b) Intentionally "pre-clamp" the rays before filtering with a lens shader.

This is the "best" way in the sense that it gives you your anti-aliasing back. However, be aware that this pretty much precludes you from doing any major exposure changes in post production, so you must already know that the exposure you have in your image is "ok" for how you plan to use it. I.e. the operation you do will pretty much keep blown-out things pegged as "white", and you will kill any detail in the overexposed region by doing so.

The problem with this is that doing the exposure in post is one of the main reasons of rendering to float in the first place! So it's a double-edged sword.

Anyway, there are multiple shaders to do this: One is the simple mib_lens_clamp shader which... well... just clamps. Duh.

A "nicer" and "more gentle" method is to use the mia_exposure_simple shader, which has a bit of control allowing you to do a "gentle clamp" (with the help of the "compression" feature), or the new mia_exposure_photographic (which does it's "gentle clamping" with the help of the "highlights_burn" paremeter). In either case use them in a "gamma=1" mode to keep the result in scene-reffered linear space (but "gently clamped"), since - I'm hoping - you are applying your display gamma in some later display step."

Last edited by jbardy : 08 August 2013 at 08:10 PM.
  08 August 2013
Was just browsing the free tuts on gnomon workshop and came across this little tip on using Shader Glow in Maya, if that happens to be the route you plan to take.

Quote: It is important to remember that specularity is a reflection of a lightsource. Therefore, if a light is bright enough to create an optical effect, a specular highlight from that light should also create an optical effect. Maya allows for this via the use of Shader Glow.

By default, when shader glow is enabled on a shader, all parts of a surface will appear to glow. But what we want is for just the specular, or brightest areas, to glow. This can be accomplished by editing the Shader Glow node accessible in Hypershade. Increasing the Threshold value will bias the glow towards brightness.

Since there can only be one Shader Glow node in a scene, this means that all shaders with glow enabled must have the exact same type of glow. This is unfortunate, and may force you into situations where you will need to render in layers.

note: always turn off Auto-Exposure on the Shader Glow node. This can cause glow to flicker in an animation. Lighting/Shading -> Make Light Links.
  08 August 2013
I don't think you can apply shader glow to a mia_material_x.

Lamberts ando ther maya materials have the glow under special effects, but mia material doesn't have this.

I also don't see any shaderglow or any glow shaders anywhere in hypershade. Am I missing something?
  09 September 2013
Hi all

I came across this thread and saw something that may help. In the render view window hit the "1:1" button. It will scale the view to 100% of actual size. I believe this is a display issue from scaling down the view.

Hope this helps.
Attached Images
File Type: jpg 1To1.jpg (58.3 KB, 7 views)
  09 September 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:43 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.