Bias material parameter doesn't work correctly

Blender's renderer and external renderer export

Moderators: jesterKing, stiv

Post Reply
onip
Posts: 0
Joined: Fri Sep 30, 2005 6:32 am

Bias material parameter doesn't work correctly

Post by onip » Fri Feb 24, 2006 10:44 am

When rendering with spot lights(with shadow buffers on) Blender automatically blocks the diffuse illumination in regions on objects where the light is at 90 or more degrees(where it should selfshadow,the terminator).
This isn't good for different reasons,and makes the use of shadow maps(buffers) very limited for advanced shaders.
This happens only in Blender 2.41,while in Blender 2.39 and previous goes fine.
I think that the problem is due to the new bias parameter in the material panel.
Its effect, apparently, cannot be excluded from the shading: this bias parameter(the one in material panel) when using shadow buffers seems always turned on,even if unchecked in the interface(the bias parameter works fine, instead, with raytrace shadows).
This makes impossible to use shadow maps combined with some interesting shaders that try to simulate translucency or a more wrapped diffuse light model,because the adrupt change in illumination at 90 degree it's not accettable and the shadow bias makes the object too dark.
This is only visible if you try to use some shaders that go beyond 90 degrees(fresnel or toon shader),for a standard lambert or OrenNayar it's not a problem.
I tried to post this in the bug trackers but without positive answer.

Tested on windows xp with a Pentium 4 3ghz 2giga of RAM,with a geforce 4ti4200.

Some test render to show it better(HappyBuddha from Stanford).

http://img159.imageshack.us/my.php?imag ... der8po.png

Bye
Onip

P.S
Finally I find a trick to make it work correctly,but this remains a problem.
Last edited by onip on Thu Mar 09, 2006 10:35 pm, edited 1 time in total.

onip
Posts: 0
Joined: Fri Sep 30, 2005 6:32 am

Post by onip » Tue Mar 07, 2006 8:38 am

Nobody has the same problem?
Strange,I think shadow maps are rarely used here.

lusque
Posts: 11
Joined: Wed Oct 16, 2002 9:53 am

Post by lusque » Wed Mar 08, 2006 9:49 pm

Hi,

first thing: wonderful buddah!!! :shock:
Did you do that translucent effect only with shadowmapped lights?
Please, share your technique! :)

second: I think shadowmap are not so popular no more. That's a pity, for they are extremely useful at times.
I noticed some strange things too with shadowmaps in Blender 2.41, but I don't have an answer to your problem. It's also strange that you didn't get any response so far, maibe Ton is too busy with Orange to look at the bugtracker.
Have you tryed Elysiun? Being a user forum you should get more responses and if more people complain together...

onip
Posts: 0
Joined: Fri Sep 30, 2005 6:32 am

Post by onip » Thu Mar 09, 2006 11:29 am

Hi lusque,yes,the translucent effect is only shadow map stuff.
I'm developping and refining the tecnique,please keep in mind that is mainly for skin,the buddha isn't a really good example but not so bad to see after all,maybe I'll post some other render.
It's a pity that the bias bug isn't taked into consideration,it makes the thing more difficult, but not impossible.
When I'm really confident with the tecnique probably I'll make a tutorial and I'll make a proposal for someone to implement it directly in Blender internal renderer or maybe a python script(I dont' think that I'm going to make it myself,I'm not really a coder and I don't want spending my free time coding,I'm more an artist),
With some little modification to the shadowmap code the sss fake could be improved,now with nodes material all we need to have a good to see(but not accurate,it's a fake)subsurfacescattering is allready here,let's thank Ton
Last edited by onip on Thu Mar 09, 2006 11:08 pm, edited 2 times in total.

lusque
Posts: 11
Joined: Wed Oct 16, 2002 9:53 am

Post by lusque » Thu Mar 09, 2006 10:22 pm

Man, I just saw your mail in the mailing lists... :shock: ...you rule.

My jaw just dropped dead on the floor... :D ...the old man is incredible!!!

I'll look forward for the tutorial, can't wait :twisted:

PS: Hail hail to Ton, the benevolend dictator for life!

harkyman
Posts: 98
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Post by harkyman » Sat Mar 11, 2006 1:41 pm

Have you tried your techniques using one of the latest builds (found in the Testing Builds forum)? The renderer has been completely reworked, and I'm curious if the problem you've identified still remains.

Also, what method did you use to determine that it was the Bias parameter causing the problem?

onip
Posts: 0
Joined: Fri Sep 30, 2005 6:32 am

Post by onip » Sat Mar 11, 2006 4:34 pm

Harkyman,the problem is only in new builds,not old ones.
It seems that inbetween 2.39 and 2.41(I can't be more precise)with the introduction of the new shadow bias parameter for material something goes wrong in the evaluation of shadow maps(in self shadowing).
I'm sure that the problem is caused by the bias(or shadow bias) material properties,it's really easy to test.
Create a toon material shader,set the value to 1(ref),3.14(size) and 1(smoothness).In theory you should see a flat material,like a shadeless material.
But if you try to render with lamp(with shadow buffer)you'll see black areas where it should selfshadow,even if you unckecked the parameter.
But in Blender 2.39,where the shadow bias parameter doesn't exist,the render is fine(flat color)
I understand that my problem is a bit particular,because I use shadow maps lamps not for shadows but for scattering stuff.but it's a bug,I have posted it in bug tracker but it has immediately been closed,strange.
But in some way I fixed this,using a node trick,and I was able to create a nice(well,at least not so bad)material for skin.I'm relatively happy with this
take a look

test image
http://img104.imageshack.us/my.php?imag ... est6nj.jpg

another test

http://img107.imageshack.us/my.php?imag ... est9um.jpg

shading network

http://img118.imageshack.us/my.php?image=network7rw.jpg

Post Reply