fresnel reflection help

I am trying to create a realistic water shader in blender for the past days but I am always limited by its fake (and badly faked) fresnel mirror. I tryied many things, like rendering the refraction, reflection and normals and then using the normals as a mask in after effects. I found out that the fresnel must occur INSIDE the render engine. The fresnel in the reflection must influence the intensity of the rays that refract and vice versa.

I truly can not understand how can blender fail at this. Its raytrace is quite good. Creating the fresnel, i.e., simply limiting the raytrace based on the normal seems like a really easy task considering that blender already has some kind of twisted malfunctioning normal limitation.

Well, I try to illustrate the result from vray shaders and blender shader considering only the reflection in fresnel. You see that blender creates some kind of linear mask that takes the mirror straight from 1 to 0. In vray with a 1.33 ior controlling the reflection, neither the sides is fully reflecting, nor the front is withouth mirror. The second part of the image shows both shaders with curves in photoshop to illustrate how there is still reflection in the front part of the vray shader. And none in blender

This is extremely important. Because this real fresnell does not destroys the rays, it reflects only part of them, so, if a strong ray, like the sun, is in front of the ball, we would still see it. But we would see it much weaker.

In blender you will not see it at all. And will see it too strong on the sides.

So… is there a way to do it in blender engine? If not, what sollution can I get? Has anyone of you ever solved this? Searching in the forums I see it is not a new problem, but no one seems to really care or simply give up using blender render. I KNOW blender can do this. It has raytrace, it has normal mask of the raytrace. There must be a way to change it to behave decently!

Attachments


so the images labled “bright” are just copies of the first images with curves adjustments in photoshop? If that’s the case and if the images are in the same file format, then you’re right, blender just isn’t writing all of the data.

I made many,many tests. I am pretty sure the so called “fresnel” from blender reflection is no fresnel at all. As far as I searched, in dieletric materials the reflection is never 0, as in blender. It can only be very dim, but still showing very strong lights. It can, however, have zero refractance, but that would be for the whole material witch is not a problem here.

The point is that water should always reflect a little. And water is what I need to create.

By the way, both pictures were taken with print screen from the material slot. Both are 8bits rgb. You can tell by the posterization in the “bright” pictures.

have you tried SSS instead and make it almost transparent

  • a little of blender fresnel

might give what you want !

happy blendering

The Fresnel code in Blender is hopelessly broken. There are many issues about it and it is unusable except for special effects of some sort.

Ricky, I do not see how sss would help. A pool does have underwater scatter, but not the kind of blender.

ypoissant, thank you. That is what I did not want to hear but what I expected.
Will it be corrected in blender 2.5? The builds I tested seems to keep the problem.

I see I will have to search for a decent renderer like yafaray. Realistic fresnel is too important for most render scenarios to be ignored.

well are you talking about fresnel or caustic in water ?

mind you that in anyway yafaray migth give a lot more options in any case!

happy blendering

Because of this issue I got to test yafaray, and it is really wonderful
But it is not completely integrated with blender. I am experiencing serious bugs to animate, for example. To be able to do such a simple thing as fresnel in blender would be ideal.

And I am not talking about caustics.

i’m still a beginninger with yafaray but it;s a a lot more powerfull as a renderer then internal blender and i aleady did some nice rendering with yafaray for rings gems stones ectt

so take the time to read the doc available which is great and then ask questions on the forum

byt the way chek out the prism that i did this show a little the power of yafaray
which you cannot do in blender
http://www.yafaray.org/community/forum/viewtopic.php?f=13&t=2623&p=14359#p14359

good luck with your model

happy blendering

Last time I checked in the code, like 2 weeks ago, the same old Fresnel code was still there. I don’t think it is in the 2.5 plans to correct that. It would need a developer to decide on his own to take care of it. I documented the code errors and hints at fixes in the bug tracker but I can’t fix that myself because my hands are tied with my employer (and I’m not too happy with this situation right now I must say).

I think this node material could do better than the normal Fresnel.



.blend attached

Attachments

mat_test.blend (245 KB)

I did not see those answers

Ricky, I already solved it with yafaray. It is really impressive, but the ideal would be with blender.

ypoissant, I am happy that you did something about the problem, even if no one solves it. Is there something like that that I could do myself or does it takes a programmer to document a bug?
I suppose it does, since a non programmer like myself would not know if it is a bug…

ki4dfh, thank you! This is exactly what I was trying to achieve with nodes!
But there is this thing that I think is a bug as well that many times when you change the curves of something, the mix gets all messed up, with burn brightening the image or add darkening it.

I see you solved it creating a color ramp. I suppose that is because of this bug. But what about when you need a color corrected rgb picture? If you use coloramp it will turn it to black and white.

That is the second most frustrating thing I am facing with blender. This nodes bug. I spent hours trying to solve it with nodes but this bug would not let me. I thought of creating another topic to see if anyone helped me with that but I was already fed up with blender render and went with yafaray.

you have to remember that blender internal render is a compromise to get speed
and not high quality mind you there is some inporvment in 2.5
so blender render use a lot of trick to do effets to get a fast render!

but you best bet is with yafaray which offer a lot more options and power plus quality
you could also try luxrender whihc is also free for other effect too

anyway yafaray i think can get a lot more done for rendering and it’s always been tehre with blender

happy blendering

Blender internal render have many qualities. But speed is definitely not one of them!
It has a good subsurface, good raytrace, good occlusion and many other things, but it is the slowest non gi renderer I used.

I am not a programmer, but I am pretty sure that this fresnel bug is not there to make blender fast.

But… I am not a programmer. I can not help. Only complain.

Luxrender is in the other spcetrum. It is VERY slow, but it pays for it with amazing quality.

Yafaray is amazingly fast, amazingly good, everything amazing. I hope someday it gets integrated and, maybe, override blender internal blender to get maximum integration. Yafaray may be the best renderer I have used. And I used vray professionaly for a long time!

yafray was more integrated with blender then the new one yafaray
and for 2.5 it is less integreated more independant that’s how 2.5 works
but in 2.5 you can access other soft too
that’s how 2.5 was coneived from the start to help integrating other renderer
including yafaray

i like yafaray cause before i began uisng yafray a little and found it to be quit good
but it takes sometimes to render but with a high quality

you saw the example i did for spectrum of a prism
that cannot be done in blender i mean yafaray is more powerfull
and the latest version also include the IES lamps pattern
which allow to load up IES curve from manufacturer directly into yafaray

so hope you enjoy it and have fun rendering

happy blendering

The color ramp only affects the mix ammount, it has a minimum of 0.001 to keep some reflection there, it does not affect the color of the reflection.

Ricky, I am hoping for this integration in 2.5… is there already yafaray for it?

ki4dfh, I know, you used it in the factor so it will controll only the blend of the 2 material. But what if you wanted what I did, to mix the normal in the material in add or burn mode? When I did this, if I used curves like you did everything would go wrong.

But it seems to happens more in the composite node. In this case it is not happening. But your sollution is truly great. You used 2 different materials. I did that too, but in the composite node. I will try to create water with that. That is genious!

Well… I was here wondering “how could I not have thought of that? I tryied so many different things!” and I guess I DID try that. But I remember reading somewhere telling that you can not use refraction in this way. And I think I did only some tests and soon forgot about it.

I changed you matnode to refractive with 0 alpha. This is the result. I remember not trying much more because I really think it is complicated for the nodes to handle this kind of thing, the refracted rays hitting a modified node surface then refracting again… I do not know, seems complicated for blender to handle and so I gave up looking for a way In composite nodes.

That is when I realised that, ignoring this node bug I mention all the time, this idea can not work in composite, since the rays must be modified during the render itself. Otherwise the result will be weird.

But even if I can not use refractive objects, now I know how to create good reflections withouth composite.

Attachments


you could use HDRI map to get lot’s of reflection!\

another way would be ot use radiosity in blender
but complicated to do
easier in yafaray

another way would be to use and old reflection map
a bit tedious to do but it would work !

hope it helps

A few months ago, I was texturing, lighting and rendering scenes from the Lighting Challenge. When It came to the underwater scene, I could not get a nice refraction distortion because of some limitation with Blender IOR values. I think recalling that the IOR could not go over 2.0 and under 1.0. And because the scene was underwater, I would have needed an IOR of 0.75 to get the effect I wanted. Just to let you know in case this is an issue for you too.