[Bf-cycles] Differences between svm and osl performance relatd to texture filtering?

Martijn Berger martijn.berger at gmail.com
Sun Jul 7 13:09:55 CEST 2013


Hi Brecht,

Thx for the explanation. Also in some scenes like the Barcelona scene the
actual slowdown when using OSL is greater then a factor of 5. when testing
with 2.67b.
I will try to figure out actual cost for each of the pieces in the chain.
Since people like using lot and lots of textures I think if we can do
something to decrease this gap we might make osl shading more appealing.

Also do you know how this is handled in any other implementation of OSL. I
cannot imagine they would not run into this.




On Sun, Jul 7, 2013 at 12:15 PM, Brecht Van Lommel <
brechtvanlommel at pandora.be> wrote:

> OIIO is a lot more overhead even when using bilinear filtering, look
> at TextureSystemImpl::texture_lookup and accum_sample_bilinear. Plus
> it has to track texture coordinate derivatives this texture lookup in
> OSL. Might be interesting to run a profiler anyway, shows you
> immediately which functions are slow, can always be something
> unexpected.
>
> The more advanced texture filtering is nice if you take few AA
> samples. If you take many the simple SVM filtering will converge to
> the right results anyway so the extra cost isn't really worth it.
> Though for bilinear I guess a lot of the overhead comes from other
> features the texture lookup call provides, checking all the different
> options.
>
> On Sun, Jul 7, 2013 at 11:39 AM, Martijn Berger
> <martijn.berger at gmail.com> wrote:
> > I did some quick tests to empirically test the hypothesis that osl
> > performance is made much worse by texture filtering or translation of
> > structures.
> >
> > First texture filtering:
> >
> > I made a scene with a plane, a camera and an environment of a solid
> color:
> >
> > I added a texture and measured:
> >
> > svm:          OSL:        modified OSL:
> >
> > 0:12:40      0:27:72     0:26:60
> > 0:12:40      0:27:90     0:26:75
> > 0:12:40      0:28:03     0:26:53
> >
> > modified OSL is a one line change to force bi-linear texture
> interpolation:
> >
> > intern/cycles/kernel/osl/osl_services.cpp: ~ line 772 add:
> > options.interpmode = TextureOpt::InterpBilinear;
> >
> > I am getting what looks like a measurable significant result but no where
> > near what we need to explain performance gap.
> >
> > Diffuse:
> >
> > svm:          OSL:
> > 0:09:10      0:11:25
> > 0:09:10      0:11:17
> > 0:09:08      0:11:17
> >
> > noise texture
> >
> > svm:          OSL:
> > 0:17:02      0:23:18
> > 0:16:97      0:23:00
> > 0:16:98      0:22:96
> >
> > both of the above are in line with each other both would indicate a
> > performance loss of about 25 % on using OSL for trivial shaders due to
> > translation of data, OSL initialization etc.
> >
> > To me it seems that image textures are getting a huge hit and that the
> > SmartBicubic filter is not the main problem.
> >
> > Hope this info helps. I am continuing the dig to find the root cause.
> >
> >
> >
> >
> > _______________________________________________
> > Bf-cycles mailing list
> > Bf-cycles at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-cycles
> >
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20130707/b43396ed/attachment.htm 


More information about the Bf-cycles mailing list