fake miniature filter

Moritz Moeller realritz at virtualritz.com
Sun Jan 11 17:42:20 CET 2009


> That's basically what a bumpmap filter in Krita or Gimp does, isn't it? Take a
> layer (or mask, both are nodes) and use it to determine modifications in
> another layer or mask. I think I already finished porting the bumpmap filter
> this summer, so there's an example ready for anyone who wants to implement
> such a filter.

I guess my comment was more meant along the lines of: this should be 
available on a lower level and the developer of a filter not have to 
care about it much.

Basically, the developer should choose, for each parameter their filter 
exposes, if the parameter is constant or varying.
In the latter case, the filter needs to call a function to obtain the 
resp. local value of a parameter, at each position filtered.
Where this value comes from, ultimately, the developer does not need to 
know. This is managed by the application elsewhere.

In a good system such a parameter query function would be overloaded to 
support feeding just the parameter's name/id, optionally position, 
optionally four positions (returns a filtered value of the parameter 
over that area) and optionally a filter type (uses that filter to filter 
the value).

See the texture() shadeop in the RenderMan shading language.

Then there should be functions to get derivatives of the parameter in x 
& y direction (see the du() dv() functions and the dPdu and dPdv 
variables in the RenderMan shading language).

For bump mapping you probably needed to calculate a lot of this yourself 
already. It would be good to expose this in a high level API.

I certainly dunno how much work the current API requires to be that 
"high level".
If that stuff is already supported, ignore my comment. :)



More information about the kimageshop mailing list