Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ANAGLYPH_JAPAN(
- R.drawable.mini,
- filter = AnaglyphFilter(greenFactor = 0.7f),
- colorRes = R.color.pack_none
- ),
- ANAGLYPH_TOKYO(
- R.drawable.mini,
- filter = AnaglyphFilter(redFactor = 0.7f),
- colorRes = R.color.pack_none
- ),
- ANAGLYPH_NOGANO(
- R.drawable.mini,
- filter = AnaglyphFilter(blueFactor = 0.7f),
- colorRes = R.color.pack_none
- ),
- ANAGLYPH_KYOTO(
- R.drawable.mini,
- filter = AnaglyphFilter(redFactor = 0.7f, blueFactor = 0.7f),
- colorRes = R.color.pack_none
- ),
- ANAGLYPH_FUJI(
- R.drawable.mini,
- filter = AnaglyphFilter(greenFactor = 0.5f, blueFactor = 0.5f),
- colorRes = R.color.pack_none
- )
- private const val VERTEX_SHADER = """
- attribute vec4 aPosition;
- attribute vec4 aTextureCoord;
- varying highp vec2 gbCoordinate;
- varying highp vec2 rCoordinate;
- uniform float imageWidthFactor;
- uniform float imageHeightFactor;
- void main() {
- gl_Position = aPosition;
- mediump vec2 offset = vec2( -imageWidthFactor, imageHeightFactor);
- gbCoordinate = aTextureCoord.xy;
- rCoordinate = aTextureCoord.xy + offset;
- }
- """
- private val FRAGMENT_SHADER = """
- precision highp float;
- uniform lowp sampler2D sTexture;
- uniform mediump float redFactor;
- uniform mediump float greenFactor;
- uniform mediump float blueFactor;
- varying highp vec2 gbCoordinate;
- varying highp vec2 rCoordinate;
- void main() {
- gl_FragColor = vec4(texture2D(sTexture, rCoordinate).r * redFactor, texture2D(sTexture, gbCoordinate).g * greenFactor, texture2D(sTexture, gbCoordinate).b * blueFactor, 1.0);
- }
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement