[Bf-committers] Dithering

Goran Kocov gkocov at yahoo.com
Mon Nov 1 18:11:26 CET 2004


Hi!

--- Ton Roosendaal <ton at blender.org> wrote:

> It's in CVS now. I have some remarks however;

Great! Thanks.
 
> - You used this formula:
>    dither_value =
> (BLI_frand()*2.0-1.0)*R.r.dither_intensity/255.0;
>    BLI_frand() however (is docced in its .h) returns
> 0.0-1.0, so not  
> needed. :)

I'm not sure I understand. What's not needed? As you
say, BLI_frand() returns values between 0 and 1. On
the other hand, BLI_frand()*2.0-1.0 returns values
between -1 and 1. IMO, it's better to use a signed
noise for the dithering.
 
> - You applied the dither in the old renderer before
> color was gamma  
> corrected. That results in total loss of the dither
> then. I've added it  
> after, and nicely with shorts.

I'm still not very familiar with the code, so I put
the dither code on the first place where I thought it
would work. Thanks and I appologize for my mistake. 
 
> - Due to primitive state of old render code, the
> results for unified  
> render are much better. It can be fixed for old
> render too, but would  
> involve too many changes just before release.

I'll look at rendercore.c and try to come up with a
better implementation ASAP (I have some exams comming
soon, so I'm a little busy at the moment). Can you
give me some hints at what you think should be done?

Thanks again,
Goran


> 
> On 1 Nov, 2004, at 14:34, Goran Kocov wrote:
> 
> > That's great to hear! I can't wait to see my first
> > Blender experiment find it's way into CVS :)
> >
> > Thanks very, very much,
> > Goran
> >
> > --- Ton Roosendaal <ton at blender.org> wrote:
> >
> >> Hi,
> >>
> >> Thanks for the update with recent cvs. :)
> >> I've read the patch, and code looks clean and not
> >> intrusive or risky.
> >>
> >> Applying & testing patch bubbled to the top of my
> >> agenda, but not
> >> tonight anymore... more tomorrow.
> >>
> >> -Ton-
> >>
> >>
> >> On 31 Oct, 2004, at 11:58, Goran Kocov wrote:
> >>
> >>> A small bugfix update. The patch for the
> 31.10.04
> >> CVS
> >>> and the package containing the changed and the
> >>> original sources can be downloaded from:
> >>>
> >>>
> >>
> >
>
http://www.geocities.com/gkocov/misc/dither.patch.txt
> >>>
> >>
> >
>
http://www.geocities.com/gkocov/misc/blender_dither_code.tar.gz
> >>>
> >>> Goran
> >>>
> >>> --- Goran Kocov <gkocov at yahoo.com> wrote:
> >>>
> >>>> Hi everybody!
> >>>>
> >>>> One of the biggest problems I have with
> Blender's
> >>>> internal renderer is that it doesn't do any
> >>>> dithering
> >>>> to the output while converting the floating
> point
> >>>> values to 8-bit integer values, resulting in
> >>>> noticable
> >>>> banding in some cases.
> >>>>
> >>>> While it shouldn't be very hard to implement
> >> this,
> >>>> it
> >>>> seems that it isn't high on the developers'
> >> priority
> >>>> list, so I decided to try and implement it
> >> myself.
> >>>> I've made some very simple changes to the
> >> renderer,
> >>>> to
> >>>> the Struct-DNA and to the render output panel,
> >> and
> >>>> as
> >>>> far as I can tell, (with dithering on) the
> >> banding
> >>>> is
> >>>> pretty much nonexistant now. Also I've done
> some
> >>>> basic
> >>>> testing both with stills and with animations
> and
> >> I
> >>>> couldn't notice any bugs/problems. Check this
> >> topic
> >>>> on
> >>>> the blender.org forums for example images
> >>>>
> >>>>
> >>> http://www.blender.org/modules.php?
> >>> op=modload&name=phpBB2&file=viewtopic&t=4837
> >>>>
> >>>> Here's a patch made from the 27.10.2004 CVS
> (I've
> >>>> never made a patch before, so be prepared for a
> >>>> bumpy
> >>>> ride, sorry!).
> >>>>
> >>>>
> >>>
> >>
> >
>
http://www.geocities.com/gkocov/misc/dither.patch.txt
> >>>>
> >>>> If there are any problems with the patch
> there's
> >> a
> >>>> tar.gz archive containing the original sources,
> >> the
> >>>> changed sources and the differences between
> them
> >>>> (it's
> >>>> from a slightly older CVS - 21.10.2004, but
> that
> >>>> shouldn't be a big problem).
> >>>>
> >>>>
> >>>
> >>
> >
>
http://www.geocities.com/gkocov/misc/blender_dither_code.tar.gz
> >>>>
> >>>> This is my first time working with Blender's
> code
> >>>> and
> >>>> I don't have much C/C++ experience, so please
> be
> >>>> gentle on me. :)
> >>>>
> >>>> Goran
> >>>>
> >>>>
> >>>>
> >>
> __________________________________________________
> >>>> Do You Yahoo!?
> >>>> Tired of spam?  Yahoo! Mail has the best spam
> >>>> protection around
> >>>> http://mail.yahoo.com
> >>>> _______________________________________________
> >>>> Bf-committers mailing list
> >>>> Bf-committers at projects.blender.org
> >>>>
> >>>
> >>
> >
>
http://projects.blender.org/mailman/listinfo/bf-committers
> >>>>
> >>>
> >>>
> >>>
> >>> 		
> >>> __________________________________
> >>> Do you Yahoo!?
> >>> Yahoo! Mail Address AutoComplete - You start. We
> >> finish.
> >>> http://promotions.yahoo.com/new_mail
> >>> _______________________________________________
> >>> Bf-committers mailing list
> >>> Bf-committers at projects.blender.org
> >>>
> >>
> >
>
http://projects.blender.org/mailman/listinfo/bf-committers
> >>>
> >>>
> >>
> >
>
-----------------------------------------------------------------------
> 
> > -
> >>
> >> --
> >> Ton Roosendaal  Blender Foundation
> ton at blender.org
> >> http://www.blender.org
> >>
> 
=== message truncated ===



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail


More information about the Bf-committers mailing list