View Single Post
Old 05 January 2017, 19:52   #2
Registered User
Join Date: Aug 2004
Posts: 2,829
Thanks very much!!!

I tried doing that over in this thread but my effort probably wasn't achieving the proper result since I never bothered to learn how to write shaders.

A couple of questions:
- Could this shader be modified to work with earlier ps/vs versions than 3.0?
- Is it necessary to initialise VS_OUTPUT OUT to 0 in vShader since you write all fields of it?

You wrote:
//If we knew the output size, this would work to always give the minimum blur:
//OUT.prescaleFactor = floor(output_size/texture_size);

At least when I experimented using a paint program to scale up then bilinear filter to the destination size, the result was marginally sharper with larger pre-scale factors. E.g. for 640-pixel input with 1024-pixel wide output, prescaling 3x or 4x before scaling down gave a slightly better result than 2x. (Should the commented-out line use ceil not floor?)
mark_k is offline  
Page generated in 0.17776 seconds with 9 queries