Click or drag to resize

TextureScaler Class

Retrieved From: https://pastebin.com/qkkhWs2J A unility class with functions to scale Texture2D Data. Scale is performed on the GPU using RTT, so it's blazing fast. Setting up and Getting back the texture data is the bottleneck. But Scaling itself costs only 1 draw call and 1 RTT State setup! WARNING: This script override the RTT Setup! (It sets a RTT!) Note: This scaler does NOT support aspect ratio based scaling. You will have to do it yourself! It supports Alpha, but you will have to divide by alpha in your shaders, because of premultiplied alpha effect. Or you should use blend modes.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          ASLTextureScaler

Namespace:  ASL
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public class TextureScaler : MonoBehaviour

The TextureScaler type exposes the following members.

Constructors
  NameDescription
Public methodTextureScaler
Initializes a new instance of the TextureScaler class
Top
Methods
  NameDescription
Private methodStatic member_gpu_scale
Public methodStatic memberscale
Scales the texture data of the given texture.
Public methodStatic memberscaled
Returns a scaled copy of given texture.
Top
See Also

Reference