Oren-Nayar-Blinn material model Blender version.

General discussion about the development of the open source Blender

Moderators: jesterKing, stiv

cessen
Posts: 109
Joined: Tue Oct 15, 2002 11:43 pm

Post by cessen »

LethalSideParting wrote:One little bug I've found though - when using the Toon shader, even if you switch anti-aliasing on, you still get jaggies on the edge of toon shaded objects (to see what I mean, insert a light, a sphere, give the sphere a toon material, put OSA on - any value will do - and render). Is this to augment the toonish look of it, or is it jjust something that hasn't been implemented yet?
This is niether a bug nor an intentional "look". The jaggies are due to a limitation of Blender's renderer: it only does anti-aliasing on polygon edges. So, since the edges of the shading rarely ever coincide perfectly with the polygon edges (with "smooth" turned on, anyway), it comes out aliased.

You could, potentially, get around this problem by rendering a larger image, and then shrinking in down in the GIMP or Photoshop. Of course, that's quite a hassle--especially for animations.

I have recently implimented two more parameters in the Toon shader, that allows you to make the shading transitions as smooth or sharp as you want. That will allow you to alleviate the aliasing problem (though not get rid of it entirely). However, I have not yet submitted these changes. You'll have to wait a couple of days or so.

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Post by Jamesk »

Cessen: On the topic on anti-aliasing (yeah, you know what I'm about to ask now, but I'll ask anyway)... are you DA MAN? The Messiah that comes here and fixes the current AA boxfilter into something more decent, like adaptive supersampling? C'mon, be DA MAN!

:) No pressure, of course...

cessen
Posts: 109
Joined: Tue Oct 15, 2002 11:43 pm

Post by cessen »

Jamesk wrote:Cessen: On the topic on anti-aliasing (yeah, you know what I'm about to ask now, but I'll ask anyway)... are you DA MAN? The Messiah that comes here and fixes the current AA boxfilter into something more decent, like adaptive supersampling? C'mon, be DA MAN!
Well, first of all, you are confusing the concepts of sampling and filtering. Sampling is the process of taking the samples, whereas filtering is the process of using those samples to calculate pixel color.

I *would* like to impliment alternate anti-aliasing filters, yes. But not right now--I'm only going to do one project at a time. Also, I haven't taken a look at that part of the rendering code yet, and thus I don't know how easy it will be to do that.
If it involves re-writing a significant amount of the code that is not directly related to anti-aliasing, then I probably won't do it (one might as well just write an entirely new renderer at that point--something that really should be put off until Blender 3.0).

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Post by Jamesk »

cessen wrote: you are confusing the concepts of sampling and filtering. Sampling is the process of taking the samples, whereas filtering is the process of using those samples to calculate pixel color.
Thank you for clearing that up! I had some idea about it, but not a very clear one.

And I realize that such a fix would probably not be trivial. But, then again, one can always dream...

In your opinion - what bit about the current renderer is it that "sucks", pardon the expression: the filtering or the sampling? And what would be easier to fix? I have a feeling that the sampling itself cannot be done in so many different ways... except of course if one would add some "adaptiveness" to it... So, it's the filtering, isn't it?

cessen
Posts: 109
Joined: Tue Oct 15, 2002 11:43 pm

Post by cessen »

Jamesk wrote:And I realize that such a fix would probably not be trivial. But, then again, one can always dream...
Well, I don't know if it will be trivial or not. That was my point. It is possible that it will be relatively simple to impliment... but it also might not be. Just wait for me to finish the material plugin system, and then I'll take a look at it.
Jamesk wrote:In your opinion - what bit about the current renderer is it that "sucks", pardon the expression: the filtering or the sampling?
Well, to be quite honest, neither of them "suck". The problem is their lack of flexability. There is really no perfect filter: it depends a lot on the specific case. This is why many programs (for instance, 3DS Max) allow you to choose the filter. And Blender's sampling strategy is quite good (though, admittedly, there are better ones--but it is still good).
In my opinion, what needs to be done is the following:
  • 1) Give the option for more samples to be taken (all the way up to 256 samples--beyond that really isn't useful unless you have a *really* stupid sampling strategy, which Blender doesn't).
    2) Give a choice of filters, with user definable widths.
I occurs to me that filters with more than a one pixel width will probably not be possible with the current renderer, since it only takes multiple samples on edges of polygons, so that will be rather limiting.
Jamesk wrote:And what would be easier to fix?
I don't know: I haven't looked at the code.
Jamesk wrote:I have a feeling that the sampling itself cannot be done in so many different ways... except of course if one would add some "adaptiveness" to it... So, it's the filtering, isn't it?
Well, sampling can actually be done in many different ways--not just adaptive or non-adaptive. The sampling strategy also has to do simply with the sample positions (i.e. what points you are taking the samples from). And it is quite important, actually.
But in Blender's case, the main problems are the filtering and the 16-sample maximum number of samples taken. And it depends on the specific cases which problem is the predominant cause of percieved aliasing.

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Post by Jamesk »

Cessen: Lot's of thanks for those in-depth answers! Now, I made some quick tests in 3Delight. Just to keep it simple I made a cube (hell yeah) and tilted it until the projection would generate those typically "dangerous" line angles. I first made a normal 3x3 samples using the "default" Catmul-Rom filter. Then I made another 3x3 samples using a boxfilter (which is, if I have understood things correctly, the same algorithm used by Blender).

I should of course post the pics here too... Maybe I'll fix that later today...
Anyway - the version with Catmul-Rom filtering looks clean, crisp and very nice. There is also something almost looking like a microscopic bevel effect on the edges (don't know if that is 3Delight-specific or a standard result of that filter) but all in all - it looks really really good.

The version with boxfilter looks blurry, smudged, painterly and generally ill-defined as far as edges go. In short: it looked like most Blender renders look... All other things where equal - the number of samples too.

Making it possible for the user to select from a variety of filters should be a really good strategy. There are of course cases when the boxfilter is just what you want. Most of the times you want something else, though.

I think Blender would benefit A LOT if filters and samplingdepth got an overhaul.

cessen
Posts: 109
Joined: Tue Oct 15, 2002 11:43 pm

Post by cessen »

Jamesk wrote:Cessen: Lot's of thanks for those in-depth answers!
You're very welcome. :)
Jamesk wrote:I first made a normal 3x3 samples using the "default" Catmul-Rom filter. Then I made another 3x3 samples using a boxfilter (which is, if I have understood things correctly, the same algorithm used by Blender).
Actually, Blender's filter is even more specific than that: Blender's filter is a box filter with a width of one pixel (i.e. it "covers" one pixel).
Jamesk wrote:Anyway - the version with Catmul-Rom filtering looks clean, crisp and very nice. There is also something almost looking like a microscopic bevel effect on the edges (don't know if that is 3Delight-specific or a standard result of that filter) but all in all - it looks really really good.
You can tweak the filter's width and the number of samples to get rid of the "bevel" effect.
Also, in my experience, the catmull-rom filter just gives a generally "articifically well-antialiased" look to the image. Real-life images' antialiasing has natural causes, and the catmull-rom filter doesn't try to simulate that "type" of antialiasing.
In practice, this doesn't really matter, since the "look" of the anti-aliasing is rarely something that people notice or care about. But I just thought I'd let you know anyway. :)
Jamesk wrote:The version with boxfilter looks blurry, smudged, painterly and generally ill-defined as far as edges go. In short: it looked like most Blender renders look... All other things where equal - the number of samples too.
Well, that's not surprising since it's the same filter that Blender uses. :)

I've probably mentioned this before, but my personal favorite anti-aliasing filter is the gaussian filter. And, interestingly enough, it is one of the filters that is closest to how "natural antialiasing" occurs in film and digital photography.
(Take that last comment with a grain of salt--I am by no means an expert on how digital cameras and film work, and thus I could easily be wrong about that).

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Post by Jamesk »

cessen wrote:Actually, Blender's filter is even more specific than that: Blender's filter is a box filter with a width of one pixel (i.e. it "covers" one pixel).
Ah... yes, the filter width...
Also, in my experience, the catmull-rom filter just gives a generally "articifically well-antialiased" look to the image.
I agree. But then again, I LIKE that artificial, super-crisp look. At least sometimes, well, most of the time...
In practice, this doesn't really matter, since the "look" of the anti-aliasing is rarely something that people notice or care about.
That is probably correct. There are quite a lot of "flaws" in our images that we only know about ourselves. However, other skilled observers in the CG business notice them too, and I'm sure that Blender will eventually be more likely to gain general acceptance in the industry if the render quality could be improved by implementing new, "combat-proven" filters and by moving the upper limit for sampling upwards, as you suggested earlier.
(about the sorry look of boxfiltered renders) Well, that's not surprising since it's the same filter that Blender uses. :)
Exactly. It's really a bit disheartening to get those results after spending all that time on modeling and material tweaking.
I've probably mentioned this before, but my personal favorite anti-aliasing filter is the gaussian filter.
Well, I usually go for "gaussian" every time it's available in some context. I'm referring to gaussian blur in photoshop, for instance. I'll have to add that to my list of example images... box, catmul-rom, gaussian... OK

env
Posts: 12
Joined: Thu Oct 17, 2002 9:58 pm
Location: Italy
Contact:

Post by env »

Well, I posted these on ElYsiun too, maybe someone could find them interesting:

Image

Image

I made two examples of the same scene: the first totally with blinn materials in the cessen version of Blender, the second with phong materials in version 2.23. The textures setting are absolutely the same in the two versions, I only modified spec and hard values in the left material pannel for the phong version.

I think to have found a bug: when importing blinn materials from others blend, they came as phong...
Anyway, cessen, thank you very much for this really interesting and useful version of Blender! :D

Env

JA-forreal
Posts: 0
Joined: Sat Mar 22, 2003 10:45 pm

Subsurface Scattering possible?

Post by JA-forreal »

Is a "Subsurface Scattering" shader possible in Blender at this stage or does Blender need a more advanced shading system?-

http://graphics.stanford.edu/papers/subsurface/

I was hooked up to this link of a simulated Phong Subsurface Scattering shader-

http://www.tomsporer.com/html/shader.html

Jamesk
Posts: 239
Joined: Mon Oct 14, 2002 8:15 am
Location: Sweden

Re: Subsurface Scattering possible?

Post by Jamesk »

JA-forreal wrote:Is a "Subsurface Scattering" shader possible - - - ?
There's at least a really cheap fake SSS roaming the community::..

--> http://www.elysiun.com/forum/viewtopic. ... highlight=

Far from the real thing, but pretty amusing stuff! The thing missing is 'thickness attenuation' (in lack of a better word)...

macke
Posts: 24
Joined: Tue Oct 15, 2002 11:57 pm

Post by macke »

Such timing!

dickie
Posts: 15
Joined: Fri Oct 18, 2002 11:45 am

Post by dickie »

One thing I don't like much though: when
you switch to blinn and then back to phong
it doesn't restore your old phong settings
(in particular, spec and hard have been
modified).
agree! it makes me hesitate to try out
differences between toon/blinn/phong.
it would be extremely nice if Blender
saved the shader info.

thank you so much for all your hard ass work cessen!
the new shaders are awesome! and a powerfully needed adition to
Blender.

why is 3Delight not 100% implememnted?
it doesn't work on my machine for example (AMD, Win2K).
is it only working on LinuX?

thanks again!

ilac
Posts: 131
Joined: Mon Oct 14, 2002 8:24 am

Post by ilac »

dickie wrote: why is 3Delight not 100% implememnted?
it doesn't work on my machine for example (AMD, Win2K).
is it only working on LinuX?
This is not an official release but a compiled version of the experimental tree. (Tuhopuu)

green
Posts: 81
Joined: Sun Oct 13, 2002 8:04 pm

Post by green »

dickie wrote:
One thing I don't like much though: when
you switch to blinn and then back to phong
it doesn't restore your old phong settings
(in particular, spec and hard have been
modified).
agree! it makes me hesitate to try out
differences between toon/blinn/phong.
it would be extremely nice if Blender
saved the shader info.

thank you so much for all your hard ass work cessen!
the new shaders are awesome! and a powerfully needed adition to
Blender.

why is 3Delight not 100% implememnted?
it doesn't work on my machine for example (AMD, Win2K).
is it only working on LinuX?

thanks again!
If I had possesion of a time machine it would be 100% integrated :)

As it is right now the code goes in and out of a working state very often. Right now it doesnt work. While writing the shadowmap support I accidentaly changed the code so that no meshes are exported.

Post Reply