~jsjgruber/junk/vvvvnux

« back to all changes in this revision

Viewing changes to debian/patches/10-clamp-offsets.patch

  • Committer: John S Gruber
  • Date: 2013-07-03 00:30:44 UTC
  • Revision ID: johnsgruber@gmail.com-20130703003044-8x9ot97yc2zz75kx
* Checkpoint a working configuration. In summary, has the gauss weight/offset
  return patch, sets sigma to 3 to match Unity, doesn't use the acc variable,
  reduces the support value in the generation of weights/offsets by 2/9,
  and precomputes the per pixel distance value by width and height to
  save fragment shader work.
----
* Reduce sample points by another 1/9. Total about 1.6% shaved per size. 
* debian/patches/13-ubuntu-delete-acc.patch: remove acc from lsgauss shaders
* debian/patches/12-ubuntu-reduce-support.patch: Reduce number of sample
  points by 1/9. About a quarter of a percent reduction per side.
* debian/patches/11-vertex-calculations1.patch: calculate offsets in vertex
  shader.
* Remove many of the below, keeping return fix, increased sigma,
  and offset adjustment, add a clamp() to generated offsets 
* debian/patches/09-process-offsets.patch: adjust offsets
* debian/patches/07-set-default-color.patch: set default color in case
  LS shader doesn't complete. Set sigma to 4.0. Print values.
* debian/patches/05-increase-sigma.patch: 4.67

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Description: add some description
 
2
## Origin/Author: add some origin or author
 
3
## Bug: bug URL
 
4
--- a/NuxGraphics/RenderingPipeGLSL.cpp
 
5
+++ b/NuxGraphics/RenderingPipeGLSL.cpp
 
6
@@ -2102,8 +2102,10 @@
 
7
     
 
8
     int num_samples = LinearSampleGaussianWeights(weights, offsets, sigma);
 
9
     printf("num_samples in QRP_GLSL_HorizontalLSGauss %i\n", num_samples);
 
10
+    float support = float(int(sigma*3));
 
11
     for (int i=0; i < (int) offsets.size(); i++)
 
12
       {
 
13
+        Clamp(offsets[i], 0.0f, support);
 
14
         offsets[i] /= width;
 
15
       }
 
16
 
 
17
@@ -2181,8 +2183,10 @@
 
18
     
 
19
     int num_samples = LinearSampleGaussianWeights(weights, offsets, sigma);
 
20
     printf("num_samples in QRP_GLSL_HorizontalLSGauss %i\n", num_samples);
 
21
+    float support = float(int(sigma*3));
 
22
     for (int i=0; i < (int) offsets.size(); i++)
 
23
       {
 
24
+        Clamp(offsets[i], 0.0f, support);
 
25
         offsets[i] /= height;
 
26
       }
 
27