Advertisement
Guest User

bloom filter patch

a guest
Dec 15th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.87 KB | None | 0 0
  1. # This patch file was generated by NetBeans IDE
  2. # Following Index: paths are relative to: C:\Windows.old\Users\Toucher\Documents\jMonkeyProjects\trunk\engine\src\core-effects\com\jme3\post\filters
  3. # This patch can be applied using context Tools: Patch action on respective folder.
  4. # It uses platform neutral UTF-8 encoding and \n newlines.
  5. # Above lines and this line are ignored by the patching process.
  6. Index: BloomFilter.java
  7. --- BloomFilter.java Base (BASE)
  8. +++ BloomFilter.java Locally Modified (Based On LOCAL)
  9. @@ -95,6 +95,10 @@
  10.      private RenderManager renderManager;
  11.      private ViewPort viewPort;
  12.  
  13. +    private AssetManager assetManager;
  14. +    private int initalWidth;
  15. +    private int initalHeight;
  16. +    
  17.      /**
  18.       * Creates a Bloom filter
  19.       */
  20. @@ -115,6 +119,11 @@
  21.      protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) {
  22.               this.renderManager = renderManager;
  23.          this.viewPort = vp;
  24. +
  25. +        this.assetManager = manager;
  26. +        this.initalWidth = w;
  27. +        this.initalHeight = h;
  28. +                
  29.          screenWidth = (int) Math.max(1, (w / downSamplingFactor));
  30.          screenHeight = (int) Math.max(1, (h / downSamplingFactor));
  31.          //    System.out.println(screenWidth + " " + screenHeight);
  32. @@ -184,6 +193,10 @@
  33.      }
  34.  
  35.  
  36. +    protected void reInitFilter() {
  37. +        initFilter(assetManager, renderManager, viewPort, initalWidth, initalHeight);
  38. +    }
  39. +    
  40.      @Override
  41.      protected Material getMaterial() {
  42.          material.setFloat("BloomIntensity", bloomIntensity);
  43. @@ -286,6 +299,8 @@
  44.       */
  45.      public void setDownSamplingFactor(float downSamplingFactor) {
  46.          this.downSamplingFactor = downSamplingFactor;
  47. +        if (assetManager != null) // dirty isInitialised check
  48. +            reInitFilter();
  49.      }
  50.  
  51.      @Override
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement